[WinCairo][WK1] A browser window starts as an inactive window because AcceleratedComp...
[WebKit-https.git] / Source / WebCore / ChangeLog-2019-06-05
1 2019-06-05  Antoine Quint  <graouts@apple.com>
2
3         [Pointer Events] Fire pointerout and pointerleave events after firing pointercancel
4         https://bugs.webkit.org/show_bug.cgi?id=198560
5
6         Reviewed by Dean Jackson.
7
8         The Pointer Events specification mandates that "pointerout" and "pointerleave" events must be dispatched
9         immediately after dispatching a "pointercancel" event.
10
11         Since we needed to determine the bubbling, cancelable and composed nature of those events in additional
12         places, we now have static methods to determine this defined in PointerEvent.h such that both PointerEvent.cpp
13         and PointerEventIOS.cpp may use them. This should guarantee consistency going forward.
14
15         * dom/PointerEvent.cpp:
16         (WebCore::PointerEvent::create):
17         (WebCore::PointerEvent::PointerEvent):
18         * dom/PointerEvent.h:
19         * dom/ios/PointerEventIOS.cpp:
20         (WebCore::pointerEventType):
21         (WebCore::PointerEvent::create):
22         (WebCore::PointerEvent::PointerEvent):
23         (WebCore::phaseIsCancelable): Deleted.
24         (WebCore::typeCanBubble): Deleted.
25         * page/PointerCaptureController.cpp:
26         (WebCore::PointerCaptureController::cancelPointer):
27
28 2019-06-05  Saam Barati  <sbarati@apple.com>
29
30         [WHLSL] Implement loop expressions
31         https://bugs.webkit.org/show_bug.cgi?id=195808
32         <rdar://problem/50746309>
33
34         Reviewed by Myles Maxfield.
35
36         This patch makes continue/break break for "do/while/for" loops
37         in WHLSL. Because of the way we emit code where every expression
38         turns into a Metal statement, it's not convenient to emit native
39         Metal loop constructs. Instead, we model break/continue as if
40         we had goto.
41         
42         For example, this WHLSL program:
43         ```
44         for (INIT; COND; INC) {
45             if (b)
46                 continue;
47             if (b2)
48                 break;
49         }
50         ```
51         would become something like:
52         ```
53         INIT;
54         while (1) {
55             if (!COND)
56                 break;
57             if (b)
58                 goto increment;
59             if (b2)
60                 goto exit;
61         increment:
62             INC;
63         }
64         exit:
65         ```
66         
67         However, Metal doesn't have goto, so we model goto using a run-once
68         loop and a variable indicating if we should break out early. This
69         "break out early" variable is initially set to false. We "should
70         break out early" when executing a WHLSL "break" statement. "continue"
71         is modeled as breaking out of the run-once loop, but not touching the
72         "break out early" variable. "break" is modeled as setting the "break
73         out early" variable to true, followed by breaking out of the run-once loop.
74         The above WHLSL will turn into this Metal:
75         ```
76         bool breakOutOfCurrentLoop = false;
77         INIT;
78         while (1) {
79             if (!COND)
80                 break;
81             do {
82                 if (b) {
83                     // WHLSL 'continue'
84                     break;
85                 }
86                 if (b2) {
87                     // WHLSL 'break'
88                     breakOutOfCurrentLoop = true;
89                     break;
90                 }
91             } while (0);
92             if (breakOutOfCurrentLoop)
93                 break;
94             INC;
95         }
96         ```
97         
98         This patch also found a bug with ForLoop where it held a Variant<VariableDeclarationsStatement, Expression>.
99         This is invalid to do since we mutate the AST in place. This means some phase
100         could replace VariableDeclarationsStatement with some other Statement, and
101         we'd be breaking the C++ type system. So this patch migrates ForLoop to hold
102         a statement instead. In general, AST nodes that point to other AST nodes
103         should use broad types unless we know apriori that a certain type will
104         never be replaced.
105
106         Tests: webgpu/whlsl-do-while-loop-break.html
107                webgpu/whlsl-do-while-loop-continue.html
108                webgpu/whlsl-do-while-loop.html
109                webgpu/whlsl-loops-break.html
110                webgpu/whlsl-loops-continue.html
111                webgpu/whlsl-loops.html
112                webgpu/whlsl-nested-loop.html
113                webgpu/whlsl-while-loop-break.html
114                webgpu/whlsl-while-loop-continue.html
115
116         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
117         (WebCore::WHLSL::AST::ForLoop::ForLoop):
118         (WebCore::WHLSL::AST::ForLoop::initialization):
119         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
120         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
121         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
122         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
123         (WebCore::WHLSL::ASTDumper::visit):
124         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
125         (WebCore::WHLSL::Checker::visit):
126         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
127         (WebCore::WHLSL::Parser::parseForLoop):
128         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
129         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
130         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
131         (WebCore::WHLSL::Visitor::visit):
132
133 2019-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
134
135         Upstream content mode support into open source from WebKitAdditions
136         https://bugs.webkit.org/show_bug.cgi?id=198484
137         <rdar://problem/51355671>
138
139         Reviewed by Andy Estes.
140
141         * Modules/modern-media-controls/media/media-controller.js:
142         (MediaController.prototype.get layoutTraits):
143
144         Adjust modern media controls code to use iOS-style controls on PLATFORM(IOS_FAMILY), instead of depending on the
145         navigator's platform name or the presence of touch events.
146
147         * page/Quirks.cpp:
148         (WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
149         (WebCore::shouldEmulateUndoRedoInHiddenEditableAreasForHost):
150         * page/SettingsBase.h:
151         * rendering/RenderThemeIOS.mm:
152         (WebCore::RenderThemeIOS::mediaControlsScript):
153
154 2019-06-05  Saam Barati  <sbarati@apple.com>
155
156         [WHLSL] checkDuplicateFunctions() should not be O(n^2)
157         https://bugs.webkit.org/show_bug.cgi?id=198155
158         <rdar://problem/51288811>
159
160         Reviewed by Myles Maxfield.
161
162         Originally, we filed this bug because we thought checkDuplicateFunctions()
163         would take on the order of hundreds of milliseconds when using the
164         full standard library. However, I was never able to reproduce that phase
165         taking that long. I was seeing it take 3.5-4ms. Anyways, it makes sense
166         to make this phase not be O(N^2), since the number of functions is a user
167         controlled value. I am now seeing ~2.5ms to run this phase against the
168         full standard library. On a microbenchmark I checked against, where there
169         were 100,000 unique functions, this pass runs twice as fast as it used
170         to, now taking 450ms instead of 900ms.
171
172         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
173         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
174         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
175         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
176         (WebCore::WHLSL::AST::PointerType::PointerType):
177         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
178         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
179         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
180         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
181         (WebCore::WHLSL::DuplicateFunctionKey::DuplicateFunctionKey):
182         (WebCore::WHLSL::DuplicateFunctionKey::isEmptyValue const):
183         (WebCore::WHLSL::DuplicateFunctionKey::isHashTableDeletedValue const):
184         (WebCore::WHLSL::DuplicateFunctionKey::hash const):
185         (WebCore::WHLSL::DuplicateFunctionKey::operator== const):
186         (WebCore::WHLSL::DuplicateFunctionKey::Hash::hash):
187         (WebCore::WHLSL::DuplicateFunctionKey::Hash::equal):
188         (WebCore::WHLSL::DuplicateFunctionKey::Traits::isEmptyValue):
189         (WebCore::WHLSL::checkDuplicateFunctions):
190
191 2019-06-05  Zalan Bujtas  <zalan@apple.com>
192
193         [LFC][IFC] LineLayout::placeInlineItems should not apply float contraint.
194         https://bugs.webkit.org/show_bug.cgi?id=198565
195         <rdar://problem/51440718>
196
197         Reviewed by Antti Koivisto.
198
199         This patch moves float constraint handling from placeInlineItems() to LineLayout::layout().
200         When placeInlineItems() is called by the preferred width computation, intruding floats should be ignored
201         since they don't constrain the "min/max lines".
202
203         * layout/inlineformatting/InlineFormattingContext.h:
204         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
205         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::HorizontalConstraint::HorizontalConstraint):
206         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
207         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
208         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
209         (WebCore::Layout::constructLine): Deleted.
210
211 2019-06-05  Truitt Savell  <tsavell@apple.com>
212
213         Unreviewed, rolling out r246052.
214
215         Caused 3 webgpu/ failures.
216
217         Reverted changeset:
218
219         "[WHLSL] Parsing and lexing the standard library is slow"
220         https://bugs.webkit.org/show_bug.cgi?id=192890
221         https://trac.webkit.org/changeset/246052
222
223 2019-06-05  Michael Catanzaro  <mcatanzaro@igalia.com>
224
225         [GStreamer] Crash in MediaPlayerPrivateGStreamerBase::ensureGstGLContext
226         https://bugs.webkit.org/show_bug.cgi?id=198567
227
228         Reviewed by Philippe Normand.
229
230         MediaPlayerPrivateGStreamerBase::ensureGstGLContext is currently a guaranteed crash because
231         it expects PlatformDisplay::sharedDisplayForCompositing() to return a PlatformDisplayLibWPE
232         if compiled with USE(WPE_RENDERER), but PlatformDisplayLibWPE has lower precedence than
233         PlatformDisplayX11 and PlatformDisplayWayland. When running our layout tests with
234         run-webkit-tests --gtk, it's guaranteed to be a PlatformDisplayX11.
235
236         I think Carlos was clearly expecting PlatformDisplayLibWPE, so I don't know what the ideal
237         desired behavior is, but the crashes go away if we change the code to allow any type of
238         PlatformDisplay. This should hopefully fix our bots, which are still exiting early.
239
240         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
241         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
242
243 2019-06-05  Zalan Bujtas  <zalan@apple.com>
244
245         [LFC][IFC] Move inline item height computation to a dedicated function
246         https://bugs.webkit.org/show_bug.cgi?id=198550
247         <rdar://problem/51424223>
248
249         Reviewed by Antti Koivisto.
250
251         The inlineItem height value is not available during preferred width computation (hence optional). 
252
253         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
254         (WebCore::Layout::UncommittedContent::add):
255         (WebCore::Layout::inlineItemWidth):
256         (WebCore::Layout::inlineItemHeight):
257         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
258         * layout/inlineformatting/InlineLine.cpp:
259         (WebCore::Layout::Line::appendInlineContainerStart):
260         (WebCore::Layout::Line::appendInlineContainerEnd):
261         (WebCore::Layout::Line::appendTextContent):
262         (WebCore::Layout::Line::appendNonReplacedInlineBox):
263         (WebCore::Layout::Line::appendReplacedInlineBox):
264         * layout/inlineformatting/InlineLine.h:
265
266 2019-06-01  Antoine Quint  <graouts@apple.com>
267
268         [Pointer Events] Add support for chorded button interactions
269         https://bugs.webkit.org/show_bug.cgi?id=198462
270
271         Reviewed by Dean Jackson.
272
273         Pointer events differ from mouse events in that pressing a button on a mouse and then pressing a second button
274         would yield two "mousedown" events but a single "pointerdown" event, for the first time we're transitioning from
275         a state where no button is pressed at all, and then a "pointermove" event to indicate an additional button has been
276         pressed. This is what the Pointer Events specification calls "chorded button interactions".
277         See https://w3c.github.io/pointerevents/#chorded-button-interactions for the full details.
278
279         To implement this, we no longer directly call PointerEvent::create() from Element::dispatchMouseEvent() but instead
280         call the new PointerCaptureController::pointerEventForMouseEvent() which implements the required logic to determine
281         for "mousedown" and "mouseup" mouse events, if we're transitioning from or to a state where no button is pressed at
282         all.
283
284         While that basic change is pretty small, a wider change was required to report the correct value for a PointerEvents'
285         "button" property which should return "-1" when there is no change in pressed button state compared to any previous
286         pointer event.
287
288         Up until now, MouseEvent.button was an "unsigned short", as specified up to and including DOM Level 2 Events. But the
289         UI Events spec says that property is a "short", and PointerEvent is the only interface where a "-1" value is used. This
290         required some changes throughout our codebase since we used a "-1" value to specify that no button was pressed when dealing
291         with NSEvent input and going through PlatformMouseEvent and eventually MouseEvent. So now we change the various NoButton
292         enum values to be "-2" and use that value, which is not going to be used for any mouse button, as the value reflected as
293         "0" through MouseEvent.button, as specified by UI Events.
294
295         Furthermore, we identified another issue: MouseEvent.buttons would always return 0 in DRT and WKTR. We rely upon that
296         value in PointerCaptureController::pointerEventForMouseEvent() and so we had to make that work for the relevant WPT test,
297         web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html, to pass and show a correct implementation
298         of chorded button interactions. The details of the work required for this is in Tools/ChangeLog.
299
300         * dom/Element.cpp:
301         (WebCore::Element::dispatchMouseEvent):
302         * dom/MouseEvent.cpp:
303         (WebCore::MouseEvent::create):
304         (WebCore::MouseEvent::MouseEvent):
305         (WebCore::MouseEvent::initMouseEvent):
306         (WebCore::MouseEvent::initMouseEventQuirk):
307         * dom/MouseEvent.h:
308         (WebCore::MouseEvent::button const):
309         * dom/MouseEvent.idl:
310         * dom/MouseEventInit.h:
311         * dom/MouseEventInit.idl:
312         * dom/PointerEvent.cpp:
313         (WebCore::PointerEvent::create):
314         (WebCore::PointerEvent::PointerEvent):
315         * dom/PointerEvent.h:
316         * loader/NavigationAction.h:
317         * page/PointerCaptureController.cpp:
318         (WebCore::PointerCaptureController::pointerEventForMouseEvent):
319         * page/PointerCaptureController.h:
320         * platform/PlatformMouseEvent.h:
321
322 2019-06-05  Michael Catanzaro  <mcatanzaro@igalia.com>
323
324         REGRESSION(r245796): [WPE][GTK] Web process crash on startup
325         https://bugs.webkit.org/show_bug.cgi?id=198485
326
327         Reviewed by Chris Dumez.
328
329         ResourceRequest's PageIdentifier may be unset, which causes coding to fail as
330         ObjectIdentifiers are required to be valid (nonzero). We need to use Optional here.
331         Previously, 0 was used to indicate unset page ID. This is clearer.
332
333         * platform/network/soup/ResourceRequest.h:
334         (WebCore::ResourceRequest::initiatingPageID const):
335         (WebCore::ResourceRequest::decodeWithPlatformData):
336         * platform/network/soup/ResourceRequestSoup.cpp:
337         (WebCore::ResourceRequest::updateSoupRequest const):
338
339 2019-06-04  Ryosuke Niwa  <rniwa@webkit.org>
340
341         iPadOS: Google calendars new event picker moves and flickers in landscape with software keyboard
342         https://bugs.webkit.org/show_bug.cgi?id=198556
343
344         Reviewed by Wenson Hsieh.
345
346         Fix the issuse that it's really hard to create a new event using Google calendar on iPadOS with
347         a software keyboard enabled because tapping on date brings up software keyboard and erratically
348         shifts up/down the new event dialog/pane.
349
350         Add a site specific quirk to pretend these input elements have inputmode=none for now.
351
352         No new tests since this is a site specific quirk.
353
354         * page/Quirks.cpp:
355         (WebCore::Quirks::needsInputModeNoneImplicitly const):
356
357 2019-06-04  Zalan Bujtas  <zalan@apple.com>
358
359         [ContentChangeObserver] Gmail text editing controls require two taps
360         https://bugs.webkit.org/show_bug.cgi?id=198541
361         <rdar://problem/51375055>
362
363         Reviewed by Simon Fraser.
364
365         When the animation completes we should also check if the newly visible content is also clickable and report it accordingly.
366         When the animated content is not clickable, we need to proceed with click instead of stopping at hover.
367
368         Test: fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove-no-clickable.html
369
370         * page/ios/ContentChangeObserver.cpp:
371         (WebCore::isConsideredClickable):
372         (WebCore::ContentChangeObserver::didFinishTransition):
373         (WebCore::ContentChangeObserver::adjustObservedState):
374         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
375         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const): Deleted. -> Turn it into a static function so that didFinishTransition could call it as well.
376         * page/ios/ContentChangeObserver.h:
377
378 2019-06-04  Michael Catanzaro  <mcatanzaro@igalia.com>
379
380         Fix miscellaneous build warnings
381         https://bugs.webkit.org/show_bug.cgi?id=198544
382
383         Reviewed by Don Olmstead.
384
385         Carefully silence -Wsign-compare warnings.
386
387         * contentextensions/DFABytecodeCompiler.cpp:
388         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
389         * inspector/InspectorCanvas.cpp:
390         (WebCore::InspectorCanvas::indexForData):
391         * xml/XSLStyleSheetLibxslt.cpp:
392         (WebCore::XSLStyleSheet::parseString):
393
394 2019-06-04  Keith Rollin  <krollin@apple.com>
395
396         Fix 64-bit vs 32-bit mismatch in ISOFairPlayStreamingPsshBox.cpp
397         https://bugs.webkit.org/show_bug.cgi?id=198539
398         <rdar://problem/51410358>
399
400         Reviewed by Alex Christensen.
401
402         Both ISOFairPlayStreamingKeyAssetIdBox and
403         ISOFairPlayStreamingKeyContextBox have Vector<> data members. The
404         parse() members of these classes call Vector<>::resize() on these
405         members. In both cases, the type of the parameter passed is a
406         uint64_t. However, resize() takes a size_t. On some platforms, size_t
407         is a 32-bit value, leading to a compile-time type mismatch error. Fix
408         this by changing the type of the value passed to parse() into a
409         size_t.
410
411         No new tests -- no new functionality.
412
413         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp:
414         (WebCore::ISOFairPlayStreamingKeyAssetIdBox::parse):
415         (WebCore::ISOFairPlayStreamingKeyContextBox::parse):
416
417 2019-06-04  Keith Rollin  <krollin@apple.com>
418
419         Fix 64-bit vs 32-bit mismatch in TileController.cpp
420         https://bugs.webkit.org/show_bug.cgi?id=198540
421         <rdar://problem/51410851>
422
423         Reviewed by Alex Christensen.
424
425         TileController::blankPixelCountForTiles calculates its result as a
426         uint64_t, but returns it as an unsigned. The former is a 64-bit value,
427         while the latter can be a 32-bit value on some platforms. This
428         mismatch can lead to a compile-time error. Fix this by explicitly
429         casting the 64-bit value to an "unsigned".
430
431         No new tests -- no new functionality.
432
433         * platform/graphics/ca/TileController.cpp:
434         (WebCore::TileController::blankPixelCountForTiles):
435
436 2019-06-04  Chris Dumez  <cdumez@apple.com>
437
438         Crash when calling XMLHttpRequest.setRequestHeader() in a worker
439         https://bugs.webkit.org/show_bug.cgi?id=198534
440         <rdar://problem/51393912>
441
442         Reviewed by Alex Christensen.
443
444         Make sure the script execution context is a Document because calling document()
445         to get the settings.
446
447         Test: fast/workers/worker-xhr-setRequestHeader.html
448
449         * xml/XMLHttpRequest.cpp:
450         (WebCore::XMLHttpRequest::setRequestHeader):
451
452 2019-06-04  Antti Koivisto  <antti@apple.com>
453
454         Sticky positioning is jumpy in many overflow cases
455         https://bugs.webkit.org/show_bug.cgi?id=198532
456         <rdar://problem/51400532>
457
458         Reviewed by Simon Fraser.
459
460         Tests: scrollingcoordinator/ios/sticky-overflow-no-stacking-context-no-stick-1.html
461                scrollingcoordinator/ios/sticky-overflow-no-stacking-context-no-stick-2.html
462                scrollingcoordinator/ios/sticky-overflow-no-stacking-context-stick-1.html
463                scrollingcoordinator/ios/sticky-overflow-no-stacking-context-stick-2.html
464                scrollingcoordinator/ios/sticky-overflow-stacking-context-no-stick.html
465                scrollingcoordinator/ios/sticky-overflow-stacking-context-stick.html
466
467         * page/scrolling/ScrollingTree.cpp:
468         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
469         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
470
471         Simplify for relatedNodeScrollPositionDidChange removal.
472
473         * page/scrolling/ScrollingTree.h:
474         * page/scrolling/ScrollingTreeNode.cpp:
475         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange): Deleted.
476         * page/scrolling/ScrollingTreeNode.h:
477         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
478         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
479         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
480         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
481         (WebCore::ScrollingTreePositionedNode::scrollOffsetSinceLastCommit const):
482
483         Factor into a function.
484
485         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
486         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange): Deleted.
487
488         We can't bail out based on changed node as that makes us compute different positions based on what the change root is.
489         Since all relatedNodeScrollPositionDidChange functions now always simply call applyLayerPositions we can remove the whole thing.
490
491         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
492         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
493
494         Implement taking into account that the containing scroller may not be our ancestor.
495
496 2019-06-04  Takashi Komori  <Takashi.Komori@sony.com>
497
498         [WinCairo] Implement cpu and memory measuring functions.
499         https://bugs.webkit.org/show_bug.cgi?id=198466
500
501         Reviewed by Don Olmstead.
502
503         Tests: inspector/memory/tracking.html
504                inspector/cpu-profiler/tracking.html
505
506         * PlatformWinCairo.cmake:
507         * page/ResourceUsageThread.h:
508         * page/win/ResourceUsageOverlayWin.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp.
509         (WebCore::ResourceUsageOverlay::platformInitialize):
510         (WebCore::ResourceUsageOverlay::platformDestroy):
511         * page/win/ResourceUsageThreadWin.cpp: Added.
512         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
513         (WebCore::fileTimeToUint64):
514         (WebCore::getCurrentCpuTime):
515         (WebCore::cpuUsage):
516         (WebCore::memoryUsage):
517         (WebCore::ResourceUsageThread::platformCollectCPUData):
518         (WebCore::ResourceUsageThread::platformCollectMemoryData):
519
520 2019-06-04  Antoine Quint  <graouts@apple.com>
521
522         [Pointer Events] Only allow pointer capture if the pointer is in the active buttons state
523         https://bugs.webkit.org/show_bug.cgi?id=198479
524
525         Reviewed by Dean Jackson.
526
527         The Pointer Events specification says that pointer capture can only be engaged provided the pointer is
528         in the active buttons state, which means that it has dispatched a "pointerdown" event more recently than
529         it has a "pointerup" event.
530
531         This is tested by web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html.
532
533         That test showed a few issues that this patch addresses. First, we would update the pointerIsPressed state to
534         "true" only after a "pointerdown" event had been dispatched. This is incorrect since setPointerCapture() can,
535         and is likely to, be called during handling of a "pointerdown" event. So we now call pointerEventWillBeDispatched()
536         prior to dispatching a PointerEvent with a mouse type, which we only did previously for a PointerEvent with a
537         touch or pen type. If the event is "pointerdown", we set "pointerIsPressed" to true on the CapturingData object
538         matching the given pointer, and to false if the event is "pointerup".
539
540         Finally, we must also ensure that "pointerIsPressed" is set to true when creating CapturingData for a PointerEvent
541         with a touch or pen type since these types of pointer events implictly set capture.
542
543         * page/PointerCaptureController.cpp:
544         (WebCore::PointerCaptureController::setPointerCapture):
545         (WebCore::PointerCaptureController::dispatchEvent):
546         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
547         (WebCore::PointerCaptureController::pointerEventWasDispatched):
548
549 2019-06-04  Keith Rollin  <krollin@apple.com>
550
551         Fix 32-bit/64-bit mismatch in PointerCaptureController::elementWasRemoved
552         https://bugs.webkit.org/show_bug.cgi?id=198501
553         <rdar://problem/51370464>
554
555         Reviewed by Chris Dumez.
556
557         keyAndValue.key is assigned to pointerId. KeyAndValue.key is a
558         int64_t, whereas pointerId is a PointerID, aka int32_t. This mismatch
559         is normally just a warning, but breaks builds where warnings are
560         treated as errors.
561
562         This issue is not encountered in most builds because the warning is
563         disabled in the majority of build configurations. But there are some
564         where the warning is not disabled, and so those builds break.
565
566         Address this conversion error/warning by explicitly casting
567         keyAndValue.key to a PointerID (and adding a debug check to make sure
568         the cast is OK).
569
570         No new tests -- no new functionality.
571
572         * page/PointerCaptureController.cpp:
573         (WebCore::PointerCaptureController::elementWasRemoved):
574
575 2019-06-02  Antoine Quint  <graouts@apple.com>
576
577         [Pointer Events] Expose navigator.maxTouchPoints
578         https://bugs.webkit.org/show_bug.cgi?id=198468
579         <rdar://problem/51273029>
580
581         Reviewed by Chris Dumez.
582
583         Expose the navigator.maxTouchPoints property when Pointer Events are enabled both at compile-time and run-time.
584         We return a canned value for this on iOS touch-enabled devices that matches the number of simultaneous touches
585         supported by the system, which is 5. In fact, iPad support more simultaneous touches, but it doesn't seem worthy
586         to expose this level of granularity due to fingerprinting practices. In practice, what really matters is returning
587         0, 1 or more than 1 for this value to identify multi-touch support.
588
589         Test: js/dom/navigator-maxtouchpoints.html
590
591         * CMakeLists.txt:
592         * DerivedSources-input.xcfilelist:
593         * DerivedSources-output.xcfilelist:
594         * DerivedSources.make:
595         * Sources.txt:
596         * WebCore.xcodeproj/project.pbxproj:
597         * dom/NavigatorMaxTouchPoints.idl: Added.
598         * page/Navigator.idl:
599         * page/Navigator.h:
600         (WebCore::Navigator::maxTouchPoints const):
601
602 2019-06-04  Zalan Bujtas  <zalan@apple.com>
603
604         [LFC][IFC] Decouple float placement and line shrinking
605         https://bugs.webkit.org/show_bug.cgi?id=198528
606         <rdar://problem/51397638>
607
608         Reviewed by Antti Koivisto.
609
610         In LineLayout::placeInlineItems() float handling should be only about shrinking the current line, the actual
611         float placement should happen later when we construct the the display boxes/runs. It enables the preferred width
612         computation to call placeInlineItems() to gather line widths without accidentally mutating the layout context. 
613
614         * layout/inlineformatting/InlineFormattingContext.h:
615         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
616         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
617         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
618         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
619         (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const): Deleted.
620         * layout/inlineformatting/InlineItem.h:
621
622 2019-06-04  Zalan Bujtas  <zalan@apple.com>
623
624         [LFC][IFC] Add hard line break handling to LineBreaker
625         https://bugs.webkit.org/show_bug.cgi?id=198503
626         <rdar://problem/51373482>
627
628         Reviewed by Antti Koivisto.
629
630         LineBreaker should simply return BreakingContext::Keep with the breaking opportunity of yes.
631
632         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
633         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
634         * layout/inlineformatting/InlineLineBreaker.cpp:
635         (WebCore::Layout::LineBreaker::breakingContext):
636         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
637         (WebCore::Layout::LineBreaker::isAtBreakingOpportunity):
638         * layout/inlineformatting/InlineLineBreaker.h:
639
640 2019-06-04  Zalan Bujtas  <zalan@apple.com>
641
642         [LFC][IFC] Remove InlineItem::width
643         https://bugs.webkit.org/show_bug.cgi?id=198502
644         <rdar://problem/51371744>
645
646         Reviewed by Antti Koivisto.
647
648         InlineItems are supposd to work across subsequent layouts (and in preferred width computation as well) so they should
649         not hold on to layout information (run width). This would not work with split runs either.
650
651         * layout/inlineformatting/InlineFormattingContext.h:
652         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
653         (WebCore::Layout::UncommittedContent::runs):
654         (WebCore::Layout::UncommittedContent::isEmpty const):
655         (WebCore::Layout::UncommittedContent::size const):
656         (WebCore::Layout::UncommittedContent::add):
657         (WebCore::Layout::UncommittedContent::reset):
658         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
659         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
660         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
661         (): Deleted.
662         (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const): Deleted.
663         * layout/inlineformatting/InlineItem.h:
664         (WebCore::Layout::InlineItem::style const):
665         (): Deleted.
666         (WebCore::Layout::InlineItem::setWidth): Deleted.
667         (WebCore::Layout::InlineItem::width const): Deleted.
668
669 2019-06-04  Zalan Bujtas  <zalan@apple.com>
670
671         [LFC][IFC] Move run width measuring out of LineBreaker
672         https://bugs.webkit.org/show_bug.cgi?id=198491
673         <rdar://problem/51363554>
674
675         Reviewed by Antti Koivisto.
676
677         LineBreaker should not need to deal with measuring runs.
678         This is also in preparation for removing InlineItem::width().
679
680         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
681         (WebCore::Layout::inlineItemWidth):
682         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
683         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
684         * layout/inlineformatting/InlineLineBreaker.cpp:
685         (WebCore::Layout::LineBreaker::breakingContext):
686         (WebCore::Layout::LineBreaker::LineBreaker): Deleted.
687         (WebCore::Layout::LineBreaker::runWidth const): Deleted.
688         (WebCore::Layout::LineBreaker::textWidth const): Deleted.
689         * layout/inlineformatting/InlineLineBreaker.h:
690
691 2019-06-04  Zalan Bujtas  <zalan@apple.com>
692
693         [LFC][IFC] Remove redundant InlineItem::width() calls.
694         https://bugs.webkit.org/show_bug.cgi?id=198489
695         <rdar://problem/51360390>
696
697         Reviewed by Antti Koivisto.
698
699         This is in preparation for removing InlineItem::width().
700
701         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
702         (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const):
703         (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const):
704         * layout/inlineformatting/InlineLine.cpp:
705         (WebCore::Layout::Line::appendNonBreakableSpace):
706         (WebCore::Layout::Line::appendInlineContainerStart):
707         (WebCore::Layout::Line::appendInlineContainerEnd):
708         * layout/inlineformatting/InlineLine.h:
709
710 2019-06-04  Antoine Quint  <graouts@apple.com>
711
712         The "mouseenter" and "pointerenter" events are fired from the bottom up
713         https://bugs.webkit.org/show_bug.cgi?id=198036
714         <rdar://problem/50940350>
715
716         Reviewed by Darin Adler.
717
718         Ensure "mouseenter" and "pointerenter" events are dispatched from the bottom up to match the UI Events spec
719         at https://w3c.github.io/uievents/#events-mouseevent-event-order. We also fix the issue where "pointerevent"
720         and "pointerleave" events were dispatched as bubbling events on iOS which is not correct and was caught by the
721         new iOS test.
722  
723         Tests: pointerevents/ios/enter-leave-order.html
724                pointerevents/mouse/enter-leave-order.html
725
726         * dom/ios/PointerEventIOS.cpp:
727         (WebCore::typeCanBubble):
728         (WebCore::PointerEvent::PointerEvent):
729         * page/EventHandler.cpp:
730         (WebCore::EventHandler::updateMouseEventTargetNode):
731         * page/PointerCaptureController.cpp:
732         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
733
734 2019-06-04  Cathie Chen  <cathiechen@igalia.com>
735
736         JS wrapper of target in ResizeObserverEntry/ResizeObserver shouldn't get collected ahead
737         https://bugs.webkit.org/show_bug.cgi?id=197457
738
739         Reviewed by Ryosuke Niwa.
740
741         Add JSCustomMarkFunction to make sure JS wrappers wouldn't be collected when JSResizeObserverEntry live.
742
743         For ResizeObserver, if targets are removed, it will get fired for the last time. We also need to keep these JS
744         wrappers live. So add these targets to a GCReachableRef list once they're observed.
745
746         Add element-leak.html to test the targets with `entry.target.myEntry = entry` could be released properly.
747
748         Tests: resize-observer/element-leak.html
749                resize-observer/resize-observer-entry-keeps-js-wrapper-of-target-alive.html
750                resize-observer/resize-observer-keeps-js-wrapper-of-target-alive.html
751
752         * Sources.txt:
753         * WebCore.xcodeproj/project.pbxproj:
754         * bindings/js/JSResizeObserverEntryCustom.cpp: Added.
755         (WebCore::JSResizeObserverEntry::visitAdditionalChildren):
756         * page/ResizeObserver.cpp:
757         (WebCore::ResizeObserver::observe):
758         (WebCore::ResizeObserver::removeAllTargets):
759         (WebCore::ResizeObserver::removeObservation):
760         (WebCore::ResizeObserver::stop):
761         * page/ResizeObserver.h:
762         * page/ResizeObserverEntry.idl:
763
764 2019-06-03  Andy Estes  <aestes@apple.com>
765
766         [Apple Pay] Disable script injection when canMakePayment APIs are called and return true
767         https://bugs.webkit.org/show_bug.cgi?id=198448
768         <rdar://problem/51323694>
769
770         Reviewed by Alex Christensen.
771
772         Previously, only an active Apple Pay session would disable script injection in restricted
773         WKWebViews. However, this can result in websites rendering non-functional Apple Pay buttons
774         due to the race between the hosting app calling -evaluateJavaScript:completionHandler: and
775         the website calling canMakePayment APIs to determine whether to draw a button.
776
777         This patch makes it so that, if a website calls ApplePaySession's canMakePayments or
778         canMakePaymentsWithActiveCard, or PaymentRequest's canMakePayment, in a web view that has no
779         injected scripts, and those calls return true, future script injections from the hosting app
780         will be blocked.
781
782         Also, this patch removes the restrictions on the openPaymentSetup, supportsVersion, and
783         validatedPaymentNetwork APIs, since those APIs do not reveal transaction information and are
784         not used to determine whether to draw buttons.
785
786         Added new API tests.
787
788         * Modules/applepay/PaymentCoordinator.cpp:
789         (WebCore::PaymentCoordinator::supportsVersion const):
790         (WebCore::PaymentCoordinator::canMakePayments):
791         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
792         (WebCore::PaymentCoordinator::openPaymentSetup):
793         (WebCore::PaymentCoordinator::beginPaymentSession):
794         (WebCore::PaymentCoordinator::validatedPaymentNetwork const):
795         (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
796         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
797         (WebCore::PaymentCoordinator::shouldAllowApplePay const): Deleted.
798         * Modules/applepay/PaymentCoordinator.h:
799         * dom/Document.cpp:
800         (WebCore::Document::isApplePayActive const):
801         (WebCore::Document::setApplePayIsActive):
802         (WebCore::Document::hasStartedApplePaySession const): Deleted.
803         (WebCore::Document::setHasStartedApplePaySession): Deleted.
804         * dom/Document.h:
805         * testing/Internals.cpp:
806         (WebCore::Internals::setApplePayIsActive):
807         (WebCore::Internals::setHasStartedApplePaySession): Deleted.
808         * testing/Internals.h:
809         * testing/Internals.idl:
810
811 2019-06-03  Robin Morisset  <rmorisset@apple.com>
812
813         [WHLSL] Parsing and lexing the standard library is slow
814         https://bugs.webkit.org/show_bug.cgi?id=192890
815         <rdar://problem/50746335>
816
817         Reviewed by Myles Maxfield.
818
819         The main idea is to avoid backtracking by instead peeking at the next token (and occasionally at the one after that).
820         This implies a few things:
821         - 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).
822         - We now have "completeFooExpression" functions, to avoid having to reparse the prefix of some expression, if we find half-way through what it is.
823
824         I also fixed the following parser bug:
825         - https://bugs.webkit.org/show_bug.cgi?id=198305 [WHLSL] Multiple variables with initializers in a declaration statement crashes the compiler
826             which was due to a mistake I made in the grammar
827
828         Finally I added two new macros: CONSUME_TYPE and PARSE to eliminate about 500 lines of error propagation boilerplate.
829
830         There are still lots of ways of improving the parser and lexer, such as:
831         - finishing the conversion of tokens in the lexer, not bothering with allocating string views
832         - make two special tokens Invalid and EOF, to remove the overhead of Optional
833         - make peekTypes and consumeTypes use templates to avoid constructing a Vector and calling find on it.
834         - 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)
835         - Remove the last few pieces of backtracking from the parser.
836
837         The current patch is already enough to make parsing the full standard library (something like 85k lines) approximately 260ms.
838         This is still longer than I would like, but nowhere near the bottleneck any longer because of some other parts of the compiler.
839
840         * Modules/webgpu/WHLSL/WHLSLLexer.h:
841         (WebCore::WHLSL::Lexer::Lexer):
842         (WebCore::WHLSL::Lexer::consumeToken):
843         (WebCore::WHLSL::Lexer::peek):
844         (WebCore::WHLSL::Lexer::peekFurther):
845         (WebCore::WHLSL::Lexer::state const):
846         (WebCore::WHLSL::Lexer::setState):
847         (WebCore::WHLSL::Lexer::unconsumeToken): Deleted.
848         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
849         (WebCore::WHLSL::Parser::parse):
850         (WebCore::WHLSL::Parser::peek):
851         (WebCore::WHLSL::Parser::peekTypes):
852         (WebCore::WHLSL::Parser::tryType):
853         (WebCore::WHLSL::Parser::tryTypes):
854         (WebCore::WHLSL::Parser::consumeTypes):
855         (WebCore::WHLSL::Parser::parseConstantExpression):
856         (WebCore::WHLSL::Parser::parseTypeArgument):
857         (WebCore::WHLSL::Parser::parseTypeArguments):
858         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
859         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
860         (WebCore::WHLSL::Parser::parseType):
861         (WebCore::WHLSL::Parser::parseTypeDefinition):
862         (WebCore::WHLSL::Parser::parseResourceSemantic):
863         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
864         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
865         (WebCore::WHLSL::Parser::parseSemantic):
866         (WebCore::WHLSL::Parser::parseQualifiers):
867         (WebCore::WHLSL::Parser::parseStructureElement):
868         (WebCore::WHLSL::Parser::parseStructureDefinition):
869         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
870         (WebCore::WHLSL::Parser::parseEnumerationMember):
871         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
872         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
873         (WebCore::WHLSL::Parser::parseAttributeBlock):
874         (WebCore::WHLSL::Parser::parseParameter):
875         (WebCore::WHLSL::Parser::parseParameters):
876         (WebCore::WHLSL::Parser::parseFunctionDefinition):
877         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
878         (WebCore::WHLSL::Parser::parseVertexFragmentFunctionDeclaration):
879         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
880         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
881         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
882         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
883         (WebCore::WHLSL::Parser::parseBlock):
884         (WebCore::WHLSL::Parser::parseBlockBody):
885         (WebCore::WHLSL::Parser::parseIfStatement):
886         (WebCore::WHLSL::Parser::parseSwitchStatement):
887         (WebCore::WHLSL::Parser::parseSwitchCase):
888         (WebCore::WHLSL::Parser::parseForLoop):
889         (WebCore::WHLSL::Parser::parseWhileLoop):
890         (WebCore::WHLSL::Parser::parseDoWhileLoop):
891         (WebCore::WHLSL::Parser::parseVariableDeclaration):
892         (WebCore::WHLSL::Parser::parseVariableDeclarations):
893         (WebCore::WHLSL::Parser::parseStatement):
894         (WebCore::WHLSL::Parser::parseEffectfulExpression):
895         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
896         (WebCore::WHLSL::Parser::parseExpression):
897         (WebCore::WHLSL::Parser::parseTernaryConditional):
898         (WebCore::WHLSL::Parser::completeTernaryConditional):
899         (WebCore::WHLSL::Parser::parseAssignment):
900         (WebCore::WHLSL::Parser::completeAssignment):
901         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
902         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
903         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
904         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
905         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
906         (WebCore::WHLSL::Parser::parsePossibleShift):
907         (WebCore::WHLSL::Parser::completePossibleShift):
908         (WebCore::WHLSL::Parser::parsePossibleAdd):
909         (WebCore::WHLSL::Parser::completePossibleAdd):
910         (WebCore::WHLSL::Parser::parsePossibleMultiply):
911         (WebCore::WHLSL::Parser::completePossibleMultiply):
912         (WebCore::WHLSL::Parser::parsePossiblePrefix):
913         (WebCore::WHLSL::Parser::parsePossibleSuffix):
914         (WebCore::WHLSL::Parser::parseCallExpression):
915         (WebCore::WHLSL::Parser::parseTerm):
916         (WebCore::WHLSL::Parser::parseAddressSpaceType): Deleted.
917         (WebCore::WHLSL::Parser::parseNonAddressSpaceType): Deleted.
918         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration): Deleted.
919         (WebCore::WHLSL::Parser::parseEffectfulPrefix): Deleted.
920         (WebCore::WHLSL::Parser::parseEffectfulSuffix): Deleted.
921         * Modules/webgpu/WHLSL/WHLSLParser.h:
922         (WebCore::WHLSL::Parser::Error::dump const):
923
924 2019-06-03  Youenn Fablet  <youenn@apple.com>
925
926         Allow resizing of camera video feeds to very small resolutions
927         https://bugs.webkit.org/show_bug.cgi?id=198421
928
929         Reviewed by Alex Christensen.
930
931         Before the patch, the minimum capture resolution was set to 120.
932         Since this is a bit arbitrary and there are some use cases for lower resolution,
933         We now allow down to 1x1 resolution.
934
935         Test: fast/mediastream/getUserMedia-video-rescaling.html
936
937         * platform/mediastream/RealtimeVideoSource.cpp:
938         (WebCore::RealtimeVideoSource::updateCapabilities):
939         Allow 1x1 when computing min/max resolutions.
940         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
941         In case width and height are provided, we pick the closest preset that matches and resize accordingly.
942         If width or height is provided, we pick the closest preset tat matches and applies its aspect ratio.
943
944 2019-06-03  Wenson Hsieh  <wenson_hsieh@apple.com>
945
946         Implement an internal switch to turn idempotent text autosizing and viewport rules off
947         https://bugs.webkit.org/show_bug.cgi?id=198460
948         <rdar://problem/51324526>
949
950         Reviewed by Tim Horton.
951
952         Add a new WebCore setting for viewport shrink-to-fit-content heuristics; additionally, tweak the existing
953         idempotent text autosizing setting to default to false (this is overridden by preferences at the WebKit layer).
954
955         * page/Settings.yaml:
956
957 2019-06-03  Rob Buis  <rbuis@igalia.com>
958
959         Implement imagesrcset and imagesizes attributes on link rel=preload
960         https://bugs.webkit.org/show_bug.cgi?id=192950
961
962         Reviewed by Youenn Fablet.
963
964         Implement imagesrcset and imagesizes attributes for both Link header
965         and link element.
966
967         Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html
968                imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html
969                imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html
970                imported/w3c/web-platform-tests/preload/link-header-preload.html
971                imported/w3c/web-platform-tests/preload/onload-event.html
972                imported/w3c/web-platform-tests/preload/preload-with-type.html
973
974         * html/HTMLAttributeNames.in:
975         * html/HTMLLinkElement.cpp:
976         (WebCore::HTMLLinkElement::process):
977         * html/HTMLLinkElement.idl:
978         * loader/LinkHeader.cpp:
979         (WebCore::paramterNameFromString):
980         (WebCore::LinkHeader::setValue):
981         (WebCore::LinkHeader::LinkHeader):
982         * loader/LinkHeader.h:
983         (WebCore::LinkHeader::imageSrcSet const):
984         (WebCore::LinkHeader::imageSizes const):
985         (WebCore::LinkHeader::isViewportDependent const):
986         * loader/LinkLoader.cpp:
987         (WebCore::LinkLoader::loadLinksFromHeader):
988         (WebCore::LinkLoader::preloadIfNeeded):
989         (WebCore::LinkLoader::loadLink):
990         * loader/LinkLoader.h:
991         * page/RuntimeEnabledFeatures.h:
992         (WebCore::RuntimeEnabledFeatures::linkPreloadResponsiveImagesEnabled const):
993         (WebCore::RuntimeEnabledFeatures::setLinkPreloadResponsiveImagesEnabled):
994
995 2019-06-02  Andy Estes  <aestes@apple.com>
996
997         Memory-cached main resources continue to load after the client decides a content policy of PolicyAction::Download
998         https://bugs.webkit.org/show_bug.cgi?id=198469
999         <rdar://problem/50512713>
1000
1001         Reviewed by Youenn Fablet.
1002
1003         When a document is loaded from the memory cache it does not have a main resource loader, but
1004         DocumentLoader::continueAfterContentPolicy relies on being able to call
1005         ResourceLoader::didFail on the main resource loader to cancel the provisional navigation
1006         when the client decides a content policy of PolicyAction::Download.
1007
1008         This means that memory-cached main resources continue to load even after WebKit has started
1009         to download the main resource. The expected behavior is for the provisional navigation to
1010         fail once the download starts, like what happens when there is a main resource loader.
1011
1012         This patch teaches DocumentLoader::continueAfterContentPolicy to call
1013         stopLoadingForPolicyChange() in the case of a null main resource loader. This will dispatch
1014         didFailProvisionalNavigation and remove the DocumentLoader as a client of its
1015         CachedRawResource to prevent it from delivering any cached data.
1016
1017         Added a new API test.
1018
1019         * loader/DocumentLoader.cpp:
1020         (WebCore::DocumentLoader::continueAfterContentPolicy):
1021
1022 2019-06-03  Timothy Hatcher  <timothy@apple.com>
1023
1024         Tweak the text and underline color for data detected text.
1025         https://bugs.webkit.org/show_bug.cgi?id=198487
1026         rdar://problem/50667125
1027
1028         Reviewed by Devin Rousso.
1029
1030         Tests: Color.RGBToHSL API tests
1031
1032         * editing/cocoa/DataDetection.mm:
1033         (WebCore::DataDetection::detectContentInRange): Use currentcolor so semantic text colors work.
1034         Force the lightness of the underline color to the middle, and multiply the alpha by 38%,
1035         so the color will appear on light and dark backgrounds, since only one color can be specified.
1036         * platform/graphics/Color.cpp:
1037         (WebCore::Color::getHSL const): Return hue in [0...6) range to easily round-trip with makeRGBAFromHSLA().
1038
1039 2019-06-03  Don Olmstead  <don.olmstead@sony.com>
1040
1041         [CMake] Add WebKit::JavaScriptCore target
1042         https://bugs.webkit.org/show_bug.cgi?id=198403
1043
1044         Reviewed by Konstantin Tokarev.
1045
1046         Use the WebKit::JavaScriptCore target.
1047
1048         * CMakeLists.txt:
1049
1050 2019-06-03  Zan Dobersek  <zdobersek@igalia.com>
1051
1052         [Nicosia] Disable async scrolling until implemented
1053         https://bugs.webkit.org/show_bug.cgi?id=198476
1054         <rdar://problem/51351478>
1055
1056         Unreviewed follow-up to r246033.
1057
1058         * page/scrolling/ScrollingCoordinator.cpp:
1059         Expand the PLATFORM(IOS) guard to IOS_FAMILY.
1060
1061 2019-06-03  Darin Adler  <darin@apple.com>
1062
1063         Finish cleanup of String::number for floating point
1064         https://bugs.webkit.org/show_bug.cgi?id=198471
1065
1066         Reviewed by Yusuke Suzuki.
1067
1068         * css/CSSCursorImageValue.cpp:
1069         (WebCore::CSSCursorImageValue::customCSSText const): Use makeString instead
1070         of StringBuilder since it is more terse and possibly more efficient as well.
1071         * css/DOMMatrixReadOnly.cpp:
1072         (WebCore::DOMMatrixReadOnly::toString const): Ditto.
1073         * css/WebKitCSSMatrix.cpp:
1074         (WebCore::WebKitCSSMatrix::toString const): Ditto.
1075
1076         * html/parser/HTMLParserIdioms.cpp:
1077         (WebCore::serializeForNumberType): Use String::number instead of
1078         String::numberToStringECMAScript since that is now the default.
1079         * html/shadow/MediaControlElementTypes.cpp:
1080         (WebCore::MediaControlVolumeSliderElement::setVolume): Ditto.
1081         * html/shadow/MediaControlElements.cpp:
1082         (WebCore::MediaControlTimelineElement::setPosition): Ditto.
1083         * platform/Decimal.cpp:
1084         (WebCore::Decimal::fromDouble): Ditto.
1085
1086         * rendering/RenderListMarker.cpp:
1087         (WebCore::toRoman): Return a String instead of taking a StringBuilder argument.
1088         Use LetterCase enum instead of bool for the uppercase vs. lowercase argument, to
1089         be less mysterious at call sites. Use unsigned for string lengths since that's
1090         what WTF::String uses.
1091         (WebCore::toAlphabeticOrNumeric): Ditto. Also updated since SequenceType is now
1092         an enum class.
1093         (WebCore::toSymbolic): Use String::createUninitialized instead of StringBuilder.
1094         Return a String instead of taking a StringBuilder argument. Straighten out the
1095         algorithm so it's easier to understand.
1096         (WebCore::toAlphabetic): Updated since SequenceType is now an enum class.
1097         (WebCore::toNumeric): Ditto.
1098         (WebCore::toHebrew): Return a String instead of taking a StringBuilder argument.
1099         Use unsigned for string lengths since that's what WTF::String uses.
1100         (WebCore::toArmenianUnder10000): Use unsigned and the LetterCase enum class.
1101         (WebCore::toArmenian): Return a String instead of taking a StringBuilder argument.
1102         Also use unsigned for string lengths since that's what WTF::String uses.
1103         (WebCore::toGeorgian): Ditto.
1104         (WebCore::toCJKIdeographic): Ditto.
1105         (WebCore::listMarkerSuffix): Tweaked a comment.
1106         (WebCore::listMarkerText): Use String return values instead of StringBuilder.
1107         (WebCore::RenderListMarker::paint): Use String::createUninitialized instead of
1108         StringBuilder since it's a bit more efficient. Use makeString instead of turning
1109         single characters into strings since that's more efficient.
1110
1111         * svg/SVGPathUtilities.cpp:
1112         (WebCore::buildStringFromPath): Use appendNumber instead of appendShortestFormNumber
1113         since that is now the default.
1114
1115 2019-06-03  Zan Dobersek  <zdobersek@igalia.com>
1116
1117         [Nicosia] Disable async scrolling until implemented
1118         https://bugs.webkit.org/show_bug.cgi?id=198476
1119
1120         Reviewed by Antti Koivisto.
1121
1122         Build ScrollingCoordinator::create() method on iOS or whenever
1123         ASYNC_SCROLLING is not enabled.
1124
1125         Additionally, the USE(COORDINATED_GRAPHICS) build guards are removed
1126         throughout the async scrolling classes as they aren't required now
1127         and shouldn't be in the future.
1128
1129         * page/scrolling/ScrollingCoordinator.cpp:
1130         * page/scrolling/ScrollingStateFixedNode.cpp:
1131         * page/scrolling/ScrollingStateFixedNode.h:
1132         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
1133         * page/scrolling/ScrollingStateFrameHostingNode.h:
1134         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1135         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1136         * page/scrolling/ScrollingStateNode.cpp:
1137         * page/scrolling/ScrollingStateNode.h:
1138         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
1139         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
1140         * page/scrolling/ScrollingStatePositionedNode.cpp:
1141         * page/scrolling/ScrollingStatePositionedNode.h:
1142         * page/scrolling/ScrollingStateScrollingNode.cpp:
1143         * page/scrolling/ScrollingStateScrollingNode.h:
1144         * page/scrolling/ScrollingStateStickyNode.cpp:
1145         * page/scrolling/ScrollingStateStickyNode.h:
1146         * page/scrolling/ScrollingStateTree.cpp:
1147         * page/scrolling/ScrollingStateTree.h:
1148
1149 2019-06-03  Antoine Quint  <graouts@apple.com>
1150
1151         [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
1152         https://bugs.webkit.org/show_bug.cgi?id=198191
1153
1154         Unreviewed post-commit review feedback suggested by Darin Adler.
1155
1156         * page/PointerCaptureController.cpp:
1157         (WebCore::PointerCaptureController::reset):
1158
1159 2019-06-01  Simon Fraser  <simon.fraser@apple.com>
1160
1161         [Async overflow scroll] Flashing content when scrolling async overflow with a negative z-index child
1162         https://bugs.webkit.org/show_bug.cgi?id=198458
1163
1164         Reviewed by Dean Jackson.
1165
1166         Set the GraphicsLayerPaintOverflowContents phase on the foreground layer in a composited overflow scroller,
1167         which prevents clipping to the visible region, fixing scrolling flashes.
1168
1169         Tested by compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases.html
1170
1171         * rendering/RenderLayerBacking.cpp:
1172         (WebCore::RenderLayerBacking::updatePaintingPhases):
1173
1174 2019-06-01  Simon Fraser  <simon.fraser@apple.com>
1175
1176         Async overflow scroll on iOS paints slowly if it has a negative z-index child
1177         https://bugs.webkit.org/show_bug.cgi?id=196508
1178         rdar://problem/49532709
1179
1180         Reviewed by Dean Jackson.
1181         
1182         If a RenderLayerBacking had a foreground layer and a scrolled contents layer, every geometry
1183         update would change the size and offsetFromRenderer of the foreground layer between two
1184         states, triggering repaint.
1185
1186         Fix by updating the fore- and background-layers last (nothing elese has dependencies
1187         on their geometry), and using GraphicsLayer::DontSetNeedsDisplay as we do for the
1188         scrolled contents layer.
1189         
1190         The test also revealed a bug where the shapeMaskLayer would get incorrect geometry when scrollbars
1191         were visible, because it would be squished by setting the wrong bounds, so fix that.
1192
1193         Test: compositing/repaint/scroller-with-foreground-layer-repaints.html
1194
1195         * platform/graphics/ca/GraphicsLayerCA.cpp:
1196         (WebCore::GraphicsLayerCA::updateClippingStrategy):
1197         * rendering/RenderLayerBacking.cpp:
1198         (WebCore::RenderLayerBacking::updateGeometry):
1199
1200 2019-06-01  Simon Fraser  <simon.fraser@apple.com>
1201
1202         Non-composited negative z-order children should not trigger creation of a foreground layer
1203         https://bugs.webkit.org/show_bug.cgi?id=198455
1204
1205         Reviewed by Sam Weinig.
1206
1207         The existing code triggered creation of a foreground layer on RenderLayerBacking when
1208         the negative z-order list was non-empty. This isn't necessary; we can paint the negative
1209         z-order children just fine.
1210
1211         We only need a foreground layer when the negative z-order layers are composited or
1212         have composited descendants.
1213
1214         This will reduce backing store memory use in some cases.
1215
1216         Test: compositing/layer-creation/composited-negative-z-subtree.html
1217
1218         * rendering/RenderLayerCompositor.cpp:
1219         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1220         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1221         (WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
1222
1223 2019-06-01  Andy Estes  <aestes@apple.com>
1224
1225         [Apple Pay] Every PaymentCoordinator client should explicitly decide whether they support unrestricted Apple Pay
1226         https://bugs.webkit.org/show_bug.cgi?id=198449
1227         <rdar://problem/51038583>
1228
1229         Reviewed by Wenson Hsieh.
1230
1231         Rather than having a default return value of true for
1232         PaymentCoordinatorClient::supportsUnrestrictedApplePay, make it pure virtual to force each
1233         subclass to implement an override and explicitly choose an appropriate return value.
1234
1235         The only two clients that did not explicitly override were the empty client and
1236         WebKitLegacy's client, and Apple Pay was never enabled in those clients, so there is no
1237         change in behavior.
1238
1239         * Modules/applepay/PaymentCoordinatorClient.h:
1240         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
1241         (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const): Deleted.
1242         * loader/EmptyClients.cpp:
1243
1244 2019-05-31  Youenn Fablet  <youenn@apple.com>
1245
1246         Add an option to mute audio capture automatically when page is not visible
1247         https://bugs.webkit.org/show_bug.cgi?id=198307
1248
1249         Reviewed by Eric Carlson.
1250
1251         Reuse video capture mechanism for audio capture.
1252         In case document gets in the background, interrupt the audio track if the audio factory requires it.
1253         CoreAudioCaptureSourceIOS requires the audio source be interrupted if the app has not the right background mode.
1254         It also allows interrupting the audio capture based on a runtime flag.
1255
1256         Add a runtime flag to control this.
1257         Internals API is used to set it for test purposes, off by default.
1258         For regular cases, the runtime flag is set through web preferences.
1259
1260         Test: platform/ios/mediastream/audio-muted-in-background-tab.html
1261
1262         * dom/Document.cpp:
1263         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged):
1264         * page/RuntimeEnabledFeatures.h:
1265         (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const):
1266         (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled):
1267         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1268         (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter):
1269         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
1270         (WebCore::RealtimeMediaSourceCenter::setCapturePageState):
1271         (WebCore::RealtimeMediaSourceCenter::visibilityDidChange):
1272         * platform/mediastream/RealtimeMediaSourceCenter.h:
1273         (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
1274         * platform/mediastream/RealtimeMediaSourceFactory.h:
1275         (WebCore::AudioCaptureFactory::setAudioCapturePageState):
1276         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
1277         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
1278         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1279         (WebCore::CoreAudioCaptureSourceFactory::setAudioCapturePageState):
1280         (WebCore::CoreAudioCaptureSourceFactoryIOS::shouldInterruptAudioOnPageVisibilityChange):
1281         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1282         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1283         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
1284         * testing/Internals.cpp:
1285         (WebCore::Internals::resetToConsistentState):
1286         (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange):
1287         * testing/Internals.h:
1288         * testing/Internals.idl:
1289
1290 2019-05-31  Geoffrey Garen  <ggaren@apple.com>
1291
1292         Some WeakPtr typedef cleanup
1293         https://bugs.webkit.org/show_bug.cgi?id=198431
1294
1295         Reviewed by Chris Dumez.
1296
1297         Use "using" instead of "typedef", since using is preferred in C++ for
1298         better compatibility with templates.
1299
1300         * Modules/indexeddb/shared/InProcessIDBServer.h:
1301         * html/HTMLMediaElement.h:
1302         * platform/ScrollView.h:
1303
1304 2019-05-31  Andres Gonzalez  <andresg_22@apple.com>
1305
1306         Inserting a newline in contenteditable causes two characters to be added instead of one
1307         https://bugs.webkit.org/show_bug.cgi?id=197894
1308         <rdar://problems/49700998>
1309
1310         Reviewed by Chris Fleizach.
1311
1312         No new test is necessary since this is a comment change.
1313
1314         Removed radar reference from code.
1315
1316         * editing/Editing.cpp:
1317         (WebCore::visiblePositionForIndexUsingCharacterIterator):
1318
1319 2019-05-31  Tim Horton  <timothy_horton@apple.com>
1320
1321         Optionally respect device management restrictions when loading from the network
1322         https://bugs.webkit.org/show_bug.cgi?id=198318
1323         <rdar://problem/44263806>
1324
1325         Reviewed by Alex Christensen.
1326
1327         * en.lproj/Localizable.strings:
1328
1329 2019-05-31  Simon Fraser  <simon.fraser@apple.com>
1330
1331         Move code that sets compositing paint phases into a single function
1332         https://bugs.webkit.org/show_bug.cgi?id=198420
1333
1334         Reviewed by Zalan Bujtas.
1335
1336         To compute the correct paint phases for the various GraphicsLayers in a RenderLayerBacking,
1337         we have to know which set of layers we've created (m_scrollContainerLayer, m_foregroundLayer etc).
1338         So move the code that sets phases into a single function which is called when that
1339         set of layers changes.
1340
1341         The test dumps paint phases for a stacking-context-composited scroller with a negative z-index child.
1342
1343         Also have GraphicsLayer::setPaintingPhase() trigger the necessary repaint when the paint phase changes.
1344
1345         Test: compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases.html
1346
1347         * platform/graphics/GraphicsLayer.cpp:
1348         (WebCore::GraphicsLayer::setPaintingPhase):
1349         * platform/graphics/GraphicsLayer.h:
1350         (WebCore::GraphicsLayer::setPaintingPhase): Deleted.
1351         * rendering/RenderLayerBacking.cpp:
1352         (WebCore::RenderLayerBacking::updateConfiguration):
1353         (WebCore::RenderLayerBacking::updateForegroundLayer):
1354         (WebCore::RenderLayerBacking::updateBackgroundLayer):
1355         (WebCore::RenderLayerBacking::updateMaskingLayer):
1356         (WebCore::RenderLayerBacking::updateScrollingLayers):
1357         (WebCore::RenderLayerBacking::updatePaintingPhases):
1358         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const): Deleted.
1359         * rendering/RenderLayerBacking.h:
1360
1361 2019-05-31  Saam Barati  <sbarati@apple.com>
1362
1363         [WHLSL] Make sure we properly emit code for "&*x"
1364         https://bugs.webkit.org/show_bug.cgi?id=198198
1365
1366         Reviewed by Myles C. Maxfield.
1367
1368         I ran into this when trying to test zero-filling code, so let's just fix it.
1369         The issue is that the property resolver ends up emitting code that looks like
1370         "&*x". The semantics of this are such that it should result in just x.
1371         However, we emitted Metal code in such a way where we'd end up with a pointer
1372         to a temporary value. To fix this, DereferenceExpression will emit code that results
1373         in a reference type. Then, MakePointerExpression will correctly return the
1374         pointer backing that reference type.
1375         
1376         Because of this, we also no longer need to pattern match the lhs of assignment
1377         expressions since we will now be assigning to a reference type.
1378
1379         Test: webgpu/whlsl-store-to-property-updates-properly.html
1380
1381         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1382         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1383
1384 2019-05-31  Simon Fraser  <simon.fraser@apple.com>
1385
1386         [Async overflow scrolling] Flashes of missing layer backing store when scrolling an overflow
1387         https://bugs.webkit.org/show_bug.cgi?id=198363
1388
1389         Reviewed by Tim Horton.
1390
1391         When the contents of an overflow:scroll did not use a tiled backing layer, GraphicsLayerCA::adjustCoverageRect()
1392         would do no coverage rect expansion for scrolling, which meant that backing store attachment for
1393         descendant layers would just use the visible rect from their scrolling ancestor which made it easy
1394         to scroll into view a layer whose backing store was not yet attached.
1395         
1396         Since this only affects non-tiled layers, re-use the generic TileController::adjustTileCoverageRect()
1397         code by moving it down to GraphicsLayer, and call it for a scrolled contents layer which does not
1398         have tiled backing.
1399         
1400         Tested by fast/scrolling/ios/reconcile-layer-position-recursive.html
1401
1402         * platform/graphics/GraphicsLayer.cpp:
1403         (WebCore::GraphicsLayer::adjustCoverageRectForMovement):
1404         * platform/graphics/GraphicsLayer.h:
1405         * platform/graphics/ca/GraphicsLayerCA.cpp:
1406         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
1407         * platform/graphics/ca/TileController.cpp:
1408         (WebCore::TileController::adjustTileCoverageRect):
1409
1410 2019-05-31  Geoffrey Garen  <ggaren@apple.com>
1411
1412         Some WeakPtr cleanup
1413         https://bugs.webkit.org/show_bug.cgi?id=198390
1414
1415         Reviewed by Chris Dumez.
1416
1417         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1418         (WebCore::storageQuotaManagerGetter): Dereference the weak pointer
1419         directly instead of using a weak pointer to guard a raw pointer. It's
1420         safer and more idiomatic to use weak pointers directly.
1421
1422         * Modules/indexeddb/shared/InProcessIDBServer.h: Use our base clase
1423         weakPtrFactory() definition instead of writing our own. Declare
1424         WeakValueType so we can dereference the weak pointer we create (above).
1425
1426 2019-05-31  Zalan Bujtas  <zalan@apple.com>
1427
1428         [LFC][IFC] InlineFormattingContext::LineLayout::processInlineItemsForLine should create and destroy Line.
1429         https://bugs.webkit.org/show_bug.cgi?id=198419
1430         <rdar://problem/51300837>
1431
1432         Reviewed by Antti Koivisto.
1433
1434         This is in preparation for using "createInlineRunsForLine" logic when computing preferred width.
1435         1. Line object is now constructed and destroyed in processInlineItemsForLine (caller does not need to know about Line).
1436         2. processInlineItemsForLine returns a Line::Content instance.
1437
1438         * layout/inlineformatting/InlineFormattingContext.h:
1439         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1440         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
1441         (WebCore::Layout::constructLine):
1442         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineItemsForLine const):
1443         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
1444         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
1445         (WebCore::Layout::InlineFormattingContext::LineLayout::createLine const): Deleted.
1446         (WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const): Deleted.
1447         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const): Deleted.
1448
1449 2019-05-31  Don Olmstead  <don.olmstead@sony.com>
1450
1451         [CMake] Add WebKit::WTF target
1452         https://bugs.webkit.org/show_bug.cgi?id=198400
1453
1454         Reviewed by Konstantin Tokarev.
1455
1456         Use the WebKit::WTF target.
1457
1458         * PlatformWin.cmake:
1459
1460 2019-05-31  Joonghun Park  <jh718.park@samsung.com>
1461
1462         Always min-width should win over max-width.
1463         https://bugs.webkit.org/show_bug.cgi?id=198032
1464
1465         Reviewed by Darin Adler.
1466
1467         In the spec, https://www.w3.org/TR/CSS21/visudet.html#min-max-widths,
1468         the following algorithm describes how the two properties influence
1469         the used value of the 'width' property.
1470
1471         1. The tentative used width is calculated (without 'min-width' and 'max-width')
1472         following the rules under "Calculating widths and margins" above.
1473         2. If the tentative used width is greater than 'max-width',
1474         the rules above are applied again, but this time using the computed value of 'max-width'
1475         as the computed value for 'width'.
1476         3. If the resulting width is smaller than 'min-width', the rules above are applied again,
1477         but this time using the value of 'min-width' as the computed value for 'width'.
1478
1479         * rendering/RenderBlock.cpp:
1480         (WebCore::RenderBlock::computePreferredLogicalWidths):
1481
1482 2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>
1483
1484         Unreviewed, rolling out r245946.
1485
1486         Breaks the watchOS build.
1487
1488         Reverted changeset:
1489
1490         "Add an option to mute audio capture automatically when page
1491         is not visible"
1492         https://bugs.webkit.org/show_bug.cgi?id=198307
1493         https://trac.webkit.org/changeset/245946
1494
1495 2019-05-31  Zalan Bujtas  <zalan@apple.com>
1496
1497         [LFC[IFC] Do not reuse the same Line object.
1498         https://bugs.webkit.org/show_bug.cgi?id=198366
1499         <rdar://problem/51250279>
1500
1501         Reviewed by Antti Koivisto.
1502
1503         This is in preparation for constructing Line inside createInlineRunsForLine and return Line::Content. 
1504
1505         * layout/inlineformatting/InlineFormattingContext.h:
1506         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1507         (WebCore::Layout::InlineFormattingContext::LineLayout::createLine const):
1508         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
1509         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
1510         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const): Deleted.
1511         * layout/inlineformatting/InlineLine.cpp:
1512         (WebCore::Layout::Line::Line):
1513         (WebCore::Layout::m_lineLogicalWidth):
1514         (WebCore::Layout::Line::close):
1515         (WebCore::Layout::Line::moveLogicalLeft):
1516         (WebCore::Layout::Line::appendNonBreakableSpace):
1517         (WebCore::Layout::Line::appendTextContent):
1518         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1519         (WebCore::Layout::Line::appendHardLineBreak):
1520         (WebCore::Layout::Line::reset): Deleted.
1521         * layout/inlineformatting/InlineLine.h:
1522         (WebCore::Layout::Line::hasContent const):
1523
1524 2019-05-31  Zalan Bujtas  <zalan@apple.com>
1525
1526         [LFC][IFC] Move final runs to a dedicated class (Line::Content)
1527         https://bugs.webkit.org/show_bug.cgi?id=198360
1528         <rdar://problem/51247717>
1529
1530         Reviewed by Antti Koivisto.
1531
1532         It decouples the line and the final line content. So when we process the runs after closing the line,
1533         LineContent should be able to answer all the content and geometry related questions.
1534         This is also in preparation for
1535         transfering the ownership of the line content when calling Line::close(). 
1536
1537         * WebCore.xcodeproj/project.pbxproj:
1538         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1539         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
1540         * layout/inlineformatting/InlineLine.cpp:
1541         (WebCore::Layout::Line::Content::isVisuallyEmpty const):
1542         (WebCore::Layout::Line::Content::Run::Run):
1543         (WebCore::Layout::Line::reset):
1544         (WebCore::Layout::Line::close):
1545         (WebCore::Layout::Line::moveLogicalLeft):
1546         (WebCore::Layout::Line::appendNonBreakableSpace):
1547         (WebCore::Layout::Line::appendTextContent):
1548         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1549         (WebCore::Layout::Line::appendHardLineBreak):
1550         (WebCore::Layout::Line::LineItem::LineItem): Deleted.
1551         (WebCore::Layout::Line::hasContent const): Deleted.
1552         * layout/inlineformatting/InlineLine.h:
1553         (WebCore::Layout::Line::Content::runs const):
1554         (WebCore::Layout::Line::Content::isEmpty const):
1555         (WebCore::Layout::Line::Content::logicalTop const):
1556         (WebCore::Layout::Line::Content::logicalLeft const):
1557         (WebCore::Layout::Line::Content::logicalRight const):
1558         (WebCore::Layout::Line::Content::logicalBottom const):
1559         (WebCore::Layout::Line::Content::logicalWidth const):
1560         (WebCore::Layout::Line::Content::logicalHeight const):
1561         (WebCore::Layout::Line::Content::setLogicalRect):
1562         (WebCore::Layout::Line::Content::runs):
1563         (WebCore::Layout::Line::hasContent const):
1564         (WebCore::Layout::Line::availableWidth const):
1565         (WebCore::Layout::Line::contentLogicalRight const):
1566         (WebCore::Layout::Line::logicalTop const):
1567         (WebCore::Layout::Line::logicalBottom const):
1568         (WebCore::Layout::Line::logicalLeft const):
1569         (WebCore::Layout::Line::logicalRight const):
1570         (WebCore::Layout::Line::logicalWidth const):
1571         (WebCore::Layout::Line::logicalHeight const):
1572         (WebCore::Layout::Line::contentLogicalWidth const):
1573         * page/FrameViewLayoutContext.cpp:
1574         (WebCore::layoutUsingFormattingContext):
1575
1576 2019-05-31  Joonghun Park  <jh718.park@samsung.com>
1577
1578         Unreviewed. Fix typo of |ComputedStyleExtractor::valueForPropertyInStyle|
1579         to follow camel case function naming style.
1580
1581         No behavioral changes.
1582
1583         * animation/KeyframeEffect.cpp:
1584         (WebCore::KeyframeEffect::getKeyframes):
1585         * css/CSSComputedStyleDeclaration.cpp:
1586         (WebCore::ComputedStyleExtractor::propertyValue):
1587         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
1588         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): Deleted.
1589         * css/CSSComputedStyleDeclaration.h:
1590         * rendering/style/RenderStyle.cpp:
1591         (WebCore::changedCustomPaintWatchedProperty):
1592
1593 2019-05-31  Ali Juma  <ajuma@chromium.org>
1594
1595         REGRESSION (r245396): Page load time performance regression
1596         https://bugs.webkit.org/show_bug.cgi?id=198382
1597
1598         Reviewed by Simon Fraser.
1599
1600         Delay the scheduling of a rendering update by 500ms when a new
1601         IntersectionObserver target is added during page load. This addresses
1602         a page load time regression from r245396, which immediately scheduled a
1603         rendering update when a target is added. Note that even with this change,
1604         if anything else triggers a rendering update before the 500ms delay expires,
1605         intersection observations will be updated during that rendering update.
1606
1607         Covered by intersection-observer/initial-observation.html 
1608
1609         * dom/Document.cpp:
1610         (WebCore::Document::updateIntersectionObservations):
1611         (WebCore::Document::scheduleInitialIntersectionObservationUpdate):
1612         * dom/Document.h:
1613         * page/IntersectionObserver.cpp:
1614         (WebCore::IntersectionObserver::observe):
1615
1616 2019-05-30  Zan Dobersek  <zdobersek@igalia.com>
1617
1618         Unreviewed. Suppress -Wunused-variable warnings for the unused static
1619         mousePointerID variable by making it a constexpr.
1620
1621         * platform/PointerID.h:
1622
1623 2019-05-30  Simon Fraser  <simon.fraser@apple.com>
1624
1625         Use an OptionSet<> for GraphicsLayerPaintingPhase
1626         https://bugs.webkit.org/show_bug.cgi?id=198404
1627
1628         Reviewed by Tim Horton.
1629
1630         Replace GraphicsLayerPaintingPhase with OptionSet<GraphicsLayerPaintingPhase>.
1631
1632         No behavior change.
1633
1634         * page/PageOverlayController.cpp:
1635         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
1636         (WebCore::PageOverlayController::paintContents):
1637         (WebCore::PageOverlayController::notifyFlushRequired):
1638         * page/PageOverlayController.h:
1639         * page/linux/ResourceUsageOverlayLinux.cpp:
1640         * page/mac/ServicesOverlayController.h:
1641         * page/mac/ServicesOverlayController.mm:
1642         (WebCore::ServicesOverlayController::Highlight::paintContents):
1643         * platform/graphics/GraphicsLayer.cpp:
1644         (WebCore::GraphicsLayer::dumpProperties const):
1645         * platform/graphics/GraphicsLayer.h:
1646         (WebCore::GraphicsLayer::paintingPhase const):
1647         (WebCore::GraphicsLayer::setPaintingPhase):
1648         * platform/graphics/GraphicsLayerClient.h:
1649         (WebCore::GraphicsLayerClient::paintContents):
1650         * rendering/RenderLayerBacking.cpp:
1651         (WebCore::RenderLayerBacking::updateForegroundLayer):
1652         (WebCore::RenderLayerBacking::updateBackgroundLayer):
1653         (WebCore::RenderLayerBacking::updateMaskingLayer):
1654         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1655         (WebCore::RenderLayerBacking::updateScrollingLayers):
1656         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
1657         (WebCore::RenderLayerBacking::paintIntoLayer):
1658         (WebCore::RenderLayerBacking::paintContents):
1659         * rendering/RenderLayerBacking.h:
1660         * rendering/RenderLayerCompositor.cpp:
1661         (WebCore::RenderLayerCompositor::paintContents):
1662         * rendering/RenderLayerCompositor.h:
1663
1664 2019-05-30  Youenn Fablet  <youenn@apple.com>
1665
1666         Fix AVVideoCaptureSource::setFrameRateWithPreset logging
1667         https://bugs.webkit.org/show_bug.cgi?id=198392
1668
1669         Reviewed by Eric Carlson.
1670
1671         Move logging from setFrameRateWithPreset to setSessionSizeAndFrameRate which does the actual job.
1672         This ensures to not log in case of preset being null.
1673         No change of behavior.
1674
1675         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1676         (WebCore::AVVideoCaptureSource::setFrameRateWithPreset):
1677         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
1678
1679 2019-05-30  Jer Noble  <jer.noble@apple.com>
1680
1681         Video playback in Safari should continue when CarPlay is plugged in
1682         https://bugs.webkit.org/show_bug.cgi?id=198345
1683         <rdar://problem/45505750>
1684
1685         Reviewed by Eric Carlson.
1686
1687         Test: media/video-isplayingtoautomotiveheadunit.html
1688
1689         * html/HTMLMediaElement.cpp:
1690         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
1691         * platform/audio/PlatformMediaSessionManager.cpp:
1692         (WebCore::PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit):
1693         * platform/audio/PlatformMediaSessionManager.h:
1694         (WebCore::PlatformMediaSessionManager::isPlayingToAutomotiveHeadUnit const):
1695         * platform/audio/ios/MediaSessionManagerIOS.h:
1696         * platform/audio/ios/MediaSessionManagerIOS.mm:
1697         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
1698         (WebCore::MediaSessionManageriOS::carPlayServerDied):
1699         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected):
1700         (-[WebMediaSessionHelper initWithCallback:]):
1701         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1702         (-[WebMediaSessionHelper interruption:]):
1703         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
1704         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1705         (-[WebMediaSessionHelper applicationWillResignActive:]):
1706         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
1707         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
1708         (-[WebMediaSessionHelper carPlayServerDied:]):
1709         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]):
1710         * testing/Internals.cpp:
1711         (WebCore::Internals::resetToConsistentState):
1712         (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit):
1713         * testing/Internals.h:
1714         * testing/Internals.idl:
1715
1716 2019-05-30  Youenn Fablet  <youenn@apple.com>
1717
1718         Add an option to mute audio capture automatically when page is not visible
1719         https://bugs.webkit.org/show_bug.cgi?id=198307
1720
1721         Reviewed by Eric Carlson.
1722
1723         Reuse video capture mechanism for audio capture.
1724         In case document gets in the background, interrupt the audio track if the audio factory requires it.
1725         CoreAudioCaptureSourceIOS requires the audio source be interrupted if the app has not the right background mode.
1726         It also allows interrupting the audio capture based on a runtime flag.
1727
1728         Add a runtime flag to control this.
1729         Internals API is used to set it for test purposes, off by default.
1730         For regular cases, the runtime flag is set through web preferences.
1731
1732         Test: platform/ios/mediastream/audio-muted-in-background-tab.html
1733
1734         * dom/Document.cpp:
1735         (WebCore::Document::notifyMediaCaptureOfVisibilityChanged):
1736         * page/RuntimeEnabledFeatures.h:
1737         (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const):
1738         (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled):
1739         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1740         (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter):
1741         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
1742         (WebCore::RealtimeMediaSourceCenter::setCapturePageState):
1743         (WebCore::RealtimeMediaSourceCenter::visibilityDidChange):
1744         * platform/mediastream/RealtimeMediaSourceCenter.h:
1745         (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
1746         * platform/mediastream/RealtimeMediaSourceFactory.h:
1747         (WebCore::AudioCaptureFactory::setAudioCapturePageState):
1748         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
1749         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
1750         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1751         (WebCore::CoreAudioCaptureSourceFactory::setAudioCapturePageState):
1752         (WebCore::CoreAudioCaptureSourceFactoryIOS::shouldInterruptAudioOnPageVisibilityChange):
1753         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1754         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1755         (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange):
1756         * testing/Internals.cpp:
1757         (WebCore::Internals::resetToConsistentState):
1758         (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange):
1759         * testing/Internals.h:
1760         * testing/Internals.idl:
1761
1762 2019-05-30  Saam Barati  <sbarati@apple.com>
1763
1764         [WHLSL] Enforce variable lifetimes
1765         https://bugs.webkit.org/show_bug.cgi?id=195794
1766         <rdar://problem/50746293>
1767
1768         Reviewed by Myles C. Maxfield.
1769
1770         In WHLSL, each variable has global lifetime. So returning a pointer to a
1771         local variable is a legitimate and well specified thing to do. Each local
1772         variable has a unique place in memory. So, for example:
1773         
1774         ```
1775         thread int* ptr() { int local; return &local; }
1776         thread int* ptrPtr() { return ptr(); }
1777         ```
1778         
1779         In the above program, ptr() must always return the same value
1780         as ptrPtr(). So, the following would print "42":
1781         ```
1782         thread int* p = ptrPtr();
1783         *ptr() = 42;
1784         print(*p);
1785         ```
1786         
1787         To implement these semantics, this patch introduces a new pass which does the
1788         following transformations:
1789         - It notes every variable whose address is taken in the program.
1790         - Each such variable gets defined as a field in a struct.
1791         - Each function which is an entry point defines this struct.
1792         - Each non entry point takes a pointer to this struct as its final parameter.
1793         - Each call to a non-native function is rewritten to pass a pointer to the
1794           struct as the last call argument.
1795         - Each variable reference to "x", where "x" ends up in the struct, is
1796           modified to instead be "struct->x". We store to "struct->x" after declaring
1797           "x". If "x" is a function parameter, we store to "struct->x" as the first
1798           thing we do in the function body.
1799
1800         Tests: webgpu/whlsl-ensure-proper-variable-lifetime-2.html
1801                webgpu/whlsl-ensure-proper-variable-lifetime-3.html
1802                webgpu/whlsl-ensure-proper-variable-lifetime.html
1803                webgpu/whlsl-return-local-variable.html
1804
1805         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
1806         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1807         (WebCore::WHLSL::AST::Expression::Expression):
1808         (WebCore::WHLSL::AST::Expression::isGlobalVariableReference const):
1809         (WebCore::WHLSL::AST::Expression::origin const): Deleted.
1810         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
1811         (WebCore::WHLSL::AST::FunctionDeclaration::origin):
1812         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h: Added.
1813         (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
1814         (WebCore::WHLSL::AST::GlobalVariableReference::structField):
1815         (WebCore::WHLSL::AST::GlobalVariableReference::base):
1816         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1817         (WebCore::WHLSL::AST::Statement::Statement):
1818         (WebCore::WHLSL::AST::Statement::isStatementList const):
1819         (WebCore::WHLSL::AST::Statement::isWhileLoop const):
1820         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h: Added.
1821         (WebCore::WHLSL::AST::StatementList::StatementList):
1822         (WebCore::WHLSL::AST::StatementList::statements):
1823         * Modules/webgpu/WHLSL/AST/WHLSLValue.h:
1824         (WebCore::WHLSL::AST::Value::Value):
1825         (WebCore::WHLSL::AST::Value::origin const):
1826         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
1827         (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
1828         (WebCore::WHLSL::AST::VariableDeclaration::takeInitializer):
1829         (WebCore::WHLSL::AST::VariableDeclaration::origin const): Deleted.
1830         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
1831         (WebCore::WHLSL::AST::VariableReference::wrap):
1832         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1833         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1834         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1835         (WebCore::WHLSL::ASTDumper::visit):
1836         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1837         (WebCore::WHLSL::dumpASTNode):
1838         (WebCore::WHLSL::dumpAST):
1839         (WebCore::WHLSL::toString): Deleted.
1840         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1841         (WebCore::WHLSL::prepareShared):
1842         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp: Added.
1843         (WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables):
1844         (WebCore::WHLSL::anonymousToken):
1845         (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
1846         (WebCore::WHLSL::PreserveLifetimes::makeStructVariableReference):
1847         (WebCore::WHLSL::preserveVariableLifetimes):
1848         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h: Added.
1849         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1850         (WebCore::WHLSL::Visitor::visit):
1851         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1852         * Sources.txt:
1853         * WebCore.xcodeproj/project.pbxproj:
1854
1855 2019-05-30  Ryan Haddad  <ryanhaddad@apple.com>
1856
1857         Unreviewed, rolling out r245890, 245887.
1858
1859         Breaks internal builds.
1860
1861         Reverted changeset:
1862         "Video playback in Safari should continue when CarPlay is plugged in"
1863         https://bugs.webkit.org/show_bug.cgi?id=198345
1864         https://trac.webkit.org/changeset/245887/webkit
1865
1866 2019-05-30  Dean Jackson  <dino@apple.com>
1867
1868         Media documents on iPad are too wide in split screen
1869         https://bugs.webkit.org/show_bug.cgi?id=198405
1870         <rdar://problem/50974548>
1871
1872         Reviewed by Tim Horton.
1873
1874         Media documents on iPad had a minimum width of 700px. This
1875         was fine in full-screen, but didn't work when then window
1876         was smaller, such as split screen or a link preview.
1877
1878         Tests: media/modern-media-controls/media-documents/media-document-video-ipad-sizing.html
1879                media/modern-media-controls/media-documents/media-document-video-iphone-sizing.html
1880
1881         * Modules/modern-media-controls/controls/media-document.css: Add a media query to
1882         detect small windows.
1883         * Modules/modern-media-controls/media/media-document-controller.js:
1884
1885 2019-05-30  Andres Gonzalez  <andresg_22@apple.com>
1886
1887         Inserting a newline in contenteditable causes two characters to be added instead of one
1888         https://bugs.webkit.org/show_bug.cgi?id=197894
1889         <rdar://problem/49700998>
1890
1891         Reviewed by Wenson Hsieh and Chris Fleizach.
1892
1893         There were two issues with inserting a newline character at the end of 
1894         a line that caused problems for accessibility:
1895         - the first '\n' inserted after text would result in two line breaks 
1896         inserted instead of one. createFragmentFromText in markup.cpp was 
1897         splitting the string "\n" into two empty strings and creating a <div> 
1898         and a <br> respectively. Then the emission code would emit a '\n' for 
1899         the empty div and another for the <br>.
1900         - the second problem is a consequence of <rdar://problem/5192593> and 
1901         the workaround is the change in editing.cpp in the function
1902         visiblePositionForIndexUsingCharacterIterator, similar to what is done
1903         in VisibleUnits.cpp for nextBoundary.
1904         The rest of the changes in this patch are accessibility changes to 
1905         execute the layout tests.
1906
1907         Tests: accessibility/ios-simulator/set-selected-text-range-after-newline.html
1908                accessibility/set-selected-text-range-after-newline.html
1909
1910         * accessibility/AccessibilityRenderObject.cpp:
1911         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1912         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1913         (-[WebAccessibilityObjectWrapper stringForRange:]):
1914         (-[WebAccessibilityObjectWrapper _accessibilitySelectedTextRange]):
1915         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
1916         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1917         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1918         * editing/Editing.cpp:
1919         (WebCore::visiblePositionForIndexUsingCharacterIterator):
1920         * editing/markup.cpp:
1921         (WebCore::createFragmentFromText):
1922
1923 2019-05-30  Justin Fan  <justin_fan@apple.com>
1924
1925         [Web GPU] Vertex Buffers/Input State API updates
1926         https://bugs.webkit.org/show_bug.cgi?id=194258
1927         <rdar://problem/47806127>
1928
1929         Reviewed by Myles C. Maxfield.
1930
1931         The vertex buffer attributes model for GPURenderPipelines in the WebGPU API has been updated.
1932         Update our implementation to match.
1933
1934         No new tests. Existing tests updated to match new behavior.
1935
1936         * CMakeLists.txt:
1937         * DerivedSources-input.xcfilelist:
1938         * DerivedSources-output.xcfilelist:
1939         * DerivedSources.make:
1940         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
1941         * Modules/webgpu/GPUVertexBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/GPUInputStateDescriptor.idl.
1942         * Modules/webgpu/GPUVertexInputDescriptor.idl:
1943         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
1944         * Sources.txt:
1945         * WebCore.xcodeproj/project.pbxproj:
1946         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
1947         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1948         * platform/graphics/gpu/GPUVertexBufferDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUInputStateDescriptor.h.
1949         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1950         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1951         (WebCore::trySetVertexInput): Added. Populate Metal and WHLSL pipeline descriptors with vertex attribute metadata.
1952         (WebCore::trySetColorStates): Added. Populate Metal and WHLSL pipeline descriptors with color attachment metadata.
1953         (WebCore::convertLayout): Moved.
1954         (WebCore::trySetMetalFunctions): Moved.
1955         (WebCore::trySetFunctions): Added. WHLSL compilation to Metal SL happens here, then MSL functions are set on pipeline descriptor.
1956         (WebCore::convertRenderPipelineDescriptor): Repurposed. Convert a GPURenderPipelineDescriptor to Metal and WHLSL versions.
1957         (WebCore::tryCreateMtlRenderPipelineState):
1958         (WebCore::GPURenderPipeline::tryCreate):
1959         (WebCore::trySetMetalFunctionsForPipelineDescriptor): Deleted.
1960         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor): Deleted.
1961         (WebCore::trySetFunctionsForPipelineDescriptor): Deleted.
1962         (WebCore::trySetInputStateForPipelineDescriptor): Deleted.
1963         (WebCore::setColorStatesForColorAttachmentArray): Deleted.
1964
1965 2019-05-30  Zalan Bujtas  <zalan@apple.com>
1966
1967         [iOS] Do not linkify telephone numbers inside <a> elements.
1968         https://bugs.webkit.org/show_bug.cgi?id=198378
1969
1970         Reviewed by Chris Dumez.
1971
1972         Phone number linkifying mutates the DOM in a potentially unexpected way triggering different kinds of failures with JS, CSS selectors etc.
1973         This patch tightens the linkifying rule so that content inside an <a> element won't get linkified even when the <a> has no valid href attribute.
1974
1975         Test: fast/dom/linkify-phone-numbers.html
1976
1977         * html/parser/HTMLTreeBuilder.cpp:
1978         (WebCore::disallowTelephoneNumberParsing):
1979
1980 2019-05-30  Truitt Savell  <tsavell@apple.com>
1981
1982         Unreviewed, rolling out r245883.
1983
1984         Caused 6 webgpu/ layout test failures.
1985
1986         Reverted changeset:
1987
1988         "[WHLSL] Parsing and lexing the standard library is slow"
1989         https://bugs.webkit.org/show_bug.cgi?id=192890
1990         https://trac.webkit.org/changeset/245883
1991
1992 2019-05-30  Simon Fraser  <simon.fraser@apple.com>
1993
1994         Move some HistoricalVelocityData code into the cpp file
1995         https://bugs.webkit.org/show_bug.cgi?id=198353
1996
1997         Reviewed by Tim Horton.
1998         
1999         Now that we have VelocityData.cpp put the non-trivial HistoricalVelocityData::velocityForNewData()
2000         into it. append() can become a lambda function.
2001
2002         * platform/graphics/VelocityData.cpp:
2003         (WebCore::HistoricalVelocityData::velocityForNewData):
2004         * platform/graphics/VelocityData.h:
2005         (WebCore::HistoricalVelocityData::velocityForNewData): Deleted.
2006         (WebCore::HistoricalVelocityData::append): Deleted.
2007
2008 2019-05-30  Truitt Savell  <tsavell@apple.com>
2009
2010         Fix the iOS build after r245887
2011         https://bugs.webkit.org/show_bug.cgi?id=198345
2012
2013         Unreviewed build fix.
2014
2015         * platform/audio/ios/MediaSessionManagerIOS.mm:
2016         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected):
2017
2018 2019-05-30  Jer Noble  <jer.noble@apple.com>
2019
2020         ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange()
2021         https://bugs.webkit.org/show_bug.cgi?id=181597
2022         <rdar://problem/36474088>
2023
2024         Reviewed by Eric Carlson.
2025
2026         Because document() is usually null-checked before using (and we can add null-checks where missing),
2027         there's no good reason to debug-assert that m_scriptExecutionContext is non-null before downcast<>ing
2028         to Document*.
2029
2030         * Modules/webaudio/AudioContext.cpp:
2031         (WebCore::AudioContext::constructCommon):
2032         (WebCore::AudioContext::stop):
2033         (WebCore::AudioContext::document const):
2034         (WebCore::AudioContext::visibilityStateChanged):
2035         (WebCore::AudioContext::willBeginPlayback):
2036         (WebCore::AudioContext::willPausePlayback):
2037         (WebCore::AudioContext::pageMutedStateDidChange):
2038
2039 2019-05-30  Jer Noble  <jer.noble@apple.com>
2040
2041         Video playback in Safari should continue when CarPlay is plugged in
2042         https://bugs.webkit.org/show_bug.cgi?id=198345
2043         <rdar://problem/45505750>
2044
2045         Reviewed by Eric Carlson.
2046
2047         Test: media/video-isplayingtoautomotiveheadunit.html
2048
2049         * html/HTMLMediaElement.cpp:
2050         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
2051         * platform/audio/PlatformMediaSessionManager.cpp:
2052         (WebCore::PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit):
2053         * platform/audio/PlatformMediaSessionManager.h:
2054         (WebCore::PlatformMediaSessionManager::isPlayingToAutomotiveHeadUnit const):
2055         * platform/audio/ios/MediaSessionManagerIOS.h:
2056         * platform/audio/ios/MediaSessionManagerIOS.mm:
2057         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
2058         (WebCore::MediaSessionManageriOS::carPlayServerDied):
2059         (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected):
2060         (-[WebMediaSessionHelper initWithCallback:]):
2061         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
2062         (-[WebMediaSessionHelper interruption:]):
2063         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
2064         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
2065         (-[WebMediaSessionHelper applicationWillResignActive:]):
2066         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
2067         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
2068         (-[WebMediaSessionHelper carPlayServerDied:]):
2069         (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]):
2070         * testing/Internals.cpp:
2071         (WebCore::Internals::resetToConsistentState):
2072         (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit):
2073         * testing/Internals.h:
2074         * testing/Internals.idl:
2075
2076 2019-05-29  Robin Morisset  <rmorisset@apple.com>
2077
2078         [WHLSL] Parsing and lexing the standard library is slow
2079         https://bugs.webkit.org/show_bug.cgi?id=192890
2080         <rdar://problem/50746335>
2081
2082         Reviewed by Myles Maxfield.
2083
2084         The main idea is to avoid backtracking by instead peeking at the next token (and occasionally at the one after that).
2085         This implies a few things:
2086         - 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).
2087         - We now have "completeFooExpression" functions, to avoid having to reparse the prefix of some expression, if we find half-way through what it is.
2088
2089         I also fixed the following parser bug:
2090         - https://bugs.webkit.org/show_bug.cgi?id=198305 [WHLSL] Multiple variables with initializers in a declaration statement crashes the compiler
2091             which was due to a mistake I made in the grammar
2092
2093         Finally I added two new macros: CONSUME_TYPE and PARSE to eliminate about 500 lines of error propagation boilerplate.
2094
2095         There are still lots of ways of improving the parser and lexer, such as:
2096         - finishing the conversion of tokens in the lexer, not bothering with allocating string views
2097         - make two special tokens Invalid and EOF, to remove the overhead of Optional
2098         - make peekTypes and consumeTypes use templates to avoid constructing a Vector and calling find on it.
2099         - 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)
2100         - Remove the last few pieces of backtracking from the parser.
2101
2102         The current patch is already enough to make parsing the full standard library (something like 85k lines) approximately 260ms.
2103         This is still longer than I would like, but nowhere near the bottleneck any longer because of some other parts of the compiler.
2104
2105         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2106         (WebCore::WHLSL::Lexer::Lexer):
2107         (WebCore::WHLSL::Lexer::consumeToken):
2108         (WebCore::WHLSL::Lexer::peek):
2109         (WebCore::WHLSL::Lexer::peekFurther):
2110         (WebCore::WHLSL::Lexer::state const):
2111         (WebCore::WHLSL::Lexer::setState):
2112         (WebCore::WHLSL::Lexer::unconsumeToken): Deleted.
2113         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2114         (WebCore::WHLSL::Parser::parse):
2115         (WebCore::WHLSL::Parser::peek):
2116         (WebCore::WHLSL::Parser::peekTypes):
2117         (WebCore::WHLSL::Parser::tryType):
2118         (WebCore::WHLSL::Parser::tryTypes):
2119         (WebCore::WHLSL::Parser::consumeTypes):
2120         (WebCore::WHLSL::Parser::parseConstantExpression):
2121         (WebCore::WHLSL::Parser::parseTypeArgument):
2122         (WebCore::WHLSL::Parser::parseTypeArguments):
2123         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
2124         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
2125         (WebCore::WHLSL::Parser::parseType):
2126         (WebCore::WHLSL::Parser::parseTypeDefinition):
2127         (WebCore::WHLSL::Parser::parseResourceSemantic):
2128         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
2129         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
2130         (WebCore::WHLSL::Parser::parseSemantic):
2131         (WebCore::WHLSL::Parser::parseQualifiers):
2132         (WebCore::WHLSL::Parser::parseStructureElement):
2133         (WebCore::WHLSL::Parser::parseStructureDefinition):
2134         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2135         (WebCore::WHLSL::Parser::parseEnumerationMember):
2136         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
2137         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
2138         (WebCore::WHLSL::Parser::parseAttributeBlock):
2139         (WebCore::WHLSL::Parser::parseParameter):
2140         (WebCore::WHLSL::Parser::parseParameters):
2141         (WebCore::WHLSL::Parser::parseFunctionDefinition):
2142         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
2143         (WebCore::WHLSL::Parser::parseVertexFragmentFunctionDeclaration):
2144         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
2145         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
2146         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
2147         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
2148         (WebCore::WHLSL::Parser::parseBlock):
2149         (WebCore::WHLSL::Parser::parseBlockBody):
2150         (WebCore::WHLSL::Parser::parseIfStatement):
2151         (WebCore::WHLSL::Parser::parseSwitchStatement):
2152         (WebCore::WHLSL::Parser::parseSwitchCase):
2153         (WebCore::WHLSL::Parser::parseForLoop):
2154         (WebCore::WHLSL::Parser::parseWhileLoop):
2155         (WebCore::WHLSL::Parser::parseDoWhileLoop):
2156         (WebCore::WHLSL::Parser::parseVariableDeclaration):
2157         (WebCore::WHLSL::Parser::parseVariableDeclarations):
2158         (WebCore::WHLSL::Parser::parseStatement):
2159         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2160         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2161         (WebCore::WHLSL::Parser::parseExpression):
2162         (WebCore::WHLSL::Parser::parseTernaryConditional):
2163         (WebCore::WHLSL::Parser::completeTernaryConditional):
2164         (WebCore::WHLSL::Parser::parseAssignment):
2165         (WebCore::WHLSL::Parser::completeAssignment):
2166         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
2167         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
2168         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
2169         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
2170         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
2171         (WebCore::WHLSL::Parser::parsePossibleShift):
2172         (WebCore::WHLSL::Parser::completePossibleShift):
2173         (WebCore::WHLSL::Parser::parsePossibleAdd):
2174         (WebCore::WHLSL::Parser::completePossibleAdd):
2175         (WebCore::WHLSL::Parser::parsePossibleMultiply):
2176         (WebCore::WHLSL::Parser::completePossibleMultiply):
2177         (WebCore::WHLSL::Parser::parsePossiblePrefix):
2178         (WebCore::WHLSL::Parser::parsePossibleSuffix):
2179         (WebCore::WHLSL::Parser::parseCallExpression):
2180         (WebCore::WHLSL::Parser::parseTerm):
2181         (WebCore::WHLSL::Parser::parseAddressSpaceType): Deleted.
2182         (WebCore::WHLSL::Parser::parseNonAddressSpaceType): Deleted.
2183         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration): Deleted.
2184         (WebCore::WHLSL::Parser::parseEffectfulPrefix): Deleted.
2185         (WebCore::WHLSL::Parser::parseEffectfulSuffix): Deleted.
2186         * Modules/webgpu/WHLSL/WHLSLParser.h:
2187         (WebCore::WHLSL::Parser::Error::dump const):
2188
2189 2019-05-29  Jiewen Tan  <jiewen_tan@apple.com>
2190
2191         Unreviewed, update WebAuthN to "Supported In Preview"
2192
2193         * features.json:
2194
2195 2019-05-29  Don Olmstead  <don.olmstead@sony.com>
2196
2197         Remove ENABLE definitions from WebKit config files
2198         https://bugs.webkit.org/show_bug.cgi?id=197858
2199
2200         Reviewed by Simon Fraser.
2201
2202         Sync FeatureDefines.xcconfig.
2203
2204         * Configurations/FeatureDefines.xcconfig:
2205
2206 2019-05-29  Youenn Fablet  <youenn@apple.com>
2207
2208         Reestablish WebSWClientConnection in case of network process crash
2209         https://bugs.webkit.org/show_bug.cgi?id=198333
2210
2211         Reviewed by Alex Christensen.
2212
2213         Refactor DocumentLoader to no longer take a ref to the SWClientConnection.
2214         Instead, store the sessionID and get the SWClientConnection from it.
2215         Remove unused code from ServiceWorkerContainer.
2216
2217         Test: http/wpt/service-workers/service-worker-networkprocess-crash.html
2218
2219         * loader/DocumentLoader.cpp:
2220         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2221         (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
2222         * loader/DocumentLoader.h:
2223         * workers/service/ServiceWorkerContainer.cpp:
2224         * workers/service/ServiceWorkerContainer.h:
2225         * workers/service/ServiceWorkerJobClient.h:
2226
2227 2019-05-29  David Kilzer  <ddkilzer@apple.com>
2228
2229         IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
2230         <https://webkit.org/b/198346>
2231         <rdar://problem/50895658>
2232
2233         Reviewed by Brent Fulgham.
2234
2235         * Modules/indexeddb/server/IDBServer.cpp:
2236         (WebCore::IDBServer::IDBServer::IDBServer):
2237         - Pass AutodrainedPoolForRunLoop::Use when creating
2238           CrossThreadTaskHandler to fix the bug.
2239
2240 2019-05-29  Geoffrey Garen  <ggaren@apple.com>
2241
2242         WeakPtr breaks vtables when upcasting to base classes
2243         https://bugs.webkit.org/show_bug.cgi?id=188799
2244
2245         Reviewed by Youenn Fablet.
2246
2247         * Modules/encryptedmedia/MediaKeySession.cpp:
2248         (WebCore::MediaKeySession::MediaKeySession):
2249         * Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs.
2250         Removed redundant WeakPtrFactory.
2251
2252         * css/CSSFontFace.cpp:
2253         (WebCore::CSSFontFace::existingWrapper):
2254         * css/CSSFontFace.h: Moved functions out of line to avoid #include
2255         explosion for .get().
2256
2257         * dom/ContainerNode.h:
2258         * dom/Document.h:
2259         * dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all
2260         subclasses except for DocumentFragment were already so, and we have
2261         code that uses WeakPtr<ContainerNode>, which, now that WeakPtr is
2262         type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr.
2263
2264         * dom/FullscreenManager.cpp:
2265         (WebCore::FullscreenManager::fullscreenRenderer const):
2266         * dom/FullscreenManager.h:
2267         (WebCore::FullscreenManager::fullscreenRenderer const): Deleted.
2268         * html/FormAssociatedElement.cpp:
2269         (WebCore::FormAssociatedElement::form const):
2270         * html/FormAssociatedElement.h:
2271         (WebCore::FormAssociatedElement::form const): Deleted. Moved functions
2272         out of line to avoid #include explosion for .get().
2273
2274         * html/HTMLMediaElement.h: It takes an extra using declaration
2275         to disambiguate multiple CanMakeWeakPtr base classes now.
2276
2277         * loader/MediaResourceLoader.cpp:
2278         (WebCore::MediaResourceLoader::requestResource): Removed redundant .get().
2279
2280         * page/DOMWindowProperty.cpp:
2281         (WebCore::DOMWindowProperty::window const):
2282         * page/DOMWindowProperty.h:
2283         (WebCore::DOMWindowProperty::window const): Deleted.
2284         * page/FrameViewLayoutContext.cpp:
2285         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const):
2286         * page/FrameViewLayoutContext.h:
2287         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted.
2288         * page/UndoItem.cpp:
2289         (WebCore::UndoItem::undoManager const):
2290         * page/UndoItem.h:
2291         (WebCore::UndoItem::undoManager const): Deleted. Moved functions out of
2292         line to avoid #include explosion for .get().
2293
2294         * platform/ScrollView.h: It takes an extra using declaration
2295         to disambiguate multiple CanMakeWeakPtr base classes now.
2296
2297         * platform/Widget.cpp:
2298         (WebCore::Widget::parent const):
2299         * platform/Widget.h:
2300         (WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include
2301         explosion for .get().
2302
2303         * platform/encryptedmedia/CDMInstanceSession.h: Made
2304         CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr<CDMInstanceSessionClient>.
2305
2306         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2307         CanMakeWeakPtr is inherited now.
2308
2309         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2310         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2311         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2312         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2313         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted.
2314         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted.
2315         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2316         (WebCore::CMTimebaseEffectiveRateChangedCallback):
2317         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2318         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
2319         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
2320         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
2321         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
2322         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const):
2323         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2324         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2325         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2326         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2327         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2328         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
2329         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2330         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
2331         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
2332         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage.
2333
2334         * rendering/RenderBlockFlow.cpp:
2335         (WebCore::RenderBlockFlow::multiColumnFlowSlowCase const):
2336         * rendering/RenderBlockFlow.h:
2337         (WebCore::RenderBlockFlow::multiColumnFlow const):
2338         * rendering/RenderMultiColumnFlow.cpp:
2339         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const):
2340         * rendering/RenderMultiColumnFlow.h:
2341         * rendering/RenderTable.cpp:
2342         (WebCore::RenderTable::header const):
2343         (WebCore::RenderTable::footer const):
2344         (WebCore::RenderTable::firstBody const):
2345         (WebCore::RenderTable::topSection const):
2346         * rendering/RenderTable.h:
2347         (WebCore::RenderTable::header const): Deleted.
2348         (WebCore::RenderTable::footer const): Deleted.
2349         (WebCore::RenderTable::firstBody const): Deleted.
2350         (WebCore::RenderTable::topSection const): Deleted. Moved functions out
2351         of line to avoid #include explosion for .get().
2352
2353 2019-05-29  Antoine Quint  <graouts@apple.com>
2354
2355         [Pointer Events] toElement and fromElement should be null
2356         https://bugs.webkit.org/show_bug.cgi?id=198338
2357
2358         Reviewed by Dean Jackson.
2359
2360         * dom/MouseEvent.h:
2361         * dom/PointerEvent.h:
2362
2363 2019-05-29  Ryan Haddad  <ryanhaddad@apple.com>
2364
2365         Unreviewed, rolling out r245857.
2366
2367         Breaks internal builds.
2368
2369         Reverted changeset:
2370
2371         "WeakPtr breaks vtables when upcasting to base classes"
2372         https://bugs.webkit.org/show_bug.cgi?id=188799
2373         https://trac.webkit.org/changeset/245857
2374
2375 2019-05-29  Keith Rollin  <krollin@apple.com>
2376
2377         Fix builds that don't use makeWindowFromView
2378         https://bugs.webkit.org/show_bug.cgi?id=198342
2379         <rdar://problem/51228563>
2380
2381         Reviewed by Wenson Hsieh.
2382
2383         In some configurations, VideoFullscreenInterfaceAVKit.mm declares but
2384         does not use makeWindowFromView. Fix by conditionalizing the the
2385         declaration on the same symbol as point where it's used.
2386
2387         No new tests -- no new functionality.
2388
2389         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2390
2391 2019-05-28  Geoffrey Garen  <ggaren@apple.com>
2392
2393         WeakPtr breaks vtables when upcasting to base classes
2394         https://bugs.webkit.org/show_bug.cgi?id=188799
2395
2396         Reviewed by Youenn Fablet.
2397
2398         * Modules/encryptedmedia/MediaKeySession.cpp:
2399         (WebCore::MediaKeySession::MediaKeySession):
2400         * Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs.
2401         Removed redundant WeakPtrFactory.
2402
2403         * css/CSSFontFace.cpp:
2404         (WebCore::CSSFontFace::existingWrapper):
2405         * css/CSSFontFace.h: Moved functions out of line to avoid #include
2406         explosion for .get().
2407
2408         * dom/ContainerNode.h:
2409         * dom/Document.h:
2410         * dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all
2411         subclasses except for DocumentFragment were already so, and we have
2412         code that uses WeakPtr<ContainerNode>, which, now that WeakPtr is
2413         type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr.
2414
2415         * dom/FullscreenManager.cpp:
2416         (WebCore::FullscreenManager::fullscreenRenderer const):
2417         * dom/FullscreenManager.h:
2418         (WebCore::FullscreenManager::fullscreenRenderer const): Deleted.
2419         * html/FormAssociatedElement.cpp:
2420         (WebCore::FormAssociatedElement::form const):
2421         * html/FormAssociatedElement.h:
2422         (WebCore::FormAssociatedElement::form const): Deleted. Moved functions
2423         out of line to avoid #include explosion for .get().
2424
2425         * html/HTMLMediaElement.h: It takes an extra using declaration
2426         to disambiguate multiple CanMakeWeakPtr base classes now.
2427
2428         * loader/MediaResourceLoader.cpp:
2429         (WebCore::MediaResourceLoader::requestResource): Removed redundant .get().
2430
2431         * page/DOMWindowProperty.cpp:
2432         (WebCore::DOMWindowProperty::window const):
2433         * page/DOMWindowProperty.h:
2434         (WebCore::DOMWindowProperty::window const): Deleted.
2435         * page/FrameViewLayoutContext.cpp:
2436         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const):
2437         * page/FrameViewLayoutContext.h:
2438         (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted.
2439         * page/UndoItem.cpp:
2440         (WebCore::UndoItem::undoManager const):
2441         * page/UndoItem.h:
2442         (WebCore::UndoItem::undoManager const): Deleted. Moved functions out of
2443         line to avoid #include explosion for .get().
2444
2445         * platform/ScrollView.h: It takes an extra using declaration
2446         to disambiguate multiple CanMakeWeakPtr base classes now.
2447
2448         * platform/Widget.cpp:
2449         (WebCore::Widget::parent const):
2450         * platform/Widget.h:
2451         (WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include
2452         explosion for .get().
2453
2454         * platform/encryptedmedia/CDMInstanceSession.h: Made
2455         CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr<CDMInstanceSessionClient>.
2456
2457         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2458         CanMakeWeakPtr is inherited now.
2459
2460         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2461         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2462         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2463         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2464         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted.
2465         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted.
2466         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2467         (WebCore::CMTimebaseEffectiveRateChangedCallback):
2468         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2469         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
2470         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
2471         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
2472         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
2473         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const):
2474         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2475         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2476         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2477         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2478         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2479         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
2480         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2481         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
2482         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
2483         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage.
2484
2485         * rendering/RenderBlockFlow.cpp:
2486         (WebCore::RenderBlockFlow::multiColumnFlowSlowCase const):
2487         * rendering/RenderBlockFlow.h:
2488         (WebCore::RenderBlockFlow::multiColumnFlow const):
2489         * rendering/RenderMultiColumnFlow.cpp:
2490         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const):
2491         * rendering/RenderMultiColumnFlow.h:
2492         * rendering/RenderTable.cpp:
2493         (WebCore::RenderTable::header const):
2494         (WebCore::RenderTable::footer const):
2495         (WebCore::RenderTable::firstBody const):
2496         (WebCore::RenderTable::topSection const):
2497         * rendering/RenderTable.h:
2498         (WebCore::RenderTable::header const): Deleted.
2499         (WebCore::RenderTable::footer const): Deleted.
2500         (WebCore::RenderTable::firstBody const): Deleted.
2501         (WebCore::RenderTable::topSection const): Deleted. Moved functions out
2502         of line to avoid #include explosion for .get().
2503
2504 2019-05-29  Antti Koivisto  <antti@apple.com>
2505
2506         Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node
2507         https://bugs.webkit.org/show_bug.cgi?id=198329
2508
2509         Reviewed by Darin Adler.
2510
2511         Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow.html
2512
2513         With sticky positioning in non-stacking context overflow you currently get structure like
2514
2515         FrameScrollingNode
2516           OverflowScrollingNode
2517           StickyNode
2518             PositionedNode
2519
2520         where StickyNode and PositionedNode reference the same layer. Sticky doesn't get applied at all when the overflow moves.
2521
2522         This patch reverses the order of sticky and positioned. It doesn't fix sticky positioning during scrolling yet,
2523         but it does make it less jumpy. It is a prerequisite for the full fix.
2524
2525         * rendering/RenderLayerCompositor.cpp:
2526         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2527
2528 2019-05-29  Ludovico de Nittis  <ludovico.denittis@collabora.com>
2529
2530         Prepend KEY_ to the last key alias in PlatformEventKeyboardGtk
2531         https://bugs.webkit.org/show_bug.cgi?id=198331
2532
2533         Reviewed by Michael Catanzaro.
2534
2535         No behavior change.
2536
2537         With the commit
2538         https://bugs.webkit.org/show_bug.cgi?id=198326
2539         A gdk key slipped away from the renaming.
2540
2541         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2542         (WebCore::modifiersForGdkKeyEvent):
2543
2544 2019-05-29  Zalan Bujtas  <zalan@apple.com>
2545
2546         [LFC][IFC] Move Line class to a dedicated file
2547         https://bugs.webkit.org/show_bug.cgi?id=198332
2548         <rdar://problem/51221403>
2549
2550         Reviewed by Antti Koivisto.
2551
2552         An upcoming refactoring requires the Line class to be in a .h.
2553
2554         * Sources.txt:
2555         * WebCore.xcodeproj/project.pbxproj:
2556         * layout/displaytree/DisplayRun.h:
2557         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2558         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
2559         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
2560         (WebCore::Layout::halfLeadingMetrics): Deleted.
2561         (WebCore::Layout::Line::availableWidth const): Deleted.
2562         (WebCore::Layout::Line::contentLogicalRight const): Deleted.
2563         (WebCore::Layout::Line::contentLogicalWidth const): Deleted.
2564         (WebCore::Layout::Line::logicalTop const): Deleted.
2565         (WebCore::Layout::Line::logicalLeft const): Deleted.
2566         (WebCore::Layout::Line::logicalRight const): Deleted.
2567         (WebCore::Layout::Line::logicalBottom const): Deleted.
2568         (WebCore::Layout::Line::logicalWidth const): Deleted.
2569         (WebCore::Layout::Line::logicalHeight const): Deleted.
2570         (WebCore::Layout::Line::LineItem::LineItem): Deleted.
2571         (WebCore::Layout::Line::Line): Deleted.
2572         (WebCore::Layout::Line::reset): Deleted.
2573         (WebCore::Layout::Line::close): Deleted.
2574         (WebCore::Layout::Line::removeTrailingTrimmableContent): Deleted.
2575         (WebCore::Layout::Line::moveLogicalLeft): Deleted.
2576         (WebCore::Layout::Line::moveLogicalRight): Deleted.
2577         (WebCore::Layout::isTrimmableContent): Deleted.
2578         (WebCore::Layout::Line::trailingTrimmableWidth const): Deleted.
2579         (WebCore::Layout::Line::hasContent const): Deleted.
2580         (WebCore::Layout::Line::appendNonBreakableSpace): Deleted.
2581         (WebCore::Layout::Line::appendInlineContainerStart): Deleted.
2582         (WebCore::Layout::Line::appendInlineContainerEnd): Deleted.
2583         (WebCore::Layout::Line::appendTextContent): Deleted.
2584         (WebCore::Layout::Line::appendNonReplacedInlineBox): Deleted.
2585         (WebCore::Layout::Line::appendReplacedInlineBox): Deleted.
2586         (WebCore::Layout::Line::appendHardLineBreak): Deleted.
2587         * layout/inlineformatting/InlineTextItem.h:
2588         * layout/inlineformatting/text/TextUtil.cpp:
2589         (WebCore::Layout::TextUtil::isTrimmableContent):
2590         * layout/inlineformatting/text/TextUtil.h:
2591
2592 2019-05-29  Ludovico de Nittis  <ludovico.denittis@collabora.com>
2593
2594         PlatformEventKeyboardGtk still uses old key aliases
2595         https://bugs.webkit.org/show_bug.cgi?id=198326
2596
2597         Reviewed by Carlos Garcia Campos.
2598
2599         No behavior change.
2600
2601         Use the new key names convention prepending "KEY_".
2602
2603         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2604         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
2605         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode):
2606         (WebCore::PlatformKeyboardEvent::singleCharacterString):
2607         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2608
2609 2019-05-28  Yacine Bandou  <yacine.bandou@softathome.com>
2610
2611         [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
2612         https://bugs.webkit.org/show_bug.cgi?id=197834
2613
2614         Reviewed by Xabier Rodriguez-Calvar.
2615
2616         The buffering state and the m_downloadFinished boolean aren't supported in the MSE case.
2617         When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData",
2618         or else the MediaPlayer would send a "canplay" event instead of a "canplaythrough".
2619
2620         Test: media/media-source/media-source-canplaythrough-event.html
2621
2622         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2623         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
2624
2625 2019-05-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2626
2627         [WinCairo] ASSERTION FAILED: !m_preparingToPlay in MediaPlayerPrivateMediaFoundation::prepareToPlay
2628         https://bugs.webkit.org/show_bug.cgi?id=190747
2629
2630         Reviewed by Alex Christensen.
2631
2632         HTMLMediaElement::prepareToPlay had a assertion ensuring that it
2633         was not called twice. However, it was called twice. The first from
2634         HTMLMediaElement::load, the second from
2635         MediaPlayerPrivateMediaFoundation::onTopologySet.
2636
2637         prepareToPlay started loading. And, loading should be started
2638         after onTopologySet is called back.
2639
2640         Covered by existing tests.
2641
2642         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2643         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet): Moved code from prepareToPlay.
2644         (WebCore::MediaPlayerPrivateMediaFoundation::prepareToPlay): Deleted and moved the code to onTopologySet.
2645         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Removed prepareToPlay declaration.
2646
2647 2019-05-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2648
2649         [WinCairo][MediaFoundation] Assertion failure in MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample
2650         https://bugs.webkit.org/show_bug.cgi?id=198290
2651
2652         Reviewed by Per Arne Vollan.
2653
2654         Covered by existing tests.
2655
2656         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2657         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
2658         Call clear() of m_memSurface before assigning new value.
2659
2660 2019-05-28  Saam Barati  <sbarati@apple.com>
2661
2662         [WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type
2663         https://bugs.webkit.org/show_bug.cgi?id=198321
2664
2665         Reviewed by Myles C. Maxfield.
2666
2667         Consider this program:
2668         ```
2669         thread int* x;
2670         *x = 42
2671         ```
2672         
2673         In the Checker, we were saying the type of "*x" was "int*" instead of "int".
2674
2675         Test: webgpu/whlsl-dereference-pointer-should-type-check.html
2676
2677         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2678         (WebCore::WHLSL::Checker::visit):
2679
2680 2019-05-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2681
2682         [iOS] Respect NSItemProvider's registered types when dropping files that are loaded in-place
2683         https://bugs.webkit.org/show_bug.cgi?id=198315
2684         <rdar://problem/51183762>
2685
2686         Reviewed by Tim Horton.
2687
2688         Currently, logic in PasteboardIOS.mm and WebContentReaderCocoa.mm attempts to deduce the content type from the
2689         file path when dropping attachments on iOS. Instead, we should be plumbing the content type through to the
2690         reader.
2691
2692         Test: WKAttachmentTestsIOS.InsertDroppedImageWithNonImageFileExtension
2693
2694         * editing/WebContentReader.h:
2695         * editing/cocoa/WebContentReaderCocoa.mm:
2696         (WebCore::typeForAttachmentElement):
2697
2698         Add a helper method to determine which type to use in attachment elements. This makes the paste
2699         (attachmentForData) and drop (attachmentForFilePaths) behave the same way, with respect to the type attribute
2700         used to represent the attachment.
2701
2702         (WebCore::attachmentForFilePath):
2703
2704         Use the content type, if specified; otherwise, fall back to deducing it from the file path.
2705
2706         (WebCore::attachmentForData):
2707         (WebCore::WebContentReader::readFilePath):
2708         * platform/Pasteboard.h:
2709         (WebCore::PasteboardWebContentReader::readFilePath):
2710
2711         Pass the highest fidelity representation's content type to the web content reader.
2712
2713         * platform/ios/PasteboardIOS.mm:
2714         (WebCore::Pasteboard::readRespectingUTIFidelities):
2715
2716 2019-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
2717
2718         Move idempotent text autosizing to StyleTreeResolver
2719         https://bugs.webkit.org/show_bug.cgi?id=197808
2720         <rdar://problem/50283983>
2721
2722         Reviewed by Antti Koivisto.
2723
2724         This patch migrates the idempotent text autosizing code to live inside style resolution. This is almost
2725         the same as the algorithm that uses the result of layout to calculate autosizing, but this version only
2726         operates on style (and thus doesn't require double layouts). Because it is being run in an environment
2727         with less information, autosizing is occurring in more places, so the curves have been adjusted to make
2728         autosizing not boost as much as the previous implementation did. The new algorithm is modelled after
2729         text-decorations-in-effect. I've claimed 4 of the unused bits in RenderStyle to contain the state of the
2730         autosizing algorithm. StyleResolver::adjustRenderStyle() is where the algorithm is implemented:
2731         - Look at the inherited bits
2732         - Interogate the element's RenderStyle
2733         - Compute new bits for the element, and set them in its RenderStyle
2734         - Based on the newly computed bits, determine whether we should increase the text size
2735         - If so, determine how much using the specified font size, and apply the result to the computed font size
2736
2737         This works because StyleBuilderCustom::applyInheritFontSize() inherits from the specified font size, not
2738         the computed font size.
2739
2740         This patch also will disable autosizing using the other methods (so there aren't two methods of autosizing
2741         fighting each other) and will honor text-size-adjust:none. However, it won't honor text-size-adjust:100%.
2742         If content says text-size-adjust:100%, we will disregard it and take this code path.
2743
2744         Tests: fast/text-autosizing/ios/idempotentmode/css-exposure.html
2745                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html
2746                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
2747                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
2748
2749         * Sources.txt:
2750         * WebCore.xcodeproj/project.pbxproj:
2751         * css/CSSComputedStyleDeclaration.cpp:
2752         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2753         * css/CSSProperties.json:
2754         * css/StyleBuilderCustom.h:
2755         (WebCore::computeBaseSpecifiedFontSize):
2756         (WebCore::computeLineHeightMultiplierDueToFontSize):
2757         * css/StyleResolver.cpp:
2758         (WebCore::idempotentTextSize):
2759         (WebCore::hasTextChildren):
2760         (WebCore::StyleResolver::adjustRenderStyle):
2761         (WebCore::StyleResolver::checkForTextSizeAdjust):
2762         * page/FrameViewLayoutContext.cpp:
2763         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
2764         * rendering/RenderBlockFlow.cpp:
2765         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2766         (WebCore::idempotentTextSize): Deleted.
2767         * rendering/RenderBlockFlow.h:
2768         * rendering/RenderElement.cpp:
2769         (WebCore::includeNonFixedHeight):
2770         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
2771         (WebCore::RenderElement::resetTextAutosizing):
2772         * rendering/style/RenderStyle.cpp:
2773         (WebCore::RenderStyle::RenderStyle):
2774         (WebCore::RenderStyle::autosizeStatus const):
2775         (WebCore::RenderStyle::setAutosizeStatus):
2776         * rendering/style/RenderStyle.h:
2777         * rendering/style/TextSizeAdjustment.cpp: Added.
2778         (WebCore::AutosizeStatus::AutosizeStatus):
2779         (WebCore::AutosizeStatus::contains const):
2780         (WebCore::AutosizeStatus::modifiedStatus const):
2781         (WebCore::AutosizeStatus::shouldSkipSubtree const):
2782         * rendering/style/TextSizeAdjustment.h:
2783
2784 2019-05-28  Simon Fraser  <simon.fraser@apple.com>
2785
2786         Use scroll-velocity-based tile coverage for overflow:scroll
2787         https://bugs.webkit.org/show_bug.cgi?id=198294
2788         rdar://problem/48942184
2789
2790         Reviewed by Tim Horton.
2791
2792         Start using a velocity-based tile coverage computation on layers with Type::ScrolledContents,
2793         which is the content layers for overflow:scroll when they get big enough to get tiled.
2794
2795         Move legacy macOS coverage code into adjustTileCoverageForDesktopPageScrolling() because
2796         I don't want to change its behavior in this patch. Use TileController::adjustTileCoverageRectForScrolling()
2797         for iOS and macOS overflow scrolling. Since only iOS page scrolling gets velocity data from the UI
2798         process, compute velocity in TileController using the visible rect top-left.
2799         
2800         For overflow scroll, we have to plumb horizontal and vertical coverage in from
2801         RenderLayerBacking.
2802
2803         Tests: tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage.html
2804                tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage.html
2805                tiled-drawing/scrolling/overflow/overflow-tile-coverage.html
2806
2807         * platform/graphics/TiledBacking.h:
2808         * platform/graphics/ca/GraphicsLayerCA.cpp:
2809         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
2810         * platform/graphics/ca/PlatformCALayer.h:
2811         * platform/graphics/ca/TileController.cpp:
2812         (WebCore::TileController::setVelocity):
2813         (WebCore::TileController::adjustTileCoverageRect):
2814         (WebCore::TileController::adjustTileCoverageForDesktopPageScrolling const):
2815         (WebCore::TileController::adjustTileCoverageWithScrollingVelocity const):
2816         (WebCore::TileController::adjustTileCoverageRectForScrolling):
2817         (WebCore::expandRectWithinRect): Deleted.
2818         (WebCore::TileController::adjustTileCoverageRect const): Deleted.
2819         (WebCore::TileController::adjustTileCoverageRectForScrolling const): Deleted.
2820         * platform/graphics/ca/TileController.h:
2821         * rendering/RenderLayer.h:
2822         * rendering/RenderLayerBacking.cpp:
2823         (WebCore::computePageTiledBackingCoverage):
2824         (WebCore::computeOverflowTiledBackingCoverage):
2825         (WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
2826         (WebCore::RenderLayerBacking::updateGeometry):
2827
2828 2019-05-28  Shawn Roberts  <sroberts@apple.com>
2829
2830         Unreviewed, rolling out r245475.
2831
2832         Newly imported test is flaky. Features need flags.
2833
2834         Reverted changeset:
2835
2836         "Implement imagesrcset and imagesizes attributes on link
2837         rel=preload"
2838         https://bugs.webkit.org/show_bug.cgi?id=192950
2839         https://trac.webkit.org/changeset/245475
2840
2841 2019-05-28  Brent Fulgham  <bfulgham@apple.com>
2842
2843         Protect frames during style and layout changes
2844         https://bugs.webkit.org/show_bug.cgi?id=198047
2845         <rdar://problem/50954082>
2846
2847         Reviewed by Zalan Bujtas.
2848
2849         Be more careful about the scope and lifetime of objects that participate in layout or
2850         style updates. If a method decides a layout or style update is needed, it needs to
2851         confirm that the elements it was operating on are still valid and needed in the
2852         current operation.
2853
2854         * accessibility/AXObjectCache.cpp:
2855         (WebCore::AXObjectCache::getOrCreate):
2856         * accessibility/AccessibilityRenderObject.cpp:
2857         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
2858         * css/CSSComputedStyleDeclaration.cpp:
2859         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2860         * css/CSSComputedStyleDeclaration.h:
2861         * css/SVGCSSComputedStyleDeclaration.cpp:
2862         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2863         * dom/Document.cpp:
2864         (WebCore::Document::setFocusedElement):
2865         * editing/TypingCommand.cpp:
2866         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
2867         (WebCore::TypingCommand::insertLineBreak):
2868         (WebCore::TypingCommand::insertParagraphSeparator):
2869         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
2870         * editing/ios/EditorIOS.mm:
2871         (WebCore::Editor::setDictationPhrasesAsChildOfElement):
2872         * html/HTMLLabelElement.cpp:
2873         (WebCore::HTMLLabelElement::focus):
2874         * html/HTMLTextAreaElement.cpp:
2875         (WebCore::HTMLTextAreaElement::appendFormData):
2876         * html/ImageDocument.cpp:
2877         (WebCore::ImageDocument::imageClicked):
2878         * html/ValidationMessage.cpp:
2879         (WebCore::ValidationMessage::buildBubbleTree):
2880         * page/FrameView.cpp:
2881         (WebCore::FrameView::autoSizeIfEnabled):
2882         (WebCore::FrameView::trackedRepaintRectsAsText const):
2883         * page/PrintContext.cpp:
2884         (WebCore::PrintContext::pageProperty):
2885         (WebCore::PrintContext::numberOfPages):
2886         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
2887
2888 2019-05-28  Antti Koivisto  <antti@apple.com>
2889
2890         [async scrolling] Fixed positioning inside stacking context overflow scroll is jumpy
2891         https://bugs.webkit.org/show_bug.cgi?id=198292
2892
2893         Reviewed by Darin Adler.
2894
2895         Tests: scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-2.html
2896                scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll.html
2897
2898         We were computing delta from the layout scroll position in ScrollingTree::notifyRelatedNodesAfterScrollPositionChange
2899         based on the passed in node only. If any other node had deltas they were not taken into account at all. This would occur
2900         frequently since the function is always invoked for the root node after layer tree commit.
2901
2902         Fix by moving the delta computation (and fetching layoutViewport) to ScrollingTreeFixedNode.
2903
2904         * page/scrolling/ScrollingTree.cpp:
2905         (WebCore::ScrollingTree::applyLayerPositions):
2906
2907         No need to pass offset and layoutViewport around anymore.
2908
2909         (WebCore::ScrollingTree::applyLayerPositionsRecursive):
2910         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
2911
2912         Remove the offset and layoutViewport computations.
2913
2914         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
2915         * page/scrolling/ScrollingTree.h:
2916         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2917         (WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
2918         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2919         * page/scrolling/ScrollingTreeNode.cpp:
2920         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
2921         * page/scrolling/ScrollingTreeNode.h:
2922         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2923         (WebCore::ScrollingTreeScrollingNode::applyLayerPositions):
2924         * page/scrolling/ScrollingTreeScrollingNode.h:
2925         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
2926         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2927         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
2928
2929         Compute them here instead, always taking all overflow scrollers up to the closest frame into account.
2930
2931         * page/scrolling/cocoa/ScrollingTreePositionedNode.h:
2932         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2933         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
2934         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
2935         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
2936         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2937         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
2938
2939 2019-05-28  Zalan Bujtas  <zalan@apple.com>
2940
2941         [LFC][Verification] Add additional inline and block checks
2942         https://bugs.webkit.org/show_bug.cgi?id=198252
2943         <rdar://problem/51140687>
2944
2945         Reviewed by Antti Koivisto.
2946
2947         Now we also test the geometry of the blocks with inline formatting contexts.
2948
2949         * layout/Verification.cpp:
2950         (WebCore::Layout::checkForMatchingTextRuns):
2951         (WebCore::Layout::verifyAndOutputSubtree):
2952
2953 2019-05-28  Zalan Bujtas  <zalan@apple.com>
2954
2955         [LFC][IFC] Decouple line layout and processing inline runs.
2956         https://bugs.webkit.org/show_bug.cgi?id=198282
2957         <rdar://problem/51167954>
2958
2959         Reviewed by Antti Koivisto.
2960
2961         This is in preparation for using "createInlineRunsForLine" logic when computing preferred width.
2962
2963         * layout/inlineformatting/InlineFormattingContext.h:
2964         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2965         (WebCore::Layout::UncommittedContent::size const):
2966         (WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const):
2967         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
2968         (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
2969         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): Deleted.
2970         * layout/inlineformatting/InlineFormattingState.h:
2971         (WebCore::Layout::InlineFormattingState::addInlineItem):
2972         * layout/inlineformatting/InlineTextItem.cpp:
2973         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
2974
2975 2019-05-28  Zalan Bujtas  <zalan@apple.com>
2976
2977         [LFC][IFC] Move intrinsic width computation from InlineFormattingContext to LineLayout
2978         https://bugs.webkit.org/show_bug.cgi?id=198258
2979
2980         Reviewed by Antti Koivisto.
2981
2982         This is in preparation for sharing even more code between line layout and preferred width computation. 
2983
2984         * layout/inlineformatting/InlineFormattingContext.cpp:
2985         (WebCore::Layout::InlineFormattingContext::layout const):
2986         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2987         * layout/inlineformatting/InlineFormattingContext.h:
2988         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2989         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
2990         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
2991         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
2992         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
2993
2994 2019-05-28  Zalan Bujtas  <zalan@apple.com>
2995
2996         [LFC[IFC] Ignore the initial strut's height when the line does not have any content.
2997         https://bugs.webkit.org/show_bug.cgi?id=198268
2998         <rdar://problem/51150057>
2999
3000         Reviewed by Antti Koivisto.
3001
3002         The strut (https://www.w3.org/TR/CSS22/visudet.html#leading) defines the initial logical height
3003         for the line. This height should be ignored though when the line does not have any content. 
3004
3005         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3006         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
3007
3008 2019-05-27  Antoine Quint  <graouts@apple.com>
3009
3010         [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
3011         https://bugs.webkit.org/show_bug.cgi?id=198191
3012
3013         Reviewed by Dean Jackson.
3014
3015         When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document.
3016         I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by
3017         the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129,
3018         but I've checked that removing those fixes and using this patch correctly fixes that bug.
3019
3020         * page/Page.cpp:
3021         (WebCore::Page::didChangeMainDocument):
3022         * page/PointerCaptureController.cpp:
3023         (WebCore::PointerCaptureController::PointerCaptureController):
3024         (WebCore::PointerCaptureController::reset):
3025         * page/PointerCaptureController.h:
3026
3027 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3028
3029         [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
3030         https://bugs.webkit.org/show_bug.cgi?id=197944
3031
3032         Reviewed by Michael Catanzaro.
3033
3034         * PlatformGTK.cmake:
3035         * SourcesGTK.txt:
3036         * platform/graphics/GLContext.cpp:
3037         (WebCore::GLContext::createContextForWindow): Check current display is X11 before trying to create a GLX context.
3038         * platform/graphics/PlatformDisplay.cpp:
3039         (WebCore::PlatformDisplay::createPlatformDisplay): Use USE(WPE_RENDERER) instead of USE(LIBWPE).
3040         * platform/graphics/PlatformDisplay.h:
3041         * platform/graphics/egl/GLContextEGL.cpp:
3042         (WebCore::GLContextEGL::createWindowContext): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
3043         (WebCore::GLContextEGL::createContext): Ditto.
3044         (WebCore::GLContextEGL::createSharingContext): Ditto.
3045         (WebCore::GLContextEGL::~GLContextEGL): Ditto.
3046         * platform/graphics/egl/GLContextEGL.h:
3047         * platform/graphics/egl/GLContextEGLLibWPE.cpp:
3048         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3049         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
3050         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
3051         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): In GTK port set the display as the shared one for compositing.
3052         * platform/graphics/libwpe/PlatformDisplayLibWPE.h:
3053
3054 2019-05-27  Takashi Komori  <Takashi.Komori@sony.com>
3055
3056         [CURL] Fix crashing SocketStreamHandle.
3057         https://bugs.webkit.org/show_bug.cgi?id=197873
3058
3059         Reviewed by Fujii Hironori.
3060
3061         When NetworkSocketStream was destructed SocketStreamHandleImple::platformClose was called wrongly times.
3062         This is because closed state is not set.
3063
3064         Test: http/tests/websocket/tests/hybi/workers/close.html
3065
3066         * platform/network/curl/SocketStreamHandleImpl.h:
3067         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
3068         (WebCore::SocketStreamHandleImpl::platformSendInternal):
3069         (WebCore::SocketStreamHandleImpl::platformClose):
3070         (WebCore::SocketStreamHandleImpl::threadEntryPoint):
3071         (WebCore::SocketStreamHandleImpl::handleError):
3072         (WebCore::SocketStreamHandleImpl::callOnWorkerThread):
3073         (WebCore::SocketStreamHandleImpl::executeTasks):
3074
3075 2019-05-27  Oriol Brufau  <obrufau@igalia.com>
3076
3077         [css-grid] Preserve repeat() notation when serializing declared values
3078         https://bugs.webkit.org/show_bug.cgi?id=197840
3079
3080         Reviewed by Manuel Rego Casasnovas.
3081
3082         Tests: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
3083                fast/css-grid-layout/grid-repeat-calc.html
3084                fast/css-grid-layout/named-grid-line-get-set.html
3085                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html
3086
3087         Before this change, a repeat() notation with an integral number of
3088         repetitions was expanded at parse time. This was observable when reading
3089         declared values using JS APIs.
3090
3091         This patch makes the parser preserve that notation, like it was already
3092         happening when the number of repetitions was automatic and not integral.
3093
3094         The resolved value in getComputedStyle() will still be expanded, though,
3095         as required by the spec.
3096
3097         * Sources.txt:
3098         * WebCore.xcodeproj/project.pbxproj:
3099         * css/CSSGridIntegerRepeatValue.cpp: Added.
3100         (WebCore::CSSGridIntegerRepeatValue::customCSSText const):
3101         (WebCore::CSSGridIntegerRepeatValue::equals const):
3102         * css/CSSGridIntegerRepeatValue.h: Added.
3103         * css/CSSValue.cpp:
3104         (WebCore::CSSValue::equals const):
3105         (WebCore::CSSValue::cssText const):
3106         (WebCore::CSSValue::destroy):
3107         * css/CSSValue.h:
3108         (WebCore::CSSValue::isGridIntegerRepeatValue const):
3109         * css/StyleBuilderConverter.h:
3110         (WebCore::StyleBuilderConverter::createGridTrackList):
3111         (WebCore::StyleBuilderConverter::convertGridTrackSizeList):
3112         * css/parser/CSSPropertyParser.cpp:
3113         (WebCore::consumeGridTrackRepeatFunction):
3114
3115 2019-05-27  Chris Dumez  <cdumez@apple.com>
3116
3117         Use a strongly-typed identifier for pages
3118         https://bugs.webkit.org/show_bug.cgi?id=198206
3119
3120         Reviewed by Youenn Fablet.
3121
3122         * WebCore/*:
3123
3124 2019-05-26  Simon Fraser  <simon.fraser@apple.com>
3125
3126         Move GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController
3127         https://bugs.webkit.org/show_bug.cgi?id=198266
3128
3129         Reviewed by Zalan Bujtas.
3130
3131         GraphicsLayerCA::adjustTiledLayerVisibleRect() was computing tile coverage for a
3132         TiledBacking, just like TileController::adjustTileCoverageRect(), so move the code
3133         into TileController as a first step to unifying more of this code. It's currently
3134         used for tiled compositing layers, including overflow:scroll, and tiled layers
3135         whose coverage may be affected by animations, so it's general-purpose.
3136
3137         TileController::adjustTileCoverageRect() is used for scrollable things, so rename
3138         it to adjustTileCoverageRectForScrolling().
3139
3140         No behavior change.
3141
3142         * platform/graphics/TiledBacking.h:
3143         * platform/graphics/ca/GraphicsLayerCA.cpp:
3144         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
3145         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): Deleted.
3146         * platform/graphics/ca/GraphicsLayerCA.h:
3147         * platform/graphics/ca/TileController.cpp:
3148         (WebCore::TileController::adjustTileCoverageRect const):
3149         (WebCore::TileController::adjustTileCoverageRectForScrolling const):
3150         * platform/graphics/ca/TileController.h:
3151
3152 2019-05-27  Simon Fraser  <simon.fraser@apple.com>
3153
3154         Fix Apple Internal builds after r245788.
3155
3156         * platform/PlatformScreen.h:
3157         (WebCore::screenHasTouchDevice):
3158         (WebCore::screenIsTouchPrimaryInputDevice):
3159
3160 2019-05-27  Zalan Bujtas  <zalan@apple.com>
3161
3162         [LFC][IFC] Ignore collapsed runs when setting the width on the associated display boxes.
3163         https://bugs.webkit.org/show_bug.cgi?id=198260
3164         <rdar://problem/51145704>
3165
3166         Reviewed by Antti Koivisto.
3167
3168         Collapsed runs don't contribute to the logical width of their containers.
3169
3170         Covered by existing tests.
3171
3172         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3173         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
3174
3175 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3176
3177         Unreviewed. Fix GTK distcheck
3178
3179         Move mac headers to platform specific makefile.
3180
3181         * Headers.cmake:
3182         * PlatformMac.cmake:
3183
3184 2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3185
3186         Touch support is reported even when the device doesn't have a touch screen
3187         https://bugs.webkit.org/show_bug.cgi?id=139681
3188
3189         Reviewed by Michael Catanzaro.
3190
3191         Add screenHasTouchDevice() and screenIsTouchPrimaryInputDevice() to PlatformScreen and use it to decide whether
3192         to expose touch events functionality or not.
3193
3194         * bindings/js/WebCoreBuiltinNames.h:
3195         * css/MediaQueryEvaluator.cpp:
3196         (WebCore::hoverEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
3197         (WebCore::anyHoverEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
3198         (WebCore::pointerEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
3199         (WebCore::anyPointerEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
3200         * dom/GlobalEventHandlers.idl: Make touch event attributes enabled at runtime.
3201         * page/RuntimeEnabledFeatures.cpp:
3202         (WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Return whether touch events are enabled.
3203         * page/RuntimeEnabledFeatures.h:
3204         (WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Force touch events to be enabled or disabled.
3205         * platform/PlatformScreen.h:
3206         (WebCore::screenHasTouchDevice): Just return true when touch events are enabled at build time for non-gtk ports.
3207         (WebCore::screenIsTouchPrimaryInputDevice): Ditto.
3208         * platform/gtk/PlatformScreenGtk.cpp:
3209         (WebCore::screenHasTouchDevice):
3210         (WebCore::screenIsTouchPrimaryInputDevice):
3211         (WebCore::isTouchDevice):
3212         (WebCore::deviceAddedCallback):
3213         (WebCore::deviceRemovedCallback):
3214
3215 2019-05-26  Simon Fraser  <simon.fraser@apple.com>
3216
3217         Move VelocityData to WebCore
3218         https://bugs.webkit.org/show_bug.cgi?id=198261
3219
3220         Reviewed by Antti Koivisto.
3221
3222         Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll.
3223         
3224         VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as
3225         the timetamp for the entire update).
3226
3227         No behavior change.
3228
3229         * Headers.cmake:
3230         * Sources.txt:
3231         * WebCore.xcodeproj/project.pbxproj:
3232         * page/FrameView.cpp:
3233         (WebCore::FrameView::setScrollVelocity):
3234         * page/FrameView.h:
3235         * platform/graphics/TiledBacking.h:
3236         (WebCore::VelocityData::VelocityData): Deleted.
3237         (WebCore::VelocityData::velocityOrScaleIsChanging const): Deleted.
3238         * platform/graphics/ca/TileController.cpp:
3239         (WebCore::TileController::adjustTileCoverageRect const):
3240         * platform/graphics/ca/TileController.h:
3241
3242 2019-05-26  Simon Fraser  <simon.fraser@apple.com>
3243
3244         Add a GraphicsLayer::Type for ScrolledContents
3245         https://bugs.webkit.org/show_bug.cgi?id=198257
3246
3247         Reviewed by Zalan Bujtas.
3248
3249         This ScrolledContents layer type will be used to choose different tiling behaviors
3250         in a future patch.
3251
3252         * platform/graphics/GraphicsLayer.cpp:
3253         (WebCore::GraphicsLayer::supportsLayerType):
3254         * platform/graphics/GraphicsLayer.h:
3255         * platform/graphics/ca/GraphicsLayerCA.cpp:
3256         (WebCore::GraphicsLayer::supportsLayerType):
3257         (WebCore::GraphicsLayerCA::initialize):
3258         (WebCore::GraphicsLayerCA::adjustCoverageRect const):
3259         * rendering/RenderLayerBacking.cpp:
3260         (WebCore::RenderLayerBacking::updateScrollingLayers):
3261         * rendering/RenderLayerCompositor.cpp:
3262         (WebCore::RenderLayerCompositor::ensureRootLayer):
3263
3264 2019-05-26  John Wilander  <wilander@apple.com>
3265
3266         Resource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if the page was navigated to with a prevalent resource referrer containing link decoration
3267         https://bugs.webkit.org/show_bug.cgi?id=198227
3268         <rdar://problem/51117258>
3269
3270         Reviewed by Alex Christensen.
3271
3272         Test: http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource.html
3273
3274         * Headers.cmake:
3275         * WebCore.xcodeproj/project.pbxproj:
3276         * dom/Document.cpp:
3277         (WebCore::Document::referrer const):
3278             Now checks if the referrer has been overridden.
3279         (WebCore::Document::wasLoadedWithDataTransferFromPrevalentResource):
3280         (WebCore::Document::downgradeReferrerToRegistrableDomain):
3281         * dom/Document.h:
3282         * page/CrossSiteNavigationDataTransfer.h: Added.
3283             New option set for the growing number of navigational data transfers we care about.
3284         * platform/network/NetworkStorageSession.cpp:
3285         (WebCore::NetworkStorageSession::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
3286         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration): Deleted.
3287             New name since we no longer only look for link decoration but also other means of navigational data transfer.
3288         * platform/network/NetworkStorageSession.h:
3289
3290 2019-05-26  Zalan Bujtas  <zalan@apple.com>
3291
3292         [LFC][Verification] Add areEssentiallyEqual for LayoutRect
3293         https://bugs.webkit.org/show_bug.cgi?id=198250
3294         <rdar://problem/51140119>
3295
3296         Reviewed by Antti Koivisto.
3297
3298         WebKit's inline layout is a mix of int/float/LayoutUnit types, while LFC mostly uses LayoutUnit.
3299         When we compute the used size of a block container (based on the inline tree), the final value might go through a few conversions.
3300
3301         * layout/Verification.cpp:
3302         (WebCore::Layout::areEssentiallyEqual):
3303         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3304
3305 2019-05-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3306
3307         [iOS] Dropped text, attachments, and images should animate into place
3308         https://bugs.webkit.org/show_bug.cgi?id=198243
3309         <rdar://problem/35205373>
3310
3311         Reviewed by Tim Horton.
3312
3313         Add some hooks to notify the chrome client when an HTMLImageElement's image is finished loading. See WebKit
3314         changelog for more detail.
3315
3316         Test: DragAndDropTests.DropPreviewForImageInEditableArea
3317
3318         * loader/EmptyClients.h:
3319         * page/ChromeClient.h:
3320         * page/Page.cpp:
3321         (WebCore::Page::didFinishLoadingImageForElement):
3322         * page/Page.h:
3323         * rendering/RenderImage.cpp:
3324         (WebCore::RenderImage::notifyFinished):
3325
3326 2019-05-25  Zalan Bujtas  <zalan@apple.com>
3327
3328         [LFC][IFC] Introduce DisplayRun to display tree
3329         https://bugs.webkit.org/show_bug.cgi?id=197198
3330
3331         Reviewed by Antti Koivisto.
3332
3333         Add a simple inline layout implementation. Now we've got DisplayBoxes for layout boxes and
3334         DisplayRuns for inline runs.
3335
3336         * Sources.txt:
3337         * WebCore.xcodeproj/project.pbxproj:
3338         * layout/FormattingContextGeometry.cpp:
3339         (WebCore::Layout::contentHeightForFormattingContextRoot):
3340         * layout/Verification.cpp:
3341         (WebCore::Layout::areEssentiallyEqual):
3342         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3343         (WebCore::Layout::checkForMatchingNonTextRuns):
3344         (WebCore::Layout::checkForMatchingTextRuns):
3345         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3346         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
3347         (WebCore::Layout::resolveForRelativePositionIfNeeded): Deleted.
3348         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3349         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3350         * layout/displaytree/DisplayBox.cpp:
3351         (WebCore::Display::Box::marginBox const):
3352         (WebCore::Display::Box::nonCollapsedMarginBox const):
3353         (WebCore::Display::Box::borderBox const):
3354         (WebCore::Display::Box::paddingBox const):
3355         (WebCore::Display::Box::contentBox const):
3356         (WebCore::Display::Box::Rect::Rect): Deleted.
3357         * layout/displaytree/DisplayBox.h:
3358         (WebCore::Display::Box::rectWithMargin const):
3359         (WebCore::Display::Box::horizontalMargin const):
3360         (WebCore::Display::Box::Rect::intersects const): Deleted.
3361         (WebCore::Display::Box::Rect::invalidateTop): Deleted.
3362         (WebCore::Display::Box::Rect::invalidateLeft): Deleted.
3363         (WebCore::Display::Box::Rect::invalidateWidth): Deleted.
3364         (WebCore::Display::Box::Rect::invalidateHeight): Deleted.
3365         (WebCore::Display::Box::Rect::hasValidPosition const): Deleted.
3366         (WebCore::Display::Box::Rect::hasValidSize const): Deleted.
3367         (WebCore::Display::Box::Rect::hasValidGeometry const): Deleted.
3368         (WebCore::Display::Box::Rect::invalidatePosition): Deleted.
3369         (WebCore::Display::Box::Rect::setHasValidPosition): Deleted.
3370         (WebCore::Display::Box::Rect::setHasValidSize): Deleted.
3371         (WebCore::Display::Box::Rect::top const): Deleted.
3372         (WebCore::Display::Box::Rect::left const): Deleted.
3373         (WebCore::Display::Box::Rect::bottom const): Deleted.
3374         (WebCore::Display::Box::Rect::right const): Deleted.
3375         (WebCore::Display::Box::Rect::topLeft const): Deleted.
3376         (WebCore::Display::Box::Rect::bottomRight const): Deleted.
3377         (WebCore::Display::Box::Rect::size const): Deleted.
3378         (WebCore::Display::Box::Rect::width const): Deleted.
3379         (WebCore::Display::Box::Rect::height const): Deleted.
3380         (WebCore::Display::Box::Rect::setTopLeft): Deleted.
3381         (WebCore::Display::Box::Rect::setTop): Deleted.
3382         (WebCore::Display::Box::Rect::setLeft): Deleted.
3383         (WebCore::Display::Box::Rect::setWidth): Deleted.
3384         (WebCore::Display::Box::Rect::setHeight): Deleted.
3385         (WebCore::Display::Box::Rect::setSize): Deleted.
3386         (WebCore::Display::Box::Rect::shiftLeftTo): Deleted.
3387         (WebCore::Display::Box::Rect::shiftRightTo): Deleted.
3388         (WebCore::Display::Box::Rect::shiftTopTo): Deleted.
3389         (WebCore::Display::Box::Rect::shiftBottomTo): Deleted.
3390         (WebCore::Display::Box::Rect::moveHorizontally): Deleted.
3391         (WebCore::Display::Box::Rect::moveVertically): Deleted.
3392         (WebCore::Display::Box::Rect::expand): Deleted.
3393         (WebCore::Display::Box::Rect::clone const): Deleted.
3394         (WebCore::Display::Box::Rect::operator LayoutRect const): Deleted.
3395         * layout/displaytree/DisplayRect.h: Added.
3396         (WebCore::Display::Rect::expandHorizontally):
3397         (WebCore::Display::Rect::expandVertically):
3398         (WebCore::Display::Rect::intersects const):
3399         (WebCore::Display::Rect::invalidateTop):
3400         (WebCore::Display::Rect::invalidateLeft):
3401         (WebCore::Display::Rect::invalidateWidth):
3402         (WebCore::Display::Rect::invalidateHeight):
3403         (WebCore::Display::Rect::hasValidPosition const):
3404         (WebCore::Display::Rect::hasValidSize const):
3405         (WebCore::Display::Rect::hasValidGeometry const):
3406         (WebCore::Display::Rect::Rect):
3407         (WebCore::Display::Rect::invalidatePosition):
3408         (WebCore::Display::Rect::setHasValidPosition):
3409         (WebCore::Display::Rect::setHasValidSize):
3410         (WebCore::Display::Rect::top const):
3411         (WebCore::Display::Rect::left const):
3412         (WebCore::Display::Rect::bottom const):
3413         (WebCore::Display::Rect::right const):
3414         (WebCore::Display::Rect::topLeft const):
3415         (WebCore::Display::Rect::bottomRight const):
3416         (WebCore::Display::Rect::size const):
3417         (WebCore::Display::Rect::width const):
3418         (WebCore::Display::Rect::height const):
3419         (WebCore::Display::Rect::setTopLeft):
3420         (WebCore::Display::Rect::setTop):
3421         (WebCore::Display::Rect::setLeft):
3422         (WebCore::Display::Rect::setWidth):
3423         (WebCore::Display::Rect::setHeight):
3424         (WebCore::Display::Rect::setSize):
3425         (WebCore::Display::Rect::shiftLeftTo):
3426         (WebCore::Display::Rect::shiftRightTo):
3427         (WebCore::Display::Rect::shiftTopTo):
3428         (WebCore::Display::Rect::shiftBottomTo):
3429         (WebCore::Display::Rect::moveHorizontally):
3430         (WebCore::Display::Rect::moveVertically):
3431         (WebCore::Display::Rect::expand):
3432         (WebCore::Display::Rect::clone const):
3433         (WebCore::Display::Rect::operator LayoutRect const):
3434         * layout/displaytree/DisplayRun.h: Renamed from Source/WebCore/layout/inlineformatting/InlineRun.h.
3435         (WebCore::Display::Run::TextContext::start const):
3436         (WebCore::Display::Run::TextContext::end const):
3437         (WebCore::Display::Run::TextContext::length const):
3438         (WebCore::Display::Run::TextContext::expand):
3439         (WebCore::Display::Run::logicalTopLeft const):
3440         (WebCore::Display::Run::logicalLeft const):
3441         (WebCore::Display::Run::logicalRight const):
3442         (WebCore::Display::Run::logicalTop const):
3443         (WebCore::Display::Run::logicalBottom const):
3444         (WebCore::Display::Run::logicalWidth const):
3445         (WebCore::Display::Run::logicalHeight const):
3446         (WebCore::Display::Run::setLogicalWidth):
3447         (WebCore::Display::Run::setLogicalTop):
3448         (WebCore::Display::Run::setLogicalLeft):
3449         (WebCore::Display::Run::setLogicalRight):
3450         (WebCore::Display::Run::moveVertically):
3451         (WebCore::Display::Run::moveHorizontally):
3452         (WebCore::Display::Run::expandVertically):
3453         (WebCore::Display::Run::expandHorizontally):
3454         (WebCore::Display::Run::setTextContext):
3455         (WebCore::Display::Run::textContext):
3456         (WebCore::Display::Run::textContext const):
3457         (WebCore::Display::Run::Run):
3458         (WebCore::Display::Run::TextContext::TextContext):
3459         * layout/floats/FloatAvoider.cpp:
3460         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
3461         * layout/floats/FloatAvoider.h:
3462         (WebCore::Layout::FloatAvoider::rect const):
3463         * layout/floats/FloatBox.cpp:
3464         (WebCore::Layout::FloatBox::rect const):
3465         * layout/floats/FloatBox.h:
3466         * layout/floats/FloatingContext.cpp:
3467         (WebCore::Layout::FloatPair::intersects const):
3468         * layout/floats/FloatingState.h:
3469         (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
3470         * layout/inlineformatting/InlineFormattingContext.cpp:
3471         (WebCore::Layout::InlineFormattingContext::layout const):
3472         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
3473         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const):
3474         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const):
3475         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
3476         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
3477         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin const):
3478         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3479         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
3480         (WebCore::Layout::InlineFormattingContext::computeMargin const): Deleted.
3481         (WebCore::Layout::addDetachingRules): Deleted.
3482         (WebCore::Layout::createAndAppendInlineItem): Deleted.
3483         * layout/inlineformatting/InlineFormattingContext.h:
3484         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
3485         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3486         (WebCore::Layout::halfLeadingMetrics):
3487         (WebCore::Layout::Line::availableWidth const):
3488         (WebCore::Layout::Line::contentLogicalRight const):
3489         (WebCore::Layout::Line::contentLogicalWidth const):
3490         (WebCore::Layout::Line::logicalTop const):
3491         (WebCore::Layout::Line::logicalLeft const):
3492         (WebCore::Layout::Line::logicalRight const):
3493         (WebCore::Layout::Line::logicalBottom const):
3494         (WebCore::Layout::Line::logicalWidth const):
3495         (WebCore::Layout::Line::logicalHeight const):
3496         (WebCore::Layout::Line::LineItem::LineItem):
3497         (WebCore::Layout::Line::Line):
3498         (WebCore::Layout::Line::reset):
3499         (WebCore::Layout::Line::close):
3500         (WebCore::Layout::Line::removeTrailingTrimmableContent):
3501         (WebCore::Layout::Line::moveLogicalLeft):
3502         (WebCore::Layout::Line::moveLogicalRight):
3503         (WebCore::Layout::isTrimmableContent):
3504         (WebCore::Layout::Line::trailingTrimmableWidth const):
3505         (WebCore::Layout::Line::hasContent const):
3506         (WebCore::Layout::Line::appendNonBreakableSpace):
3507         (WebCore::Layout::Line::appendInlineContainerStart):
3508         (WebCore::Layout::Line::appendInlineContainerEnd):
3509         (WebCore::Layout::Line::appendTextContent):
3510         (WebCore::Layout::Line::appendNonTextContent):
3511         (WebCore::Layout::Line::appendHardLineBreak):
3512         (WebCore::Layout::UncommittedContent::isEmpty const):
3513         (WebCore::Layout::UncommittedContent::width const):
3514         (WebCore::Layout::UncommittedContent::add):
3515         (WebCore::Layout::UncommittedContent::reset):
3516         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout):
3517         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
3518         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
3519         (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
3520         (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const):
3521         (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const):
3522         (WebCore::Layout::horizontalAdjustmentForAlignment):
3523         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const):
3524         (WebCore::Layout::Line::isClosed const): Deleted.
3525         (WebCore::Layout::Line::isFirstLine const): Deleted.
3526         (WebCore::Layout::Line::runs): Deleted.
3527         (WebCore::Layout::Line::contentLogicalLeft const): Deleted.
3528         (WebCore::Layout::Line::lastRunType const): Deleted.
3529         (WebCore::Layout::Line::init): Deleted.
3530         (WebCore::Layout::Line::adjustLogicalLeft): Deleted.
3531         (WebCore::Layout::Line::adjustLogicalRight): Deleted.
3532         (WebCore::Layout::Line::appendContent): Deleted.
3533         (WebCore::Layout::InlineFormattingContext::LineLayout::initializeNewLine const): Deleted.
3534         (WebCore::Layout::InlineFormattingContext::LineLayout::splitInlineRunIfNeeded const): Deleted.
3535         (WebCore::Layout::InlineFormattingContext::LineLayout::createFinalRuns const): Deleted.
3536         (WebCore::Layout::InlineFormattingContext::LineLayout::postProcessInlineRuns const): Deleted.
3537         (WebCore::Layout::InlineFormattingContext::LineLayout::appendContentToLine const): Deleted.
3538         (WebCore::Layout::InlineFormattingContext::LineLayout::computeFloatPosition const): Deleted.
3539         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInFlowPositionedChildren const): Deleted.
3540         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
3541         (WebCore::Layout::InlineFormattingContext::LineLayout::justifyRuns): Deleted.
3542         (WebCore::Layout::InlineFormattingContext::LineLayout::computeExpansionOpportunities const): Deleted.
3543         (WebCore::Layout::InlineFormattingContext::LineLayout::runWidth const): Deleted.
3544         * layout/inlineformatting/InlineFormattingState.h:
3545         (WebCore::Layout::InlineFormattingState::inlineItems):
3546         (WebCore::Layout::InlineFormattingState::lineBoxes):
3547         (WebCore::Layout::InlineFormattingState::addInlineItem):
3548         (WebCore::Layout::InlineFormattingState::addInlineRun):
3549         (WebCore::Layout::InlineFormattingState::addLineBox):
3550         (WebCore::Layout::InlineFormattingState::inlineContent): Deleted.
3551         (WebCore::Layout::InlineFormattingState::lastInlineItem const): Deleted.
3552         (WebCore::Layout::InlineFormattingState::appendInlineRun): Deleted.
3553         * layout/inlineformatting/InlineItem.h:
3554         (WebCore::Layout::InlineItem::type const):
3555         (WebCore::Layout::InlineItem::isText const):
3556         (WebCore::Layout::InlineItem::isBox const):
3557         (WebCore::Layout::InlineItem::isHardLineBreak const):
3558         (WebCore::Layout::InlineItem::isFloat const):
3559         (WebCore::Layout::InlineItem::isLineBreak const):
3560         (WebCore::Layout::InlineItem::isContainerStart const):
3561         (WebCore::Layout::InlineItem::isContainerEnd const):
3562         (WebCore::Layout::InlineItem::InlineItem):
3563         (WebCore::Layout::InlineItem::setWidth):
3564         (WebCore::Layout::InlineItem::width const):
3565         (WebCore::Layout::InlineItem::addDetachingRule): Deleted.
3566         (WebCore::Layout::InlineItem::detachingRules const): Deleted.
3567         (WebCore::Layout::InlineItem::nonBreakableStart const): Deleted.
3568         (WebCore::Layout::InlineItem::nonBreakableEnd const): Deleted.
3569         (WebCore::Layout::InlineItem::addNonBreakableStart): Deleted.
3570         (WebCore::Layout::InlineItem::addNonBreakableEnd): Deleted.
3571         (WebCore::Layout::InlineItem::textContent const): Deleted.
3572         * layout/inlineformatting/InlineLineBox.h: Copied from Source/WebCore/layout/floats/FloatBox.h.
3573         (WebCore::Layout::LineBox::logicalTopLeft const):
3574         (WebCore::Layout::LineBox::logicalLeft const):
3575         (WebCore::Layout::LineBox::logicalRight const):
3576         (WebCore::Layout::LineBox::logicalTop const):
3577         (WebCore::Layout::LineBox::logicalBottom const):
3578         (WebCore::Layout::LineBox::logicalWidth const):
3579         (WebCore::Layout::LineBox::logicalHeight const):
3580         (WebCore::Layout::LineBox::LineBox):
3581         * layout/inlineformatting/InlineLineBreaker.cpp:
3582         (WebCore::Layout::LineBreaker::LineBreaker):
3583         (WebCore::Layout::LineBreaker::breakingContext):
3584         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
3585         (WebCore::Layout::LineBreaker::runWidth const):
3586         (WebCore::Layout::LineBreaker::isAtBreakingOpportunity):
3587         (WebCore::Layout::LineBreaker::textWidth const):
3588         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): Deleted.
3589         (WebCore::Layout::InlineLineBreaker::nextRun): Deleted.
3590         (WebCore::Layout::InlineLineBreaker::isAtContentEnd const): Deleted.
3591         (WebCore::Layout::InlineLineBreaker::lineBreakingBehavior): Deleted.
3592         (WebCore::Layout::InlineLineBreaker::runWidth const): Deleted.
3593         (WebCore::Layout::InlineLineBreaker::textWidth const): Deleted.
3594         (WebCore::Layout::InlineLineBreaker::splitRun): Deleted.
3595         (WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const): Deleted.
3596         * layout/inlineformatting/InlineLineBreaker.h:
3597         * layout/inlineformatting/InlineRunProvider.cpp: Removed.
3598         * layout/inlineformatting/InlineRunProvider.h: Removed.
3599         * layout/inlineformatting/InlineTextItem.cpp: Added.
3600         (WebCore::Layout::isWhitespaceCharacter):
3601         (WebCore::Layout::isSoftLineBreak):
3602         (WebCore::Layout::moveToNextNonWhitespacePosition):
3603         (WebCore::Layout::moveToNextBreakablePosition):
3604         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
3605         (WebCore::Layout::InlineTextItem::InlineTextItem):
3606         * layout/inlineformatting/InlineTextItem.h: Copied from Source/WebCore/layout/inlineformatting/text/TextUtil.h.
3607         (WebCore::Layout::InlineTextItem::start const):
3608         (WebCore::Layout::InlineTextItem::end const):
3609         (WebCore::Layout::InlineTextItem::length const):
3610         (WebCore::Layout::InlineTextItem::isWhitespace const):
3611         (WebCore::Layout::InlineTextItem::isCollapsed const):
3612         * layout/inlineformatting/text/TextUtil.cpp:
3613         (WebCore::Layout::TextUtil::hyphenPositionBefore):
3614         (WebCore::Layout::TextUtil::width):
3615         (WebCore::Layout::TextUtil::fixedPitchWidth):
3616         * layout/inlineformatting/text/TextUtil.h:
3617         * layout/layouttree/LayoutBox.h:
3618         * layout/layouttree/LayoutReplaced.cpp:
3619         (WebCore::Layout::Replaced::intrinsicRatio const):
3620         * layout/layouttree/LayoutTreeBuilder.cpp:
3621         (WebCore::Layout::accumulatedOffsetForInFlowPositionedContinuation):
3622         (WebCore::Layout::TreeBuilder::createSubTree):
3623         (WebCore::Layout::outputInlineRuns):
3624         (WebCore::Layout::outputLayoutBox):
3625
3626 2019-05-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3627
3628         [iOS] Respect -[NSItemProvider preferredPresentationSize] when dropping images
3629         https://bugs.webkit.org/show_bug.cgi?id=198242
3630
3631         Reviewed by Beth Dakin.
3632
3633         Teach the web content reader to respect the -preferredPresentationSize when creating attachment-backed image
3634         elements. See below for more details.
3635
3636         Test: WKAttachmentTestsIOS.InsertDroppedImageWithPreferredPresentationSize
3637
3638         * editing/WebContentReader.h:
3639         * editing/cocoa/WebContentReaderCocoa.mm:
3640         (WebCore::attachmentForFilePath):
3641         (WebCore::attachmentForData):
3642
3643         When creating attachment-backed image elements, additionally set width and height attributes from the preferred
3644         presentation size, if specified.
3645
3646         (WebCore::WebContentReader::readFilePath):
3647
3648         Add a version of readFilePath that takes a single file path, and an optional preferred presentation size.
3649
3650         (WebCore::WebContentReader::readFilePaths):
3651
3652         Reimplement readFilePaths in terms of readFilePath.
3653
3654         (WebCore::WebContentReader::readDataBuffer):
3655
3656         Add more plumbing for preferredPresentationSize.
3657
3658         * platform/Pasteboard.h:
3659         (WebCore::PasteboardWebContentReader::readFilePath):
3660         (WebCore::PasteboardWebContentReader::readDataBuffer):
3661         * platform/ios/PasteboardIOS.mm:
3662         (WebCore::Pasteboard::read):
3663         (WebCore::Pasteboard::readRespectingUTIFidelities):
3664
3665         Forward PasteboardItemInfo's preferredPresentationSize to the web content reader.
3666
3667 2019-05-25  Antoine Quint  <graouts@apple.com>
3668
3669         Opt naver.com into simulated mouse events quirk on iOS
3670         https://bugs.webkit.org/show_bug.cgi?id=198248
3671         <rdar://problem/50598281>
3672
3673         Reviewed by Brent Fulgham.
3674
3675         * page/Quirks.cpp:
3676         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
3677
3678 2019-05-25  Youenn Fablet  <youenn@apple.com>
3679
3680         media/video-remote-control-playpause.html is timing out after r245712
3681         https://bugs.webkit.org/show_bug.cgi?id=198238
3682
3683         Reviewed by Eric Carlson.
3684
3685         Fix regression introduced in r245712.
3686         Covered by test no longer timing out.
3687
3688         * platform/audio/PlatformMediaSessionManager.cpp:
3689         (WebCore::PlatformMediaSessionManager::sessionWillEndPlaybac