Support accessibility for <figure> element on iOS.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-09-27  Andres Gonzalez  <andresg_22@apple.com>
2
3         Support accessibility for <figure> element on iOS.
4         https://bugs.webkit.org/show_bug.cgi?id=202272
5         <rdar://problem/54789907>
6
7         Reviewed by Chris Fleizach.
8
9         Test: accessibility/ios-simulator/figure-element.html
10
11         Added a role description for the <figure> element.
12         * accessibility/AccessibilityObject.cpp:
13         (WebCore::AccessibilityObject::roleDescription const):
14
15 2019-09-27  Zalan Bujtas  <zalan@apple.com>
16
17         [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
18         https://bugs.webkit.org/show_bug.cgi?id=202331
19         <rdar://problem/55629493>
20
21         Reviewed by Tim Horton.
22
23         Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
24         This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.
25
26         * page/Quirks.cpp:
27         (WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
28         * page/Quirks.h:
29
30 2019-09-27  Per Arne Vollan  <pvollan@apple.com>
31
32         [Win] Crash under FontCache::lastResortFallbackFont
33         https://bugs.webkit.org/show_bug.cgi?id=202325
34         <rdar://problem/47856730>
35
36         Reviewed by Brent Fulgham.
37
38         As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font  
39         on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.
40  
41         No new tests. I have not been able to reproduce this issue. 
42
43         * platform/graphics/win/FontCacheWin.cpp:
44         (WebCore::FontCache::lastResortFallbackFont):
45
46 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
47
48         Unreviewed, rolling out r250397.
49
50         caused failure on iOS 13
51
52         Reverted changeset:
53
54         "REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-
55         credential-create-success-u2f.https.html is failing"
56         https://bugs.webkit.org/show_bug.cgi?id=201620
57         https://trac.webkit.org/changeset/250397
58
59 2019-09-27  Jer Noble  <jer.noble@apple.com>
60
61         [iOS] Vimeo fails to AirPlay in desktop mode
62         https://bugs.webkit.org/show_bug.cgi?id=202322
63
64         Reviewed by Eric Carlson.
65
66         Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
67         second video element containing a HLS stream to correctly start AirPlaying when the
68         system route changes.
69
70         * html/HTMLMediaElement.cpp:
71         (WebCore::HTMLMediaElement::finishInitialization):
72         * page/Quirks.cpp:
73         (WebCore::Quirks::needsPreloadAutoQuirk const):
74         * page/Quirks.h:
75
76 2019-09-27  Zalan Bujtas  <zalan@apple.com>
77
78         [LFC][IFC] Line::close should merge the text runs.
79         https://bugs.webkit.org/show_bug.cgi?id=202319
80         <rdar://problem/55785949>
81
82         Reviewed by Antti Koivisto.
83
84         Now Line::close returns the final Display::Run list.
85
86         * layout/displaytree/DisplayRect.h:
87         (WebCore::Display::Rect::expandHorizontally):
88         (WebCore::Display::Rect::expandVertically):
89         (WebCore::Display::Rect::expand):
90         * layout/displaytree/DisplayRun.h:
91         (WebCore::Display::Run::expandVertically):
92         (WebCore::Display::Run::expandHorizontally):
93         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
94         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
95         * layout/inlineformatting/InlineLine.cpp:
96         (WebCore::Layout::Line::close):
97         * layout/inlineformatting/InlineLine.h:
98         (WebCore::Layout::Line::Run::displayRun):
99
100 2019-09-27  Chris Dumez  <cdumez@apple.com>
101
102         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
103         https://bugs.webkit.org/show_bug.cgi?id=202314
104         <rdar://problem/55783482>
105
106         Reviewed by Alex Christensen.
107
108         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
109         This was preventing all pages on Facebook.com to enter the back/forward cache.
110
111         No new tests, updated existing test.
112
113         * history/PageCache.cpp:
114         (WebCore::canCacheFrame):
115
116 2019-09-27  Devin Rousso  <drousso@apple.com>
117
118         Flaky Test: inspector/canvas/updateShader.html
119         https://bugs.webkit.org/show_bug.cgi?id=202186
120         <rdar://problem/55716053>
121
122         Reviewed by Joseph Pecoraro.
123
124         If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*`
125         that was provided in the constructor won't be invalidated leading to the bad access crash.
126
127         Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from
128         `ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector)
129         when the related context is about to be destroyed.
130
131         Test: inspector/canvas/updateShader.html
132
133         * html/canvas/WebGLProgram.h:
134         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
135         * html/canvas/WebGLProgram.cpp:
136         (WebCore::WebGLProgram::WebGLProgram):
137         (WebCore::WebGLProgram::contextDestroyed): Added.
138
139 2019-09-27  Zalan Bujtas  <zalan@apple.com>
140
141         [LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
142         https://bugs.webkit.org/show_bug.cgi?id=202313
143         <rdar://problem/55782430>
144
145         Reviewed by Antti Koivisto.
146
147         Display::Run is a container for logical rect and text context. Let's replace Line::Run's logical rect/text context with Display::Run.
148
149         * layout/Verification.cpp:
150         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
151         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
152         * layout/displaytree/DisplayRun.h:
153         (WebCore::Display::Run::logicalRect const):
154         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
155         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
156         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
157         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
158         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
159         * layout/inlineformatting/InlineFormattingState.h:
160         (WebCore::Layout::InlineFormattingState::addInlineRun):
161         * layout/inlineformatting/InlineLine.cpp:
162         (WebCore::Layout::Line::Run::Run):
163         (WebCore::Layout::Line::isVisuallyEmpty const):
164         (WebCore::Layout::Line::appendNonBreakableSpace):
165         (WebCore::Layout::Line::appendTextContent):
166         (WebCore::Layout::Line::appendNonReplacedInlineBox):
167         (WebCore::Layout::Line::appendHardLineBreak):
168         * layout/inlineformatting/InlineLine.h:
169         (WebCore::Layout::Line::Run::displayRun const):
170         (WebCore::Layout::Line::Run::logicalRect const):
171         (WebCore::Layout::Line::Run::adjustLogicalTop):
172         (WebCore::Layout::Line::Run::moveVertically):
173         (WebCore::Layout::Line::Run::moveHorizontally):
174         (WebCore::Layout::Line::Run::textContext const): Deleted.
175         * layout/layouttree/LayoutTreeBuilder.cpp:
176         (WebCore::Layout::outputInlineRuns):
177
178 2019-09-27  Truitt Savell  <tsavell@apple.com>
179
180         Unreviewed, rolling out r250415.
181
182         Broke iOS debug testing with 50 crashes and 850 API failure
183
184         Reverted changeset:
185
186         "ScrollingTreeScrollingNode: use LayerRepresentation for
187         scroll container, scrolled contents layers"
188         https://bugs.webkit.org/show_bug.cgi?id=202256
189         https://trac.webkit.org/changeset/250415
190
191 2019-09-27  Alex Christensen  <achristensen@webkit.org>
192
193         Move service worker process termination delay disabling from process pool to website data store
194         https://bugs.webkit.org/show_bug.cgi?id=202308
195
196         Reviewed by Chris Dumez.
197
198         * workers/service/server/SWServer.cpp:
199         (WebCore::SWServer::SWServer):
200         (WebCore::SWServer::unregisterServiceWorkerClient):
201         * workers/service/server/SWServer.h:
202         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay): Deleted.
203
204 2019-09-27  Chris Dumez  <cdumez@apple.com>
205
206         IDBRequest should not prevent a page from entering the back/forward cache
207         https://bugs.webkit.org/show_bug.cgi?id=202270
208         <rdar://problem/55744717>
209
210         Reviewed by Youenn Fablet.
211
212         Update IDBRequest::canSuspendForDocumentSuspension() to return true instead of
213         false. IDBRequest can only fire 2 events (error / success) and for both its
214         merely enqueues the Event to the DocumentEventQueue. The DocumentEventQueue
215         uses a SuspendableTimer (which will be suspended while the document is in the
216         page cache) so there is no risk of firing the events (and thus running script)
217         while in the page cache.
218
219         Test: storage/indexeddb/IDBRequest-page-cache.html
220
221         * Modules/indexeddb/IDBRequest.cpp:
222         (WebCore::IDBRequest::canSuspendForDocumentSuspension const):
223
224 2019-09-27  Zalan Bujtas  <zalan@apple.com>
225
226         [LFC][IFC] Remove redundant Line::TextContext member variables
227         https://bugs.webkit.org/show_bug.cgi?id=202300
228         <rdar://problem/55769916>
229
230         Reviewed by Antti Koivisto.
231
232         This is in preparation for using Display::Run in Line::Run instead of Display::Rect + TextContext.
233
234         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
235         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
236         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
237         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
238         * layout/inlineformatting/InlineLine.cpp:
239         (WebCore::Layout::Line::Run::isWhitespace const):
240         (WebCore::Layout::Line::Run::canBeExtended const):
241         (WebCore::Layout::Line::isVisuallyEmpty const):
242         (WebCore::Layout::Line::removeTrailingTrimmableContent):
243         (WebCore::Layout::Line::trailingTrimmableWidth const):
244         (WebCore::Layout::Line::appendTextContent):
245         * layout/inlineformatting/InlineLine.h:
246         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
247         (WebCore::Layout::Line::Run::setVisuallyIsEmpty):
248         (WebCore::Layout::Line::Run::setTextIsCollapsed): Deleted.
249
250 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
251
252         [Nicosia] Implement frame scrolling functionality
253         https://bugs.webkit.org/show_bug.cgi?id=202201
254
255         Reviewed by Carlos Garcia Campos.
256
257         Implement logic in the ScrollingTreeFrameScrollingNodeNicosia class,
258         largely following the Mac port's implementation but skipping areas we
259         don't support or can keep simple, like CSS scroll snap, frame pinning
260         and more complex wheel event handling through the platform-specific
261         delegate behavior.
262
263         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
264         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
265         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
266         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
267         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition const):
268         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
269         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
270         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers):
271         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
272
273 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
274
275         [Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
276         https://bugs.webkit.org/show_bug.cgi?id=202275
277
278         Reviewed by Carlos Garcia Campos.
279
280         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
281         (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
282         Handle wheel events that get rerouted through the main thread,
283         dispatching them back to the scrolling thread so that they end up
284         performing the desired scroll if possible.
285
286 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
287
288         [CoordinatedGraphics] support bounds origin
289         https://bugs.webkit.org/show_bug.cgi?id=198998
290
291         Reviewed by Carlos Garcia Campos.
292
293         Add bounds-origin support to the CoordinatedGraphics stack. Currently we
294         take the short-cut implementation of just combining the bounds origin
295         and the position value and incorporating them into the layer transform
296         we calculate in TextureMapperLayer.
297
298         Additional boilerplate code is added, as required, to relay the
299         WebCore::GraphicsLayer change of bounds origin to the rendering system.
300
301         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
302         (Nicosia::CompositionLayer::flushState):
303         * platform/graphics/texmap/TextureMapperLayer.cpp:
304         (WebCore::TextureMapperLayer::computeTransformsRecursive):
305         (WebCore::TextureMapperLayer::setBoundsOrigin):
306         * platform/graphics/texmap/TextureMapperLayer.h:
307         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
308         (WebCore::CoordinatedGraphicsLayer::setBoundsOrigin):
309         (WebCore::CoordinatedGraphicsLayer::computePositionRelativeToBase):
310         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
311
312 2019-09-26  Zan Dobersek  <zdobersek@igalia.com>
313
314         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
315         https://bugs.webkit.org/show_bug.cgi?id=202256
316
317         Reviewed by Simon Fraser.
318
319         Make the scroll container and scrolled contents layer holders
320         platform-independent by using the LayerRepresentation as the underlying
321         type for the two member variables in ScrollingTreeScrollingNode.
322
323         * page/scrolling/ScrollingTreeScrollingNode.cpp:
324         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
325         * page/scrolling/ScrollingTreeScrollingNode.h:
326         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
327         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
328         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
329         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
330
331 2019-09-26  Chris Dumez  <cdumez@apple.com>
332
333         Pages frequently fails to enter the back/forward cache due to pending loads
334         https://bugs.webkit.org/show_bug.cgi?id=202289
335         <rdar://problem/55758506>
336
337         Reviewed by Geoffrey Garen.
338
339         Allow pages to enter the back / forward cache, even if they have pending loads.
340         Note that these pending loads get cancelled. Also note that we won't enter page
341         cache unless the 'load' event has been fired in the main frame, since a
342         HistoryItem would not get created otherwise. This was causing frequent transient
343         failures to enter the back / forward cache while browsing (e.g. on weather.com).
344
345         Test: http/tests/navigation/page-cache-pending-load.html
346
347         * history/PageCache.cpp:
348         (WebCore::canCacheFrame):
349         * loader/CrossOriginPreflightChecker.cpp:
350         * loader/CrossOriginPreflightChecker.h:
351         * loader/DocumentLoader.cpp:
352         (WebCore::DocumentLoader::setMainDocumentError):
353         (WebCore::DocumentLoader::stopLoading):
354         * loader/DocumentLoader.h:
355         * loader/DocumentThreadableLoader.cpp:
356         * loader/DocumentThreadableLoader.h:
357         * loader/cache/CachedResource.cpp:
358         * loader/cache/CachedResource.h:
359         * loader/cache/CachedResourceClient.h:
360         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
361         * page/DiagnosticLoggingKeys.cpp:
362         (WebCore::DiagnosticLoggingKeys::mainFrameHasNotFinishedLoadingKey):
363         * page/DiagnosticLoggingKeys.h:
364
365 2019-09-26  Zalan Bujtas  <zalan@apple.com>
366
367         [LFC][IFC] Line::Run should have a reference to the associated InlineItem
368         https://bugs.webkit.org/show_bug.cgi?id=202288
369         <rdar://problem/55758112>
370
371         Reviewed by Antti Koivisto.
372
373         It makes it clearer where the type and the layout box come from.
374
375         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
376         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
377         * layout/inlineformatting/InlineLine.cpp:
378         (WebCore::Layout::Line::Run::Run):
379         * layout/inlineformatting/InlineLine.h:
380         (WebCore::Layout::Line::Run::layoutBox const):
381         (WebCore::Layout::Line::Run::textContext const):
382         (WebCore::Layout::Line::Run::isText const):
383         (WebCore::Layout::Line::Run::isBox const):
384         (WebCore::Layout::Line::Run::isLineBreak const):
385         (WebCore::Layout::Line::Run::isContainerStart const):
386         (WebCore::Layout::Line::Run::isContainerEnd const):
387         (WebCore::Layout::Line::Run::type const): Deleted.
388
389 2019-09-26  Zalan Bujtas  <zalan@apple.com>
390
391         [LFC][IFC] Remove redundant Line::Content
392         https://bugs.webkit.org/show_bug.cgi?id=202284
393         <rdar://problem/55757187>
394
395         Reviewed by Antti Koivisto.
396
397         Line::Content is really just a list or runs at this point.
398
399         * layout/inlineformatting/InlineFormattingContext.h:
400         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
401         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
402         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
403         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
404         * layout/inlineformatting/InlineLine.cpp:
405         (WebCore::Layout::Line::Run::Run):
406         (WebCore::Layout::Line::Line):
407         (WebCore::Layout::Line::isVisuallyEmpty const):
408         (WebCore::Layout::Line::close):
409         (WebCore::Layout::Line::appendNonBreakableSpace):
410         (WebCore::Layout::Line::appendTextContent):
411         (WebCore::Layout::Line::appendNonReplacedInlineBox):
412         (WebCore::Layout::Line::appendHardLineBreak):
413         (WebCore::Layout::Line::Content::Run::Run): Deleted.
414         * layout/inlineformatting/InlineLine.h:
415         (WebCore::Layout::Line::Run::layoutBox const):
416         (WebCore::Layout::Line::Run::logicalRect const):
417         (WebCore::Layout::Line::Run::textContext const):
418         (WebCore::Layout::Line::Run::type const):
419         (WebCore::Layout::Line::Run::isText const):
420         (WebCore::Layout::Line::Run::isBox const):
421         (WebCore::Layout::Line::Run::isLineBreak const):
422         (WebCore::Layout::Line::Run::isContainerStart const):
423         (WebCore::Layout::Line::Run::isContainerEnd const):
424         (WebCore::Layout::Line::Run::adjustLogicalTop):
425         (WebCore::Layout::Line::Run::moveVertically):
426         (WebCore::Layout::Line::Run::moveHorizontally):
427         (WebCore::Layout::Line::Run::setTextIsCollapsed):
428         (WebCore::Layout::Line::Content::Run::layoutBox const): Deleted.
429         (WebCore::Layout::Line::Content::Run::logicalRect const): Deleted.
430         (WebCore::Layout::Line::Content::Run::textContext const): Deleted.
431         (WebCore::Layout::Line::Content::Run::type const): Deleted.
432         (WebCore::Layout::Line::Content::Run::isText const): Deleted.
433         (WebCore::Layout::Line::Content::Run::isBox const): Deleted.
434         (WebCore::Layout::Line::Content::Run::isLineBreak const): Deleted.
435         (WebCore::Layout::Line::Content::Run::isContainerStart const): Deleted.
436         (WebCore::Layout::Line::Content::Run::isContainerEnd const): Deleted.
437         (WebCore::Layout::Line::Content::Run::adjustLogicalTop): Deleted.
438         (WebCore::Layout::Line::Content::Run::moveVertically): Deleted.
439         (WebCore::Layout::Line::Content::Run::moveHorizontally): Deleted.
440         (WebCore::Layout::Line::Content::Run::setTextIsCollapsed): Deleted.
441         (WebCore::Layout::Line::Content::runs const): Deleted.
442         (WebCore::Layout::Line::Content::runs): Deleted.
443
444 2019-09-26  Zalan Bujtas  <zalan@apple.com>
445
446         [LFC][IFC] Move Line::Content::m_lineBox to Line.
447         https://bugs.webkit.org/show_bug.cgi?id=202280
448         <rdar://problem/55755798>
449
450         Reviewed by Antti Koivisto.
451
452         This is in preparation for Line producing Display::Runs instead of Line::Runs.
453
454         * layout/inlineformatting/InlineFormattingContext.h:
455         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
456         (WebCore::Layout::LineLayout::close):
457         (WebCore::Layout::LineLayout::placeInlineItem):
458         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
459         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
460         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
461         * layout/inlineformatting/InlineLine.cpp:
462         (WebCore::Layout::Line::Line):
463         (WebCore::Layout::Line::close):
464         (WebCore::Layout::Line::removeTrailingTrimmableContent):
465         (WebCore::Layout::Line::moveLogicalLeft):
466         (WebCore::Layout::Line::appendNonBreakableSpace):
467         (WebCore::Layout::Line::appendTextContent):
468         (WebCore::Layout::Line::appendNonReplacedInlineBox):
469         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
470         * layout/inlineformatting/InlineLine.h:
471         (WebCore::Layout::Line::Content::runs const):
472         (WebCore::Layout::Line::availableWidth const):
473         (WebCore::Layout::Line::lineBox const):
474         (WebCore::Layout::Line::logicalTop const):
475         (WebCore::Layout::Line::logicalBottom const):
476         (WebCore::Layout::Line::logicalLeft const):
477         (WebCore::Layout::Line::logicalHeight const):
478         (WebCore::Layout::Line::contentLogicalWidth const):
479         (WebCore::Layout::Line::contentLogicalRight const):
480         (WebCore::Layout::Line::baselineOffset const):
481         (WebCore::Layout::Line::Content::lineBox const): Deleted.
482         (WebCore::Layout::Line::Content::lineBox): Deleted.
483         (WebCore::Layout::Line::Content::setLineBox): Deleted.
484
485 2019-09-26  Jiewen Tan  <jiewen_tan@apple.com>
486
487         REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
488         https://bugs.webkit.org/show_bug.cgi?id=201620
489
490         Unreviewed, roll back part of r249737 to confirm the cause.
491
492         * Modules/webauthn/fido/U2fResponseConverter.cpp:
493         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
494
495 2019-09-26  Truitt Savell  <tsavell@apple.com>
496
497         Unreviewed, rolling out r250385.
498
499         Broke imported/w3c/web-platform-tests/svg/animations/syncbase-
500         remove-add-while-running.html on all platforms. Which was
501         caught by EWS
502
503         Reverted changeset:
504
505         "Non-callable "handleEvent" property is silently ignored"
506         https://bugs.webkit.org/show_bug.cgi?id=200066
507         https://trac.webkit.org/changeset/250385
508
509 2019-09-26  Kate Cheney  <katherine_cheney@apple.com>
510
511         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
512         https://bugs.webkit.org/show_bug.cgi?id=195420
513         <rdar://problem/54213551> 
514
515         Reviewed by Brent Fulgham.
516
517         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html
518                http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
519                http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
520                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
521                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
522                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
523                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
524                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
525                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
526                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
527                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
528                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
529                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
530                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
531                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
532                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
533                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
534                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
535                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
536                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
537                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
538                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
539                http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
540                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
541                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
542                http/tests/resourceLoadStatistics/cookie-deletion-database.html
543                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
544                http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
545                http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
546                http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
547                http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
548                http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
549                http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
550                http/tests/resourceLoadStatistics/enable-debug-mode-database.html
551                http/tests/resourceLoadStatistics/grandfathering-database.html
552                http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
553                http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
554                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
555                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
556                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
557                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
558                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
559                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
560                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
561                http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
562                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
563                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
564                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
565                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
566                http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
567                http/tests/resourceLoadStatistics/prune-statistics-database.html
568                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
569                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
570                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
571                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
572                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
573                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
574                http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
575                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
576                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
577                http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
578                http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
579                http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
580                http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html
581
582         * platform/sql/SQLiteDatabase.h:
583         Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database 
584         to clear out the database.
585
586 2019-09-26  Antti Koivisto  <antti@apple.com>
587
588         Use LineLayoutTraversal for RenderText functions
589         https://bugs.webkit.org/show_bug.cgi?id=202266
590
591         Reviewed by Zalan Bujtas.
592
593         Replace a bunch of functions that have separate simple and complex line layout versions with
594         shared functions that use LineLayoutTraversal.
595
596         * rendering/RenderText.cpp:
597         (WebCore::RenderText::absoluteRects const):
598         (WebCore::RenderText::firstRunLocation const):
599         (WebCore::RenderText::linesBoundingBox const):
600
601         This is substantially simpler than RenderTextLineBoxes::boundingBox because it uses physical rects for all computations
602         instead of using logical rects and flipping to physical at the end.
603
604         (WebCore::RenderText::caretMinOffset const):
605         (WebCore::RenderText::caretMaxOffset const):
606         (WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
607         (WebCore::containsOffset):
608         (WebCore::RenderText::containsRenderedCharacterOffset const):
609         (WebCore::RenderText::containsCaretOffset const):
610         (WebCore::RenderText::hasRenderedText const):
611         * rendering/RenderTextLineBoxes.cpp:
612         (WebCore::RenderTextLineBoxes::boundingBox const): Deleted.
613         (WebCore::RenderTextLineBoxes::firstRunLocation const): Deleted.
614         (WebCore::RenderTextLineBoxes::hasRenderedText const): Deleted.
615         (WebCore::RenderTextLineBoxes::caretMinOffset const): Deleted.
616         (WebCore::RenderTextLineBoxes::caretMaxOffset const): Deleted.
617         (WebCore::RenderTextLineBoxes::containsOffset const): Deleted.
618         (WebCore::RenderTextLineBoxes::countCharacterOffsetsUntil const): Deleted.
619         (WebCore::RenderTextLineBoxes::absoluteRects const): Deleted.
620         * rendering/RenderTreeAsText.cpp:
621         (WebCore::write):
622         * rendering/SimpleLineLayout.cpp:
623         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
624         * rendering/SimpleLineLayout.h:
625         (WebCore::SimpleLineLayout::Run::Run):
626         * rendering/SimpleLineLayoutFunctions.cpp:
627         (WebCore::SimpleLineLayout::computeFirstRunLocation): Deleted.
628         * rendering/SimpleLineLayoutFunctions.h:
629         (WebCore::SimpleLineLayout::findCaretMinimumOffset): Deleted.
630         (WebCore::SimpleLineLayout::findCaretMaximumOffset): Deleted.
631         (WebCore::SimpleLineLayout::containsOffset): Deleted.
632         (WebCore::SimpleLineLayout::isTextRendered): Deleted.
633         * rendering/SimpleLineLayoutResolver.h:
634         (WebCore::SimpleLineLayout::RunResolver::Run::isLineBreak const):
635         * rendering/line/LineLayoutTraversal.cpp:
636         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const):
637         (WebCore::LineLayoutTraversal::firstTextBoxFor):
638         (WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
639         (WebCore::LineLayoutTraversal::textBoxesFor):
640         (WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor): Deleted.
641         (WebCore::LineLayoutTraversal::textBoxRangeFor): Deleted.
642         * rendering/line/LineLayoutTraversal.h:
643         (WebCore::LineLayoutTraversal::hasTextBoxes):
644
645 2019-09-26  Truitt Savell  <tsavell@apple.com>
646
647         Unreviewed, rolling out r250381.
648
649         broke multiple webgpu/ tests on Mojave WK2
650
651         Reverted changeset:
652
653         "Flaky Test: inspector/canvas/updateShader.html"
654         https://bugs.webkit.org/show_bug.cgi?id=202186
655         https://trac.webkit.org/changeset/250381
656
657 2019-09-26  Alexey Shvayka  <shvaikalesh@gmail.com>
658
659         Non-callable "handleEvent" property is silently ignored
660         https://bugs.webkit.org/show_bug.cgi?id=200066
661
662         Reviewed by Darin Adler.
663
664         Tests: imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
665                imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
666                imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
667                imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
668
669         * bindings/js/JSEventListener.cpp:
670         (WebCore::JSEventListener::handleEvent): Report TypeError if "handleEvent" is not callable.
671
672 2019-09-26  Zalan Bujtas  <zalan@apple.com>
673
674         [LFC][IFC] Decouple Display::Run and Display::Box initializations.
675         https://bugs.webkit.org/show_bug.cgi?id=202255
676         <rdar://problem/55731445>
677
678         Reviewed by Antti Koivisto.
679
680         This is in preparation for moving Display::Run initialization to Line class.
681
682         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
683         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
684
685 2019-09-26  Devin Rousso  <drousso@apple.com>
686
687         Flaky Test: inspector/canvas/updateShader.html
688         https://bugs.webkit.org/show_bug.cgi?id=202186
689         <rdar://problem/55716053>
690
691         Reviewed by Joseph Pecoraro.
692
693         If the `WebGPUPipeline`/`WebGLProgram` outlives it's `WebGPUDevice`/`WebGLRenderingContext`,
694         the `ScriptExecutionContext*` that was provided in the constructor won't be invalidated
695         leading to the bad access crash.
696
697         Rather than pass the `ScriptExecutionContext*` directly, have `WebGPUPipeline`/`WebGLProgram`
698         extend from `ContextDestructionObserver` so that it can propertly invalidate (and notify Web
699         Inspector) when the related context is about to be destroyed.
700
701         Test: inspector/canvas/updateShader.html
702
703         * Modules/webgpu/WebGPUPipeline.h:
704         (WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.
705         * Modules/webgpu/WebGPUPipeline.cpp:
706         (WebCore::WebGPUPipeline::WebGPUPipeline):
707         (WebCore::WebGPUPipeline::contextDestroyed): Added.
708
709         * html/canvas/WebGLProgram.h:
710         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
711         * html/canvas/WebGLProgram.cpp:
712         (WebCore::WebGLProgram::WebGLProgram):
713         (WebCore::WebGLProgram::contextDestroyed): Added.
714
715 2019-09-25  Chris Dumez  <cdumez@apple.com>
716
717         Add very basic PageCache support for RTCPeerConnection
718         https://bugs.webkit.org/show_bug.cgi?id=202244
719
720         Reviewed by Geoffrey Garen.
721
722         RTCPeerConnection::canSuspendForDocumentSuspension() returns true if
723         RTCPeerConnection::hasPendingActivity() return false. Previously, hasPendingActivity()
724         would return true unless the JS has called close() on the RTCPeerConnection
725         object.
726
727         On weather.com, an ad would construct an RTCPeerConnection just to do some feature
728         checking and then let the variable go out of scope (without calling close()). Because
729         of the previous implementation of RTCPeerConnection::hasPendingActivity(), this wrapper
730         and its implementation object would stay alive forever AND prevent the page from
731         entering PageCache on navigation.
732
733         To improve this, the implementation of hadPendingActivity() has been updated so that
734         it keeps returning false if close() has been called, but will also return false if
735         there are no pending Promises to be resolved and no event listeners.
736
737         Test: fast/mediastream/RTCPeerConnection-page-cache.html
738
739         * Modules/mediastream/RTCPeerConnection.cpp:
740         WebCore::RTCPeerConnection::RTCPeerConnection:
741         Stop taking a pending activity in the constructor, this would be NOT keep the wrapper
742         alive since RTCPeerConnection::hasPendingActivity() was not checking
743         ActiveDOMObject::hasPendingActivity().
744
745         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
746         (WebCore::RTCPeerConnection::hasPendingActivity const):
747         
748         * Modules/mediastream/RTCPeerConnection.h:
749
750         * bindings/js/JSDOMPromiseDeferred.h:
751         (WebCore::DOMPromiseDeferredBase::whenSettled):
752
753 2019-09-25  Chris Dumez  <cdumez@apple.com>
754
755         Improve Service worker support for Page Caching
756         https://bugs.webkit.org/show_bug.cgi?id=202221
757
758         Reviewed by Geoffrey Garen.
759
760         Allow pages using service workers to enter the back / forward cache.
761         Update ServiceWorkerRegistration / ServiceWorker ActiveDOMObjects
762         to properly suspend while in PageCache. Also, let documents controlled
763         by a service worker to enter PageCache (we already unregistered it as
764         a client of the service worker while suspended).
765
766         Test: http/tests/workers/service/page-caching.html
767
768         * dom/Document.cpp:
769         (WebCore::Document::suspend):
770         (WebCore::Document::resume):
771         * history/PageCache.cpp:
772         (WebCore::canCacheFrame):
773         * workers/service/ServiceWorker.cpp:
774         (WebCore::ServiceWorker::updateState):
775         (WebCore::ServiceWorker::canSuspendForDocumentSuspension const):
776         (WebCore::ServiceWorker::suspend):
777         (WebCore::ServiceWorker::resume):
778         * workers/service/ServiceWorker.h:
779         * workers/service/ServiceWorkerRegistration.cpp:
780         (WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
781         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
782         (WebCore::ServiceWorkerRegistration::suspend):
783         (WebCore::ServiceWorkerRegistration::resume):
784         * workers/service/ServiceWorkerRegistration.h:
785
786 2019-09-25  Chris Dumez  <cdumez@apple.com>
787
788         [Cocoa] Regression(r212041) Safari adds a .dms extension automatically when downloading binaries with no extension
789         https://bugs.webkit.org/show_bug.cgi?id=202147
790         <rdar://problem/54886021>
791
792         Reviewed by Alexey Proskuryakov.
793
794         When getting a suggested filename without extension (either from Content-Disposition header or from the download
795         attribute), we determine a suitable file extension based on the Content-Type header and append it. This is useful
796         since a lot of operating systems (such as macOS) rely on the file extension to determine file type.
797
798         The issue is that if the Content-Type is not provided or when it is provided but is "application/octet-stream",
799         we would append a .dms extension, which was unexpected. This patch makes it so that we no longer try to append
800         an extension when the resolved content type is "application/octet-stream".
801
802         Tests: http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream.html
803                http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain.html
804                http/tests/security/anchor-download-octet-stream-no-extension.html
805
806         * platform/MIMETypeRegistry.cpp:
807         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
808
809 2019-09-25  Megan Gardner  <megan_gardner@apple.com>
810
811         Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
812         https://bugs.webkit.org/show_bug.cgi?id=202125
813
814         Reviewed by Tim Horton.
815
816         Test: editing/selection/ios/update-selection-after-iframe-scroll.html
817
818         When we end scrolling, make sure that iframes get a final update to ensure that the 
819         selection is in the correct position. Pipe that to WebKit/UIProcess via
820         frame specific plath.
821
822         * loader/EmptyClients.cpp:
823         * page/EditorClient.h:
824         * page/scrolling/AsyncScrollingCoordinator.cpp:
825         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
826
827 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
828
829         Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
830         https://bugs.webkit.org/show_bug.cgi?id=202224
831         <rdar://problem/52906640>
832
833         Reviewed by Tim Horton.
834
835         On some pages (e.g. usatoday.com), the content width of the page temporarily becomes very large during page
836         load. This causes a couple of viewport scaling behaviors (notably, the existing shrink-to-fit heuristic in
837         ViewportConfiguration::initialScaleFromSize, as well as the new iPad-specific content-aware shrink-to-fit
838         heuristic in WebPage::immediatelyShrinkToFitContent) to cause the page to shrink down excessively in an attempt
839         to fit all the content to the viewport. This causes a very ugly flash as the page appears zoomed out initially
840         during page load, before zooming back in.
841
842         To fix this, we add some sanity checks to these viewport scaling heuristics. In ViewportConfiguration's
843         initialScaleFromSize method, in the codepath where an initial scale is not specified, we always scale to fit the
844         contents of the page; instead, detect the case where the content width is enormous (with a threshold arbitrarily
845         chosen to be 1920) and fall back to the scaling to fit the viewport's width, if such a width has been explicitly
846         set. This ensures that we avoid excessive shrinking in the case where content is extremely wide, but also that
847         we do scale the viewport down to fit all the content in the case where the content isn't extremely wide (e.g. on
848         daringfireball.com).
849
850         See WebKit ChangeLog for more detail.
851
852         Test: fast/viewport/ios/shrink-to-fit-large-content-width.html
853
854         * page/ViewportConfiguration.cpp:
855         (WebCore::ViewportConfiguration::initialScaleFromSize const):
856
857 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
858
859         [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
860         https://bugs.webkit.org/show_bug.cgi?id=202167
861         <rdar://problem/55185021>
862
863         Reviewed by Tim Horton.
864
865         Adds a new site-specific quirk. See WebKit ChangeLog for more details.
866
867         * page/Quirks.cpp:
868         (WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const):
869         * page/Quirks.h:
870         * platform/RuntimeApplicationChecks.h:
871         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
872         (WebCore::IOSApplication::isDataActivation):
873
874 2019-09-25  Jonathan Bedard  <jbedard@apple.com>
875
876         Unreviewed, rolling out r250324.
877
878         Broke many mac wk2 layout tests
879
880         Reverted changeset:
881
882         "Enable LayoutTests using ResourceLoadStatistics SQLite
883         backend (195420)"
884         https://bugs.webkit.org/show_bug.cgi?id=195420
885         https://trac.webkit.org/changeset/250324
886
887 2019-09-25  Antti Koivisto  <antti@apple.com>
888
889         Rename LineLayoutInterface to LineLayoutTraversal
890         https://bugs.webkit.org/show_bug.cgi?id=202202
891
892         Reviewed by Zalan Bujtas.
893
894         Use a bit more informative namespace name.
895
896         * Headers.cmake:
897         * Sources.txt:
898         * WebCore.xcodeproj/project.pbxproj:
899         * dom/Position.cpp:
900         (WebCore::Position::upstream const):
901         (WebCore::Position::downstream const):
902         * editing/TextIterator.cpp:
903         (WebCore::TextIterator::handleTextNode):
904         (WebCore::TextIterator::handleTextBox):
905         (WebCore::TextIterator::handleTextNodeFirstLetter):
906         * editing/TextIterator.h:
907         * rendering/RenderTreeAsText.cpp:
908         (WebCore::RenderTreeAsText::writeRenderObject):
909         (WebCore::writeTextBox):
910         (WebCore::write):
911         * rendering/line/LineLayoutTraversal.cpp: Renamed from Source/WebCore/rendering/line/LineLayoutInterfaceTextBoxes.cpp.
912         (WebCore::LineLayoutTraversal::TextBox::rect const):
913         (WebCore::LineLayoutTraversal::TextBox::logicalRect const):
914         (WebCore::LineLayoutTraversal::TextBox::hasHyphen const):
915         (WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const):
916         (WebCore::LineLayoutTraversal::TextBox::dirOverride const):
917         (WebCore::LineLayoutTraversal::TextBox::text const):
918         (WebCore::LineLayoutTraversal::TextBox::localStartOffset const):
919         (WebCore::LineLayoutTraversal::TextBox::localEndOffset const):
920         (WebCore::LineLayoutTraversal::TextBox::length const):
921         (WebCore::LineLayoutTraversal::TextBox::isLastOnLine const):
922         (WebCore::LineLayoutTraversal::TextBox::isLast const):
923         (WebCore::LineLayoutTraversal::TextBox::iterator const):
924         (WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
925         (WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInVisualOrder):
926         (WebCore::LineLayoutTraversal::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const):
927         (WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInTextOrder):
928         (WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
929         (WebCore::LineLayoutTraversal::TextBoxIterator::atEnd const):
930         (WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor):
931         (WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
932         (WebCore::LineLayoutTraversal::textBoxRangeFor):
933         * rendering/line/LineLayoutTraversal.h: Renamed from Source/WebCore/rendering/line/LineLayoutInterfaceTextBoxes.h.
934         (WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
935         (WebCore::LineLayoutTraversal::TextBoxIterator::operator++):
936         (WebCore::LineLayoutTraversal::TextBoxIterator::operator bool const):
937         (WebCore::LineLayoutTraversal::TextBoxIterator::operator!= const):
938         (WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
939         (WebCore::LineLayoutTraversal::TextBoxIterator::operator* const):
940         (WebCore::LineLayoutTraversal::TextBoxIterator::operator-> const):
941         (WebCore::LineLayoutTraversal::TextBoxRange::TextBoxRange):
942         (WebCore::LineLayoutTraversal::TextBoxRange::begin const):
943         (WebCore::LineLayoutTraversal::TextBoxRange::end const):
944         (WebCore::LineLayoutTraversal::hasTextBoxes):
945
946 2019-09-25  Zalan Bujtas  <zalan@apple.com>
947
948         [LFC][IFC] Use existing Line::Content::LineBox to track the current line geometry
949         https://bugs.webkit.org/show_bug.cgi?id=202182
950
951         Reviewed by Antti Koivisto.
952
953         This patch removes the redundant Line::m_logicalTopLeft, m_contentLogicalWidth, m_lineLogicalHeight, m_baseline, m_baselineTop members
954         and switches over to Line::m_content's LineBox. 
955
956         * layout/displaytree/DisplayRect.h:
957         (WebCore::Display::Rect::Rect):
958         * layout/inlineformatting/InlineLine.cpp:
959         (WebCore::Layout::Line::Line):
960         (WebCore::Layout::Line::close):
961         (WebCore::Layout::Line::removeTrailingTrimmableContent):
962         (WebCore::Layout::Line::moveLogicalLeft):
963         (WebCore::Layout::Line::appendNonBreakableSpace):
964         (WebCore::Layout::Line::appendTextContent):
965         (WebCore::Layout::Line::appendNonReplacedInlineBox):
966         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
967         (WebCore::Layout::m_skipVerticalAligment): Deleted.
968         * layout/inlineformatting/InlineLine.h:
969         (WebCore::Layout::Line::Content::lineBox):
970         (WebCore::Layout::Line::contentLogicalRight const):
971         (WebCore::Layout::Line::logicalTop const):
972         (WebCore::Layout::Line::logicalBottom const):
973         (WebCore::Layout::Line::logicalLeft const):
974         (WebCore::Layout::Line::logicalHeight const):
975         (WebCore::Layout::Line::contentLogicalWidth const):
976         (WebCore::Layout::Line::baselineOffset const):
977         * layout/inlineformatting/InlineLineBox.h:
978         (WebCore::Layout::LineBox::setLogicalTopLeft):
979         (WebCore::Layout::LineBox::setLogicalHeight):
980         (WebCore::Layout::LineBox::setLogicalWidth):
981         (WebCore::Layout::LineBox::moveHorizontally):
982         (WebCore::Layout::LineBox::expandHorizontally):
983         (WebCore::Layout::LineBox::shrinkHorizontally):
984         (WebCore::Layout::LineBox::expandVertically):
985         (WebCore::Layout::LineBox::shrinkVertically):
986         (WebCore::Layout::LineBox::LineBox):
987         (WebCore::Layout::LineBox::setLogicalHeightIfGreater):
988         (WebCore::Layout::LineBox::setBaseline):
989         (WebCore::Layout::LineBox::baseline const):
990         (WebCore::Layout::LineBox::baseline):
991         (WebCore::Layout::LineBox::setBaselineOffset):
992         (WebCore::Layout::LineBox::Baseline::setAscentIfGreater):
993         (WebCore::Layout::LineBox::Baseline::setDescentIfGreater):
994
995 2019-09-25  Antti Koivisto  <antti@apple.com>
996
997         Rename InlineBox::nextLeafChild to nextLeafOnLine
998         https://bugs.webkit.org/show_bug.cgi?id=202197
999
1000         Reviewed by Zalan Bujtas.
1001
1002         The name is confusing as it never returns a child of the inline box it is called on.
1003         Rename it and other similar functions that traverse within a line.
1004
1005         * dom/Position.cpp:
1006         (WebCore::Position::getInlineBoxAndOffset const):
1007         * editing/RenderedPosition.cpp:
1008         (WebCore::RenderedPosition::RenderedPosition):
1009         (WebCore::RenderedPosition::previousLeafOnLine const):
1010         (WebCore::RenderedPosition::nextLeafOnLine const):
1011         (WebCore::RenderedPosition::isEquivalent const):
1012         (WebCore::RenderedPosition::bidiLevelOnLeft const):
1013         (WebCore::RenderedPosition::bidiLevelOnRight const):
1014         (WebCore::RenderedPosition::leftBoundaryOfBidiRun):
1015         (WebCore::RenderedPosition::rightBoundaryOfBidiRun):
1016         (WebCore::RenderedPosition::atLeftBoundaryOfBidiRun const):
1017         (WebCore::RenderedPosition::atRightBoundaryOfBidiRun const):
1018         (WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const):
1019         (WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const):
1020         (WebCore::RenderedPosition::prevLeafChild const): Deleted.
1021         (WebCore::RenderedPosition::nextLeafChild const): Deleted.
1022         * editing/RenderedPosition.h:
1023         (WebCore::RenderedPosition::RenderedPosition):
1024         * editing/VisiblePosition.cpp:
1025         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
1026         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
1027         * editing/VisibleUnits.cpp:
1028         (WebCore::startPositionForLine):
1029         (WebCore::endPositionForLine):
1030         (WebCore::previousLinePosition):
1031         (WebCore::nextLinePosition):
1032         * layout/Verification.cpp:
1033         (WebCore::Layout::collectFlowBoxSubtree):
1034         * rendering/ComplexLineLayout.cpp:
1035         (WebCore::ComplexLineLayout::updateRubyForJustifiedText):
1036         (WebCore::expansionBehaviorForInlineTextBox):
1037         (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment):
1038         (WebCore::ComplexLineLayout::layoutRunsAndFloats):
1039         * rendering/InlineBox.cpp:
1040         (WebCore::InlineBox::previousOnLineExists const):
1041         (WebCore::InlineBox::nextLeafOnLine const):
1042         (WebCore::InlineBox::previousLeafOnLine const):
1043         (WebCore::InlineBox::nextLeafOnLineIgnoringLineBreak const):
1044         (WebCore::InlineBox::previousLeafOnLineIgnoringLineBreak const):
1045         (WebCore::InlineBox::nextLeafChild const): Deleted.
1046         (WebCore::InlineBox::prevLeafChild const): Deleted.
1047         (WebCore::InlineBox::nextLeafChildIgnoringLineBreak const): Deleted.
1048         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak const): Deleted.
1049         * rendering/InlineBox.h:
1050         (WebCore::InlineBox::nextOnLine const):
1051         (WebCore::InlineBox::previousOnLine const):
1052         (WebCore::InlineBox::setNextOnLine):
1053         (WebCore::InlineBox::setPreviousOnLine):
1054         (WebCore::InlineBox::InlineBox):
1055         (WebCore::InlineBox::prevOnLine const): Deleted.
1056         (WebCore::InlineBox::setPrevOnLine): Deleted.
1057         * rendering/InlineFlowBox.cpp:
1058         (WebCore::InlineFlowBox::addToLine):
1059         (WebCore::InlineFlowBox::removeChild):
1060         (WebCore::InlineFlowBox::nodeAtPoint):
1061         (WebCore::InlineFlowBox::firstLeafDescendant const):
1062         (WebCore::InlineFlowBox::lastLeafDescendant const):
1063         (WebCore::InlineFlowBox::placeEllipsisBox):
1064         (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
1065         (WebCore::InlineFlowBox::checkConsistency const):
1066         (WebCore::InlineFlowBox::firstLeafChild const): Deleted.
1067         (WebCore::InlineFlowBox::lastLeafChild const): Deleted.
1068         * rendering/InlineFlowBox.h:
1069         * rendering/InlineTextBox.cpp:
1070         (WebCore::InlineTextBox::expansionBehavior const):
1071         * rendering/RenderBlockFlow.cpp:
1072         (WebCore::RenderBlockFlow::containsNonZeroBidiLevel const):
1073         (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
1074         * rendering/RenderCounter.cpp:
1075         (WebCore::RenderCounter::rendererRemovedFromTree):
1076         * rendering/RenderTextLineBoxes.cpp:
1077         (WebCore::lineDirectionPointFitsInBox):
1078         (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi):
1079         (WebCore::RenderTextLineBoxes::positionForPoint const):
1080         * rendering/RootInlineBox.cpp:
1081         (WebCore::RootInlineBox::isHyphenated const):
1082         (WebCore::RootInlineBox::lineSelectionGap):
1083         (WebCore::RootInlineBox::selectionState):
1084         (WebCore::RootInlineBox::firstSelectedBox):
1085         (WebCore::RootInlineBox::lastSelectedBox):
1086         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
1087         * rendering/svg/SVGRootInlineBox.cpp:
1088         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
1089         (WebCore::SVGRootInlineBox::nodeAtPoint):
1090
1091 2019-09-25  Zan Dobersek  <zdobersek@igalia.com>
1092
1093         [Nicosia] Add implementations for fixed, positioned, sticky ScrollingTreeNodes
1094         https://bugs.webkit.org/show_bug.cgi?id=202100
1095
1096         Reviewed by Carlos Garcia Campos.
1097
1098         Fill in the Nicosia implementations for the ScrollingTreeFixedNode,
1099         ScrollingTreePositionedNode and ScrollingTreeStickyNode classes.
1100
1101         The implementations in majority repeat what the Cocoa implementations
1102         do, with the main difference being the Nicosia-specific layer state
1103         application. Sharing more of this logic should be investigated in the
1104         future.
1105
1106         * PlatformPlayStation.cmake: Add ScrollingTreePositionedNode to build.
1107         * SourcesGTK.txt: Ditto.
1108         * SourcesWPE.txt: Ditto.
1109         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:
1110         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
1111         (WebCore::ScrollingTreeFixedNode::applyLayerPositions):
1112         (WebCore::ScrollingTreeFixedNode::dumpProperties const):
1113         * page/scrolling/nicosia/ScrollingTreeFixedNode.h:
1114         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp: Added.
1115         (WebCore::ScrollingTreePositionedNode::create):
1116         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
1117         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1118         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1119         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
1120         * page/scrolling/nicosia/ScrollingTreePositionedNode.h: Added.
1121         (WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const):
1122         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:
1123         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
1124         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
1125         (WebCore::ScrollingTreeStickyNode::dumpProperties const):
1126         (WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
1127         * page/scrolling/nicosia/ScrollingTreeStickyNode.h:
1128
1129 2019-09-24  Antoine Quint  <graouts@apple.com>
1130
1131         [Web Animations] Removing an element should only cancel its declarative animations
1132         https://bugs.webkit.org/show_bug.cgi?id=202165
1133
1134         Reviewed by Dean Jackson.
1135
1136         When an element is removed, an Animation created using the JS API should not be canceled.
1137         Only declarative animations should be.
1138
1139         * animation/AnimationTimeline.cpp:
1140         (WebCore::AnimationTimeline::elementWasRemoved):
1141
1142 2019-09-24  Alex Christensen  <achristensen@webkit.org>
1143
1144         Remove SchemeRegistry's list of URL schemes allowing local storage in private browsing, which is unused
1145         https://bugs.webkit.org/show_bug.cgi?id=202181
1146
1147         Reviewed by Geoffrey Garen.
1148
1149         The last use of the WebView SPI to set it is being removed in rdar://problem/55685383
1150         but it already does not do anything.  Let's remove it.
1151
1152         * platform/SchemeRegistry.cpp:
1153         (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing): Deleted.
1154         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing): Deleted.
1155         (WebCore::SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing): Deleted.
1156         * platform/SchemeRegistry.h:
1157
1158 2019-09-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1159
1160         Remove a content change observation quirk on united.com
1161         https://bugs.webkit.org/show_bug.cgi?id=202175
1162
1163         Reviewed by Tim Horton.
1164
1165         Remove a site-specific quirk that is no longer necessary.
1166
1167         * page/Quirks.cpp:
1168         (WebCore::Quirks::shouldIgnoreContentChange const): Deleted.
1169         * page/Quirks.h:
1170         * page/ios/ContentChangeObserver.cpp:
1171         (WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):
1172
1173 2019-09-24  Kate Cheney  <katherine_cheney@apple.com>
1174
1175         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
1176         https://bugs.webkit.org/show_bug.cgi?id=195420
1177         <rdar://problem/54213551> 
1178
1179         Reviewed by Brent Fulgham.
1180
1181         Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html
1182                http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
1183                http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
1184                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
1185                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
1186                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
1187                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
1188                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
1189                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
1190                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
1191                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
1192                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
1193                http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
1194                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
1195                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
1196                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
1197                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
1198                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
1199                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
1200                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
1201                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
1202                http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
1203                http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
1204                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
1205                http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
1206                http/tests/resourceLoadStatistics/cookie-deletion-database.html
1207                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
1208                http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
1209                http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
1210                http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
1211                http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
1212                http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
1213                http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
1214                http/tests/resourceLoadStatistics/enable-debug-mode-database.html
1215                http/tests/resourceLoadStatistics/grandfathering-database.html
1216                http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
1217                http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
1218                http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
1219                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1220                http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
1221                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1222                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
1223                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1224                http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
1225                http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
1226                http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
1227                http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
1228                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
1229                http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
1230                http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
1231                http/tests/resourceLoadStatistics/prune-statistics-database.html
1232                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1233                http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
1234                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1235                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
1236                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1237                http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
1238                http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
1239                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
1240                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
1241                http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
1242                http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
1243                http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
1244                http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html
1245
1246         * platform/sql/SQLiteDatabase.h:
1247         Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database 
1248         to clear out the database.
1249
1250 2019-09-24  Chris Dumez  <cdumez@apple.com>
1251
1252         Stop sampling PageCache-related AggD data
1253         https://bugs.webkit.org/show_bug.cgi?id=202161
1254
1255         Reviewed by Geoffrey Garen.
1256
1257         Stop sampling PageCache-related AggD data to make it more actionable.
1258
1259         * history/PageCache.cpp:
1260         (WebCore::logPageCacheFailureDiagnosticMessage):
1261         (WebCore::canCacheFrame):
1262         (WebCore::canCachePage):
1263
1264 2019-09-24  Sihui Liu  <sihui_liu@apple.com>
1265
1266         Stop refing UniqueIDBDatabaseTransaction in callbacks
1267         https://bugs.webkit.org/show_bug.cgi?id=202074
1268
1269         Reviewed by Youenn Fablet.
1270
1271         After quota check is introduced to IDB, callbacks that take the ref of UniqueIDBDatabaseTransaction will be 
1272         passed to StorageQuotaManager. This can make UniqueIDBDatabaseTransaction live longer than UniqueIDBDatabase.
1273
1274         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1275         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
1276         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
1277         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
1278         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
1279         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
1280         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
1281         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
1282         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
1283         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
1284         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
1285         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1286         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
1287         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
1288         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
1289         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
1290         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
1291         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1292         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
1293         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1294         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1295         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
1296         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
1297         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
1298         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
1299         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
1300         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
1301         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
1302         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
1303         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
1304         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
1305         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
1306         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
1307         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
1308         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
1309         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
1310         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
1311
1312 2019-09-24  Keith Rollin  <krollin@apple.com>
1313
1314         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
1315         https://bugs.webkit.org/show_bug.cgi?id=202119
1316         <rdar://problem/55638792>
1317
1318         Reviewed by Alex Christensen.
1319
1320         After refactoring and other code evolution, some platform checks have
1321         ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
1322         vice-versa). These can be converted into the equivalent
1323         PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
1324         check can be removed altogether (along with any "#else" branches).
1325
1326         No new tests -- no new or changed functionality.
1327
1328         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1329         (WebCore::subLocality):
1330         (WebCore::setSubLocality):
1331         (WebCore::subAdministrativeArea):
1332         (WebCore::setSubAdministrativeArea):
1333         * css/parser/CSSPropertyParser.cpp:
1334         (WebCore::isAppleLegacyCssValueKeyword):
1335         * html/HTMLMediaElement.cpp:
1336         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1337         * inspector/InspectorFrontendHost.cpp:
1338         (WebCore::InspectorFrontendHost::platform):
1339         * page/FrameView.cpp:
1340         (WebCore::FrameView::updateBackgroundRecursively):
1341         * platform/Timer.cpp:
1342         * platform/cocoa/NetworkExtensionContentFilter.mm:
1343         (WebCore::NetworkExtensionContentFilter::initialize):
1344         * platform/graphics/cg/GraphicsContextCG.cpp:
1345         (WebCore::displayP3ColorSpaceRef):
1346         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1347         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1348         * rendering/RenderLayerCompositor.cpp:
1349         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
1350
1351 2019-09-24  Antoine Quint  <graouts@apple.com>
1352
1353         [Web Animations] Unflake web-animations/timing-model/animations/updating-the-finished-state.html WPT test
1354         https://bugs.webkit.org/show_bug.cgi?id=181121
1355
1356         Reviewed by Dean Jackson.
1357
1358         When running the "update animations and send events" steps (https://drafts.csswg.org/web-animations/#update-animations-and-send-events)
1359         we assemble a list of animations to remove after updating their relevance based on the new timeline current time. However, we wouldn't
1360         account for the fact that we would *then* dispatch events which could update the timing properties of animations that had been marked
1361         for removal at this point.
1362
1363         In this specific WPT test, there were two individual tests that would rewind animations within a "finish" event handler and we would
1364         not consider the fact that they had been rewound. We now check a second time before removing an animation that it should indeed be
1365         removed.
1366
1367         * animation/DocumentTimeline.cpp:
1368         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
1369
1370 2019-09-24  Kate Cheney  <katherine_cheney@apple.com>
1371
1372         Mixed content blocking is bypassed for WebSockets in Workers (159726)
1373         https://bugs.webkit.org/show_bug.cgi?id=159726
1374         <rdar://problem/27326438>
1375
1376         Reviewed by Brady Eidson.
1377
1378         Tests: http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html
1379                http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html
1380                http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html
1381                http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html
1382         
1383         * Modules/websockets/WebSocket.cpp:
1384         (WebCore::WebSocket::connect):
1385         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1386         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
1387         * loader/MixedContentChecker.cpp:
1388         (WebCore::MixedContentChecker::checkForMixedContentInFrameTree):
1389         * loader/MixedContentChecker.h:
1390         Patch to block insecure WebSocket URL connection attempts by Workers
1391         on secure pages. If the URL is ws, and any embedding iframe has protocol
1392         https, and the context is a Worker, the connection should be blocked.
1393
1394         I was unable to write a test case to hit the case where a document
1395         does not have a frame and tries to communicate via a worker to
1396         connect to a WebSocket because after removing the subframe from its
1397         parent, the subframe is unable to perform a postMessage to a worker
1398         even in the same script execution to tell the worker to connect
1399         to a WebSocket.
1400
1401 2019-09-24  Zalan Bujtas  <zalan@apple.com>
1402
1403         [LFC][IFC] Line::Content should use LineBox
1404         https://bugs.webkit.org/show_bug.cgi?id=202128
1405         <rdar://problem/55649079>
1406
1407         Reviewed by Antti Koivisto.
1408
1409         Replace Line::Content's m_logicalRect, m_baseline and m_baselineOffset with LineBox.
1410
1411         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1412         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
1413         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1414         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
1415         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1416         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
1417         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
1418         * layout/inlineformatting/InlineLine.cpp:
1419         (WebCore::Layout::Line::close):
1420         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
1421         * layout/inlineformatting/InlineLine.h:
1422         (WebCore::Layout::Line::Content::lineBox const):
1423         (WebCore::Layout::Line::Content::setLineBox):
1424         (WebCore::Layout::Line::baselineOffset const):
1425         (WebCore::Layout::Line::Content::isEmpty const): Deleted.
1426         (WebCore::Layout::Line::Content::logicalTop const): Deleted.
1427         (WebCore::Layout::Line::Content::logicalLeft const): Deleted.
1428         (WebCore::Layout::Line::Content::logicalRight const): Deleted.
1429         (WebCore::Layout::Line::Content::logicalBottom const): Deleted.
1430         (WebCore::Layout::Line::Content::logicalWidth const): Deleted.
1431         (WebCore::Layout::Line::Content::logicalHeight const): Deleted.
1432         (WebCore::Layout::Line::Content::baseline const): Deleted.
1433         (WebCore::Layout::Line::Content::baselineOffset const): Deleted.
1434         (WebCore::Layout::Line::Content::setLogicalRect): Deleted.
1435         (WebCore::Layout::Line::Content::setBaseline): Deleted.
1436         (WebCore::Layout::Line::Content::setBaselineOffset): Deleted.
1437         * layout/inlineformatting/InlineLineBox.h:
1438         (WebCore::Layout::LineBox::Baseline::height const):
1439         (WebCore::Layout::LineBox::LineBox):
1440         (WebCore::Layout::LineBox::baselineOffset const):
1441         (WebCore::Layout::LineBox::Baseline::Baseline):
1442         (WebCore::Layout::LineBox::Baseline::setAscent):
1443         (WebCore::Layout::LineBox::Baseline::setDescent):
1444         (WebCore::Layout::LineBox::Baseline::reset):
1445         (WebCore::Layout::LineBox::Baseline::ascent const):
1446         (WebCore::Layout::LineBox::Baseline::descent const):
1447
1448 2019-09-24  Zalan Bujtas  <zalan@apple.com>
1449
1450         [LFC][IFC] Move line constraints computation to a dedicated function
1451         https://bugs.webkit.org/show_bug.cgi?id=202121
1452         <rdar://problem/55640742>
1453
1454         Reviewed by Antti Koivisto.
1455
1456         * layout/inlineformatting/InlineFormattingContext.h:
1457         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1458         (WebCore::Layout::LineLayout::LineLayout):
1459         (WebCore::Layout::LineLayout::close):
1460         (WebCore::Layout::LineLayout::placeInlineItem):
1461         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
1462         (WebCore::Layout::InlineFormattingContext::InlineLayout::initialConstraintsForLine):
1463         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1464         * layout/inlineformatting/InlineLine.h:
1465
1466 2019-09-24  Youenn Fablet  <youenn@apple.com>
1467
1468         AudioTrackPrivateMediaStreamCocoa does not need to manipulate the audio unit in play/pause methods
1469         https://bugs.webkit.org/show_bug.cgi?id=202097
1470         <rdar://problem/51548144>
1471
1472         Reviewed by Eric Carlson.
1473
1474         Instead of manipulating the audio unit in play/pause methods, it is more convenient to do so in audioSamplesAvailable.
1475         play/pause methods only update boolean values that audioSamplesAvailable will read.
1476         In particular, m_autoPlay and m_isPlaying are no longer modified in the audio thread.
1477
1478         Behavior was racy so difficult to reproduce.
1479
1480         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1481         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
1482         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
1483         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1484         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1485
1486 2019-09-23  Youenn Fablet  <youenn@apple.com>
1487
1488         Support sync-xhr feature policy
1489         https://bugs.webkit.org/show_bug.cgi?id=202098
1490
1491         Reviewed by Alex Christensen.
1492
1493         Add support for sync-xhr feature policy parsing.
1494         Use this feature policy to control use of sync XHR in documents
1495         as per https://xhr.spec.whatwg.org/#the-send()-method step 12.
1496
1497         Covered by updated test.
1498
1499         * html/FeaturePolicy.cpp:
1500         (WebCore::FeaturePolicy::parse):
1501         (WebCore::FeaturePolicy::allows const):
1502         * html/FeaturePolicy.h:
1503         * xml/XMLHttpRequest.cpp:
1504         (WebCore::isSyncXHRAllowedByFeaturePolicy):
1505         (WebCore::XMLHttpRequest::createRequest):
1506
1507 2019-09-23  Chris Dumez  <cdumez@apple.com>
1508
1509         Drop unnecessary SessionID.h header includes
1510         https://bugs.webkit.org/show_bug.cgi?id=202129
1511
1512         Reviewed by Alex Christensen.
1513
1514         * Modules/fetch/FetchBodyConsumer.h:
1515         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1516         * bindings/js/SerializedScriptValue.h:
1517         * dom/DataTransfer.h:
1518         * editing/WebCorePasteboardFileReader.h:
1519         * fileapi/FileReaderLoader.h:
1520         * fileapi/ThreadableBlobRegistry.h:
1521         * html/FileListCreator.h:
1522         * loader/CookieJar.h:
1523         * loader/EmptyFrameLoaderClient.h:
1524         * loader/FrameLoaderClient.h:
1525         * loader/LoaderStrategy.h:
1526         * page/CacheStorageProvider.h:
1527         * page/Frame.h:
1528         * page/PageGroup.h:
1529         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1530         * platform/network/CacheValidation.h:
1531         * platform/network/FormData.h:
1532         * platform/network/NetworkStorageSession.cpp:
1533         * platform/network/StorageSessionProvider.h:
1534         * workers/WorkerGlobalScopeProxy.h:
1535         * workers/service/ServiceWorkerContainer.h:
1536         * workers/service/ServiceWorkerProvider.h:
1537         * workers/service/server/RegistrationDatabase.h:
1538         * workers/service/server/SWServer.h:
1539         * workers/service/server/SWServerToContextConnection.h:
1540         * worklets/WorkletGlobalScope.h:
1541
1542 2019-09-23  Alex Christensen  <achristensen@webkit.org>
1543
1544         Fix WPT test html/browsers/offline/application-cache-api/api_swapcache_error.https.html
1545         https://bugs.webkit.org/show_bug.cgi?id=202056
1546         <rdar://problem/55523986>
1547
1548         Reviewed by Youenn Fablet.
1549
1550         The test makes sure we throw an exception when we are in an invalid state, which we should definitely do.
1551
1552         * loader/appcache/ApplicationCache.cpp:
1553         (WebCore::ApplicationCache::setGroup):
1554         (WebCore::ApplicationCache::setManifestResource):
1555         * loader/appcache/ApplicationCache.h:
1556         (WebCore::ApplicationCache::manifestResource const):
1557         (WebCore::ApplicationCache::group const):
1558         * loader/appcache/ApplicationCacheGroup.h:
1559         * loader/appcache/ApplicationCacheHost.cpp:
1560         (WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const):
1561         (WebCore::ApplicationCacheHost::failedLoadingMainResource):
1562         (WebCore::ApplicationCacheHost::setCandidateApplicationCacheGroup):
1563         (WebCore::ApplicationCacheHost::swapCache):
1564         * loader/appcache/ApplicationCacheHost.h:
1565         (WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const): Deleted.
1566         * loader/appcache/ApplicationCacheResource.h:
1567
1568 2019-09-23  Chris Dumez  <cdumez@apple.com>
1569
1570         PlugInClient::didStartFromOrigin() does not need a sessionID
1571         https://bugs.webkit.org/show_bug.cgi?id=202127
1572
1573         Reviewed by Geoffrey Garen.
1574
1575         * html/HTMLPlugInImageElement.cpp:
1576         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
1577         * page/PlugInClient.h:
1578
1579 2019-09-23  Devin Rousso  <drousso@apple.com>
1580
1581         Web Inspector: Canvas: show WebGPU shader pipelines
1582         https://bugs.webkit.org/show_bug.cgi?id=201675
1583         <rdar://problem/55543450>
1584
1585         Reviewed by Joseph Pecoraro.
1586
1587         Tests: inspector/canvas/requestShaderSource-webgpu.html
1588                inspector/canvas/shaderProgram-add-remove-webgpu.html
1589                inspector/canvas/updateShader-webgpu.html
1590
1591         Create common base classes for `WebGPUPipeline` and `GPUPipeline` so that Web Inspector can
1592         instrument both render and compute shader pipelines.
1593
1594         Refactor `InspectorShaderProgram` to support both `WebGLProgram` and `WebGPUPipeline` so
1595         that the same object can be used for all types of shader "program"s.
1596
1597         Keep a copy of each shader module's source, and allow the shader module to be updated.
1598
1599         * Modules/webgpu/WebGPUDevice.h:
1600         * Modules/webgpu/WebGPUDevice.cpp:
1601         (WebCore::WebGPUDevice::WebGPUDevice):
1602         (WebCore::WebGPUDevice::~WebGPUDevice):
1603         (WebCore::WebGPUDevice::createShaderModule const):
1604         (WebCore::WebGPUDevice::createRenderPipeline): Added.
1605         (WebCore::WebGPUDevice::createComputePipeline): Added.
1606         (WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
1607         (WebCore::WebGPUDevice::createComputePipeline const): Deleted.
1608
1609         * Modules/webgpu/WebGPUPipeline.h: Added.
1610         (WebCore::WebGPUPipeline::isRenderPipeline const):
1611         (WebCore::WebGPUPipeline::isComputePipeline const):
1612         (WebCore::WebGPUPipeline::scriptExecutionContext const):
1613         * Modules/webgpu/WebGPUPipeline.cpp: Added.
1614         (WebCore::WebGPUPipeline::instancesMutex):
1615         (WebCore::WebGPUPipeline::WebGPUPipeline):
1616         (WebCore::WebGPUPipeline::~WebGPUPipeline):
1617         * platform/graphics/gpu/GPUPipeline.cpp: Added.
1618         * platform/graphics/gpu/GPUPipeline.h: Added.
1619         (WebCore::GPUPipeline::isRenderPipeline const):
1620         (WebCore::GPUPipeline::isComputePipeline const):
1621
1622         * Modules/webgpu/WebGPUComputePipeline.idl:
1623         * Modules/webgpu/WebGPUComputePipeline.h:
1624         (WebCore::WebGPUComputePipeline::computePipeline const): Deleted.
1625         * Modules/webgpu/WebGPUComputePipeline.cpp:
1626         (WebCore::WebGPUComputePipeline::create):
1627         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
1628         (WebCore::WebGPUComputePipeline::recompile): Added.
1629         * platform/graphics/gpu/GPUComputePipeline.h:
1630         (WebCore::GPUComputePipeline::isComputePipeline): Added.
1631         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
1632         (WebCore::GPUComputePipeline::tryCreate):
1633         (WebCore::GPUComputePipeline::GPUComputePipeline):
1634         (WebCore::GPUComputePipeline::recompile): Added.
1635
1636         * Modules/webgpu/WebGPURenderPipeline.idl:
1637         * Modules/webgpu/WebGPURenderPipeline.h:
1638         (WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.
1639         * Modules/webgpu/WebGPURenderPipeline.cpp:
1640         (WebCore::WebGPURenderPipeline::create):
1641         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
1642         (WebCore::WebGPURenderPipeline::recompile): Added.
1643         * platform/graphics/gpu/GPURenderPipeline.h:
1644         (WebCore::GPURenderPipeline::isRenderPipeline): Added.
1645         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1646         (WebCore::tryCreateMtlRenderPipelineState):
1647         (WebCore::GPURenderPipeline::tryCreate):
1648         (WebCore::GPURenderPipeline::GPURenderPipeline):
1649         (WebCore::GPURenderPipeline::recompile): Added.
1650
1651         * Modules/webgpu/WebGPUShaderModule.h:
1652         (WebCore::WebGPUShaderModule::source const): Added.
1653         * Modules/webgpu/WebGPUShaderModule.cpp:
1654         (WebCore::WebGPUShaderModule::update): Added.
1655         * Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
1656         * platform/graphics/gpu/GPUProgrammableStageDescriptor.h:
1657         (WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):
1658
1659         * inspector/InspectorShaderProgram.h:
1660         * inspector/InspectorShaderProgram.cpp:
1661         (WebCore::InspectorShaderProgram::create):
1662         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
1663         (WebCore::InspectorShaderProgram::program const): Added.
1664         (WebCore::InspectorShaderProgram::pipeline const): Added.
1665         (WebCore::shaderForType): Added.
1666         (WebCore::InspectorShaderProgram::requestShaderSource): Added.
1667         (WebCore::InspectorShaderProgram::updateShader): Added.
1668         (WebCore::InspectorShaderProgram::context const): Deleted.
1669         (WebCore::InspectorShaderProgram::shaderForType): Deleted.
1670
1671         * inspector/agents/InspectorCanvasAgent.h:
1672         * inspector/agents/InspectorCanvasAgent.cpp:
1673         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
1674         (WebCore::InspectorCanvasAgent::discardAgent):
1675         (WebCore::InspectorCanvasAgent::enable):
1676         (WebCore::InspectorCanvasAgent::disable):
1677         (WebCore::InspectorCanvasAgent::requestShaderSource):
1678         (WebCore::InspectorCanvasAgent::updateShader):
1679         (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
1680         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
1681         (WebCore::InspectorCanvasAgent::frameNavigated):
1682         (WebCore::InspectorCanvasAgent::didCreateWebGLProgram): Added.
1683         (WebCore::InspectorCanvasAgent::willDestroyWebGLProgram): Added.
1684         (WebCore::InspectorCanvasAgent::isWebGLProgramDisabled): Added.
1685         (WebCore::InspectorCanvasAgent::isWebGLProgramHighlighted): Added.
1686         (WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Added.
1687         (WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Added.
1688         (WebCore::InspectorCanvasAgent::programDestroyedTimerFired): Added.
1689         (WebCore::InspectorCanvasAgent::reset): Added.
1690         (WebCore::InspectorCanvasAgent::unbindProgram):
1691         (WebCore::InspectorCanvasAgent::findInspectorProgram):
1692         (WebCore::InspectorCanvasAgent::didCreateProgram): Deleted.
1693         (WebCore::InspectorCanvasAgent::willDeleteProgram): Deleted.
1694         (WebCore::InspectorCanvasAgent::isShaderProgramDisabled): Deleted.
1695         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted): Deleted.
1696         (WebCore::InspectorCanvasAgent::clearCanvasData): Deleted.
1697         * inspector/InspectorInstrumentation.h:
1698         (WebCore::InspectorInstrumentation::didCreateWebGLProgram): Added.
1699         (WebCore::InspectorInstrumentation::willDestroyWebGLProgram): Added.
1700         (WebCore::InspectorInstrumentation::isWebGLProgramDisabled): Added.
1701         (WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): Added.
1702         (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Added.
1703         (WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Added.
1704         (WebCore::InspectorInstrumentation::didCreateProgram): Deleted.
1705         (WebCore::InspectorInstrumentation::willDeleteProgram): Deleted.
1706         (WebCore::InspectorInstrumentation::isShaderProgramDisabled): Deleted.
1707         (WebCore::InspectorInstrumentation::isShaderProgramHighlighted): Deleted.
1708         * inspector/InspectorInstrumentation.cpp:
1709         (WebCore::InspectorInstrumentation::didCreateWebGLProgramImpl): Added.
1710         (WebCore::InspectorInstrumentation::willDestroyWebGLProgramImpl): Added.
1711         (WebCore::InspectorInstrumentation::isWebGLProgramDisabledImpl): Added.
1712         (WebCore::InspectorInstrumentation::isWebGLProgramHighlightedImpl): Added.
1713         (WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Added.
1714         (WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Added.
1715         (WebCore::InspectorInstrumentation::didCreateProgramImpl): Deleted.
1716         (WebCore::InspectorInstrumentation::willDeleteProgramImpl): Deleted.
1717         (WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl): Deleted.
1718         (WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl): Deleted.
1719
1720         * html/canvas/WebGLProgram.h:
1721         * html/canvas/WebGLProgram.cpp:
1722         (WebCore::WebGLProgram::WebGLProgram):
1723         (WebCore::WebGLProgram::~WebGLProgram):
1724         * html/canvas/WebGLRenderingContextBase.cpp:
1725         (WebCore::InspectorScopedShaderProgramHighlight::showHightlight):
1726         (WebCore::WebGLRenderingContextBase::createProgram):
1727         (WebCore::WebGLRenderingContextBase::deleteProgram):
1728         (WebCore::WebGLRenderingContextBase::drawArrays):
1729         (WebCore::WebGLRenderingContextBase::drawElements):
1730         Rename WebGL program instrumentation points to be less ambiguous.
1731
1732         * Sources.txt:
1733         * WebCore.xcodeproj/project.pbxproj:
1734
1735 2019-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1736
1737         [iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is incorrect
1738         https://bugs.webkit.org/show_bug.cgi?id=201674
1739         <rdar://problem/51250952>
1740
1741         Reviewed by Tim Horton.
1742
1743         Adds new helper methods on DragController to support the new image placeholder drop codepath. See WebKit
1744         ChangeLog for more details.
1745
1746         Tests:  WKAttachmentTestsIOS.TargetedPreviewsWhenDroppingImages
1747                 WKAttachmentTestsIOS.TargetedPreviewIsClippedWhenDroppingTallImage
1748
1749         * editing/WebContentReader.h:
1750
1751         Fix the Windows build after including WebContentReader.h in DragController.cpp.
1752
1753         * html/HTMLImageElement.h:
1754         (WebCore::HTMLImageElement::isDroppedImagePlaceholder const):
1755         (WebCore::HTMLImageElement::setIsDroppedImagePlaceholder):
1756
1757         Add a flag to HTMLImageElement, indicating whether it is a dropped image placeholder. If so, we have special
1758         logic to remove some temporary inline style properties from the image after it has finished loading (see
1759         finalizeDroppedImagePlaceholder).
1760
1761         Note that this doesn't increase the size of HTMLImageElement.
1762
1763         * page/DragController.cpp:
1764         (WebCore::DragController::dragEnded):
1765
1766         Clean up any stale placeholders after the drag ends.
1767
1768         (WebCore::DragController::performDragOperation):
1769         (WebCore::DragController::removeAllDroppedImagePlaceholders):
1770
1771         Add a private helper to clean up any dropped image placeholders after failing to update dropped image
1772         placeholders for any reason.
1773
1774         (WebCore::DragController::tryToUpdateDroppedImagePlaceholders):
1775
1776         Invoked when performing the drag operation, after image data has been loaded; this function attempts to update
1777         the list of image placeholder elements tracked by DragController that were previously inserted using
1778         insertDroppedImagePlaceholdersAtCaret, and updates the source attribute of each element (as well as any backed
1779         attachment element, if attachment elements are enabled). It achieves this by reading the dropped data as web
1780         content, and matching up the images in the resulting fragment against the placeholder images. If each image in
1781         the fragment can correspond to exactly one placeholder, we update the source of each placeholder image,
1782         migrate attachment elements over to the placeholder images if needed, and finally discard the fragment.
1783
1784         A return value of false indicates that this process failed, in which case we clean up the placeholders and fall
1785         back to handling the drop normally.
1786
1787         (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):
1788
1789         Invoked when handling the drop, before any image data has been loaded; this function takes a list of sizes
1790         representing the preferred presentation sizes of each item provider that will be loaded as an image, and uses
1791         ReplaceSelectionCommand to insert a list of (initially blank) placeholder images at the drop caret, sized
1792         accordingly to each item provider's preferredPresentationSize.
1793
1794         To make this compatible with Mail compose (and all other known internal clients that use the _editable SPI), we
1795         additionally enforce a max-width of 100% on each image and preserve the aspect ratio of the image by adjusting
1796         the height if needed.
1797
1798         (WebCore::DragController::finalizeDroppedImagePlaceholder):
1799         * page/DragController.h:
1800
1801         Have DragController keep track of the list of dropped image placeholders (in DOM order), as well as the dropped
1802         image placeholder range. This information is used once item provider data arrives and the drag operation is
1803         being performed, to update the source of each dropped image placeholder.
1804
1805         (WebCore::DragController::droppedImagePlaceholders const):
1806         (WebCore::DragController::droppedImagePlaceholderRange const):
1807         * platform/network/mac/UTIUtilities.h:
1808
1809         Mark an existing helper function as WEBCORE_EXPORT.
1810
1811 2019-09-23  Daniel Bates  <dabates@apple.com>
1812
1813         Improve CSP inheritance semantics
1814         https://bugs.webkit.org/show_bug.cgi?id=201884
1815         <rdar://problem/50172407>
1816
1817         Reviewed by Brent Fulgham.
1818
1819         Update the CSP inheritance semantics to more closely match the logic in section Initialize a Document's CSP list
1820         of the CSP3 spec., <https://w3c.github.io/webappsec-csp/#initialize-document-csp>.
1821
1822         Towards this, move more of the inheritance logic out of Document::initContentSecurityPolicy() and into
1823         DocumentWriter::begin() where details about the document being replaced live. This lets us remove the
1824         need to track the previous content security policy to pass it to Document::initContentSecurityPolicy().
1825         Moreover, DocumentWriter::begin() knows the owner document that will be replaced with the result of
1826         executing a JavaScript URL. This is needed in order to fix up inheritance of CSP for such documents.
1827
1828         Tests: http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html
1829                http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html
1830                http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html
1831
1832         * dom/Document.cpp:
1833         (WebCore::Document::initSecurityContext): If we are inheriting the security origin from the owner
1834         document then inherit its CSP policy. We copy over both the CSP state from the owner as well as
1835         update 'self' to match the owner's origin so that CSP source expressions that include 'self' work
1836         correctly even from about:blank documents.
1837         (WebCore::Document::initContentSecurityPolicy): Move most of the logic from here into DocumentWriter::begin()
1838         to take advantage of the fact that DocumentWriter::begin() knows about the outgoing document (if there
1839         is one) as well as whether the outgoing document is being replaced with a new document that is the result
1840         of evaluating a JavaScript URL. We need do know both these things in order to inherit the correct CSP
1841         policy. This function only exists to copy some upgrade-insecure-requests state and to fix up plugin documents
1842         as we currently do.
1843         (WebCore::Document::shouldInheritContentSecurityPolicy const): Deleted.
1844         * dom/Document.h:
1845         * dom/SecurityContext.cpp:
1846         (WebCore::SecurityContext::setContentSecurityPolicy): Modified to take its param by rvalue-reference
1847         to make it less error prone to use.
1848         * dom/SecurityContext.h: Expose setContentSecurityPolicy() so that we can invoke it from DocumentWriter::begin().
1849         * loader/DocumentWriter.cpp:
1850         (WebCore::DocumentWriter::begin): For documents being replaced with the result of a JavaScript URL (i.e. ownerDocument
1851         is non-null) inherit the CSP from the owner document. Similarly, if we have an existing document in the frame
1852         and the protocol of the new document's URL is data: or blob: then inherit the CSP from the existing page. The latter
1853         is what we currently do just moved from Document::initContentSecurityPolicy() and re-written in terms of the
1854         existingDocument instead of previousContentSecurityPolicy. Also call setInsecureNavigationRequestsToUpgrade()
1855         both when we have a non-null ownerDocument as well as when we have a non-null existingDocument. The former fixes
1856         the block-all-mixed-content feature for documents loaded via JavaScript URLs and the latter is what we do now.
1857         * loader/FrameLoader.cpp:
1858         (WebCore::FrameLoader::didBeginDocument): Remove parameter previousContentSecurityPolicy as the logic that
1859         made use of it moved to DocumentWriter::begin().
1860         * loader/FrameLoader.h:
1861         * page/csp/ContentSecurityPolicy.h:
1862
1863 2019-09-23  Keith Rollin  <krollin@apple.com>
1864
1865         Unreviewed build fix after r250173: tvOS build broken due to unused function.
1866
1867         * platform/network/cocoa/CookieCocoa.mm:
1868         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
1869
1870 2019-09-23  Brent Fulgham  <bfulgham@apple.com>
1871
1872         Unreviewed WinCairo/FTW Build fix after r250192.
1873
1874         * platform/network/curl/CurlDownload.cpp:
1875         (WebCore::CurlDownload::createCurlRequest):
1876
1877 2019-09-23  Zalan Bujtas  <zalan@apple.com>
1878
1879         [LFC][IFC] Merge inline box compute functions
1880         https://bugs.webkit.org/show_bug.cgi?id=202092
1881         <rdar://problem/55607748>
1882
1883         Reviewed by Antti Koivisto.
1884
1885         Make InlineFormattingContext::layoutInFlowContent() logic simpler.
1886
1887         * layout/inlineformatting/InlineFormattingContext.cpp:
1888         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
1889         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
1890         (WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry):
1891         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox): Deleted.
1892         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer): Deleted.
1893         * layout/inlineformatting/InlineFormattingContext.h:
1894
1895 2019-09-23  David Kilzer  <ddkilzer@apple.com>
1896
1897         REGRESSION (r249855): Remove debug logging from WebCore::RenderImage::paintIntoRect()
1898         <https://webkit.org/b/202103>
1899
1900         Reviewed by Zalan Bujtas.
1901
1902         * rendering/RenderImage.cpp:
1903         (WebCore::RenderImage::paintIntoRect): Remove debug logging
1904         statements.
1905
1906 2019-09-23  Zalan Bujtas  <zalan@apple.com>
1907
1908         [LFC][IFC] Pass in the Used*Values to inline layout functions.
1909         https://bugs.webkit.org/show_bug.cgi?id=202091
1910         <rdar://problem/55601987>
1911
1912         Reviewed by Antti Koivisto.
1913
1914         Only the top level layout functions should generate constraint values.
1915
1916         * layout/inlineformatting/InlineFormattingContext.cpp:
1917         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
1918         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1919         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
1920         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1921         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
1922         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
1923         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1924         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
1925         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
1926         * layout/inlineformatting/InlineFormattingContext.h:
1927         (WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const):
1928         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1929         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
1930         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
1931         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1932         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
1933
1934 2019-09-23  Antti Koivisto  <antti@apple.com>
1935
1936         Refcount simple line layout
1937         https://bugs.webkit.org/show_bug.cgi?id=202104
1938
1939         Reviewed by Zalan Bujtas.
1940
1941         Make SimpleLineLayout::Layout refcounted for safety and ease of use.
1942
1943         * dom/Position.cpp:
1944         (WebCore::Position::upstream const):
1945         (WebCore::Position::downstream const):
1946         * editing/TextIterator.cpp:
1947         (WebCore::TextIterator::handleTextNode):
1948         (WebCore::TextIterator::handleTextBox):
1949         (WebCore::TextIterator::handleTextNodeFirstLetter):
1950         * editing/TextIterator.h:
1951         * rendering/RenderBlockFlow.h:
1952         * rendering/RenderTreeAsText.cpp:
1953         (WebCore::RenderTreeAsText::writeRenderObject):
1954         (WebCore::write):
1955         * rendering/SimpleLineLayout.cpp:
1956         (WebCore::SimpleLineLayout::create):
1957         (WebCore::SimpleLineLayout::Layout::create):
1958         * rendering/SimpleLineLayout.h:
1959         * rendering/SimpleLineLayoutFunctions.cpp:
1960         (WebCore::SimpleLineLayout::outputLineLayoutForFlow):
1961         * rendering/SimpleLineLayoutResolver.cpp:
1962         (WebCore::SimpleLineLayout::RunResolver::Run::rect const):
1963         (WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):
1964
1965         Iterator now refs the layout. Since the resolver is owned by the layout, it is guaranteed to stay alive too.
1966
1967         (WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
1968         * rendering/SimpleLineLayoutResolver.h:
1969         (WebCore::SimpleLineLayout::RunResolver::Iterator::layout const):
1970         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition const):
1971         (WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):
1972         (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const): Deleted.
1973         (WebCore::SimpleLineLayout::runResolver): Deleted.
1974
1975         Always use the cached resolver owned by SimpleLineLayout::Layout.
1976
1977         * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
1978         (WebCore::LineLayoutInterface::firstTextBoxInVisualOrderFor):
1979         (WebCore::LineLayoutInterface::firstTextBoxInTextOrderFor):
1980         (WebCore::LineLayoutInterface::textBoxRangeFor):
1981         (WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor): Deleted.
1982         (WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor): Deleted.
1983         (WebCore::LineLayoutInterface::Provider::textBoxRangeFor): Deleted.
1984
1985         There is no need for a separate Provider class anymore as the iterator keeps SimpleLineLayout::Layout
1986         and Resolver instances alive itself.
1987
1988         * rendering/line/LineLayoutInterfaceTextBoxes.h:
1989         (WebCore::LineLayoutInterface::hasTextBoxes):
1990         (WebCore::LineLayoutInterface::Provider::firstTextBoxFor): Deleted.
1991
1992 2019-09-23  Youenn Fablet  <youenn@apple.com>
1993
1994         Simplify UserMediaPermissionRequestManager management of UserMediaRequest
1995         https://bugs.webkit.org/show_bug.cgi?id=201688
1996
1997         Reviewed by Eric Carlson.
1998
1999         Covered by existing tests and modified test.
2000
2001         * Modules/mediastream/UserMediaRequest.cpp:
2002         (WebCore::UserMediaRequest::UserMediaRequest):
2003         * Modules/mediastream/UserMediaRequest.h:
2004         (WebCore::UserMediaRequest::identifier const):
2005         Add an identifier generated for each request.
2006
2007 2019-09-23  Charlie Turner  <cturner@igalia.com>
2008
2009         [GStreamer] isAVC1CodecSupported is crashing several media source tests due to avc1.4d4001 codec type
2010         https://bugs.webkit.org/show_bug.cgi?id=201870
2011
2012         Reviewed by Xabier Rodriguez-Calvar.
2013
2014         The GStreamer codec-utils package expects all level_idc's to be
2015         multiples of 10 from the spec idc, i.e., 1.1 -> 11, 3.1 -> 31, 1
2016         -> 10, etc.
2017
2018         In the WPT tests, there is some confusion of this *10 multiplier,
2019         and the level_idc is given in several places as simply "1". This
2020         causes the get_level codec helper to return NULL, which the
2021         registry scanner was not handling properly, and crashing on.
2022
2023         Fix this by special casing "web level idc's" that violate the *10
2024         rule in isAVC1CodecSupported.
2025
2026         There is prior art along these lines in Gecko:
2027         https://searchfox.org/mozilla-central/source/dom/media/VideoUtils.cpp#453
2028         I assume Chrome/IE/etc must do something similar. The fix does not
2029         belong in GStreamer since these are actually invalid inputs to the
2030         get_level function.
2031
2032         Tested by imported/w3c/web-platform-tests/media-source
2033
2034         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
2035         (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const):
2036         Special case levels 1..5, even though these *should* be
2037         represented as 10 through 50 respectively, they are not in
2038         web-land. The two-byte local storage trick was contributed to me
2039         by Adrian Perez de Castro.
2040
2041 2019-09-23  Rob Buis  <rbuis@igalia.com>
2042
2043         Sync operator dictionary
2044         https://bugs.webkit.org/show_bug.cgi?id=201974
2045
2046         Reviewed by Frédéric Wang.
2047
2048         Sync with operator dictionary list from
2049         https://mathml-refresh.github.io/mathml-core/#operator-dictionary
2050
2051         Test: imported/w3c/web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001.html
2052
2053         * mathml/MathMLOperatorDictionary.cpp:
2054
2055 2019-09-22  David Kilzer  <ddkilzer@apple.com>
2056
2057         clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebCore
2058         <https://webkit.org/b/202090>
2059
2060         Reviewed by Daniel Bates.
2061
2062         Fix unwanted copying/ref churn of loop variables by making them
2063         const references.
2064
2065         * Modules/encryptedmedia/InitDataRegistry.cpp:
2066         (WebCore::InitDataRegistry::extractKeyIDsCenc):
2067         * accessibility/AccessibilityObject.cpp:
2068         (WebCore::AccessibilityObject::getMisspellingRange const):
2069         (WebCore::AccessibilityObject::performTextOperation):
2070         * html/HTMLSlotElement.cpp:
2071         (WebCore::flattenAssignedNodes):
2072         * html/track/WebVTTParser.cpp:
2073         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
2074         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2075         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2076         * platform/ios/PlatformPasteboardIOS.mm:
2077         (WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers):
2078         * platform/ios/WebItemProviderPasteboard.mm:
2079         (-[WebItemProviderPasteboard allDroppedFileURLs]):
2080         * svg/SVGStringList.h:
2081         * testing/MockLibWebRTCPeerConnection.cpp:
2082         (WebCore::MockLibWebRTCPeerConnection::GetTransceivers const):
2083         Also call transceivers.reserve() to optimize allocations.
2084
2085 2019-09-21  Chris Dumez  <cdumez@apple.com>
2086
2087         Reduce use of SessionID::defaultSessionID() in WebKit
2088         https://bugs.webkit.org/show_bug.cgi?id=202080
2089
2090         Reviewed by Alex Christensen.
2091
2092         Reduce use of SessionID::defaultSessionID() in WebKit. Falling back to the default session
2093         when you don't know which session to use is never a good idea and a potential privacy issue.
2094
2095         * Modules/websockets/WebSocketChannel.cpp:
2096         (WebCore::WebSocketChannel::connect):
2097         * dom/Document.cpp:
2098         (WebCore::Document::logger):
2099         * dom/Document.h:
2100         * html/HTMLAnchorElement.cpp:
2101         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2102         * loader/DocumentLoader.cpp:
2103         (WebCore::DocumentLoader::continueAfterContentPolicy):
2104         * loader/EmptyFrameLoaderClient.h:
2105         * loader/FrameLoaderClient.h:
2106         * loader/cache/CachedResourceLoader.cpp:
2107         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2108         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
2109         (WebCore::CachedResourceLoader::requestResource):
2110         (WebCore::CachedResourceLoader::revalidateResource):
2111         (WebCore::CachedResourceLoader::loadResource):
2112         * loader/cache/CachedResourceLoader.h:
2113         (WebCore::CachedResourceLoader::clearDocumentLoader):
2114         * page/Frame.cpp:
2115         * page/Frame.h:
2116         * workers/service/ServiceWorkerContainer.cpp:
2117         (WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
2118
2119 2019-09-21  Chris Dumez  <cdumez@apple.com>
2120
2121         ServiceWorkerContextData does not need a sessionID
2122         https://bugs.webkit.org/show_bug.cgi?id=202087
2123
2124         Reviewed by Alex Christensen.
2125
2126         * workers/service/ServiceWorkerContextData.cpp:
2127         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2128         * workers/service/ServiceWorkerContextData.h:
2129         (WebCore::ServiceWorkerContextData::encode const):
2130         (WebCore::ServiceWorkerContextData::decode):
2131         * workers/service/server/RegistrationDatabase.cpp:
2132         (WebCore::RegistrationDatabase::RegistrationDatabase):
2133         (WebCore::RegistrationDatabase::importRecords):
2134         * workers/service/server/RegistrationDatabase.h:
2135         * workers/service/server/SWServer.cpp:
2136         (WebCore::SWServer::updateWorker):
2137         * workers/service/server/SWServerWorker.cpp:
2138         (WebCore::SWServerWorker::contextData const):
2139
2140 2019-09-21  Chris Dumez  <cdumez@apple.com>
2141
2142         WebIDBConnectionToClient does not need to be RefCounted or a SessionID
2143         https://bugs.webkit.org/show_bug.cgi?id=202089
2144
2145         Reviewed by Alex Christensen.
2146
2147         Drop some dead code.
2148
2149         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2150
2151 2019-09-21  Chris Dumez  <cdumez@apple.com>
2152
2153         [CURL] CurlRequest does not need a sessionID
2154         https://bugs.webkit.org/show_bug.cgi?id=202086
2155
2156         Reviewed by Alex Christensen.
2157
2158         * platform/network/curl/CurlFormDataStream.cpp:
2159         (WebCore::CurlFormDataStream::CurlFormDataStream):
2160         * platform/network/curl/CurlFormDataStream.h:
2161         * platform/network/curl/CurlRequest.cpp:
2162         (WebCore::CurlRequest::CurlRequest):
2163         * platform/network/curl/CurlRequest.h:
2164         (WebCore::CurlRequest::create):
2165         * platform/network/curl/ResourceHandleCurl.cpp:
2166         (WebCore::ResourceHandle::createCurlRequest):
2167
2168 2019-09-21  Chris Dumez  <cdumez@apple.com>
2169
2170         CookieRequestHeaderFieldProxy does not need a SessionID
2171         https://bugs.webkit.org/show_bug.cgi?id=202084
2172
2173         Reviewed by Alex Christensen.
2174
2175         * Modules/websockets/WebSocketChannel.cpp:
2176         (WebCore::WebSocketChannel::didOpenSocketStream):
2177         * loader/CookieJar.cpp:
2178         (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
2179         * loader/CookieJar.h:
2180         * platform/network/CookieRequestHeaderFieldProxy.h:
2181         (WebCore::CookieRequestHeaderFieldProxy::encode const):
2182         (WebCore::CookieRequestHeaderFieldProxy::decode):
2183
2184 2019-09-21  Chris Dumez  <cdumez@apple.com>
2185
2186         DocumentLoader::m_temporaryServiceWorkerClient does not need a sessionID
2187         https://bugs.webkit.org/show_bug.cgi?id=202083
2188
2189         Reviewed by Alex Christensen.
2190
2191         * loader/DocumentLoader.cpp:
2192         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2193         (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
2194         * loader/DocumentLoader.h:
2195
2196 2019-09-21  Brent Fulgham  <bfulgham@apple.com>
2197
2198         [FTW] Resolve crashes found while running canvas tests
2199         https://bugs.webkit.org/show_bug.cgi?id=202062
2200
2201         Reviewed by Don Olmstead.
2202
2203         * platform/graphics/Pattern.h:
2204         * platform/graphics/win/Direct2DOperations.cpp:
2205         (WebCore::Direct2D::FillSource::FillSource): Take GraphicsContext as argument, rather than
2206         a PlatformContextDirect2D since downstream operations require the former.        
2207         (WebCore::Direct2D::StrokeSource::StrokeSource): Ditto.
2208         (WebCore::Direct2D::clip): Use new 'pushClip' helper function.
2209         * platform/graphics/win/Direct2DOperations.h:
2210         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2211         (WebCore::GraphicsContext::drawPath):
2212         (WebCore::GraphicsContext::fillPath):
2213         (WebCore::GraphicsContext::strokePath):
2214         (WebCore::GraphicsContext::fillRect):
2215         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2216         (WebCore::GraphicsContext::strokeRect):
2217         * platform/graphics/win/GraphicsContextImplDirect2D.cpp:
2218         (WebCore::GraphicsContextImplDirect2D::fillRect): Update to pass GraphicsContext.
2219         (WebCore::GraphicsContextImplDirect2D::fillRectWithRoundedHole): Ditto.
2220         (WebCore::GraphicsContextImplDirect2D::fillPath): Ditto.
2221         (WebCore::GraphicsContextImplDirect2D::strokeRect): Ditto.
2222         (WebCore::GraphicsContextImplDirect2D::strokePath): Ditto.
2223         (WebCore::GraphicsContextImplDirect2D::drawGlyphs): Ditto.
2224         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2225         (WebCore::ImageBufferData::copyRectFromSourceToData): Correct return behavior.
2226         (WebCore::ImageBufferData::compatibleBitmap): Make a copy if the render target is
2227         backed by the ID2D1Bitmap we are trying to draw with.
2228         * platform/graphics/win/PatternDirect2D.cpp:
2229         (WebCore::Pattern::createPlatformPattern const): Remove 'PlatformContextDirect2D' contructor,
2230         since we always need a GraphicsContext for the Image class.
2231         * platform/graphics/win/PlatformContextDirect2D.cpp:
2232         (WebCore::PlatformContextDirect2D::clipLayer const): Added.
2233         (WebCore::PlatformContextDirect2D::clearClips): Added.
2234         (WebCore::PlatformContextDirect2D::restore): Update to use m_stateStack, rather than
2235         the m_renderStates vector.
2236         (WebCore::PlatformContextDirect2D::save): Ditto.
2237         (WebCore::PlatformContextDirect2D::pushRenderClip): Ditto.
2238         (WebCore::PlatformContextDirect2D::setActiveLayer): Ditto.
2239         (WebCore::PlatformContextDirect2D::endDraw): Ditto.
2240         (WebCore::PlatformContextDirect2D::notifyPostDrawObserver): Ditto.
2241         (WebCore::PlatformContextDirect2D::pushClip): Ditto.
2242         * platform/graphics/win/PlatformContextDirect2D.h:
2243         (WebCore::PlatformContextDirect2D::hasSavedState const):
2244         (WebCore::PlatformContextDirect2D::clipLayer const): Deleted.
2245
2246 2019-09-20  Antoine Quint  <graouts@apple.com>
2247
2248         releasePointerCapture() not working for implicit capture; can't opt-in to pointerenter/leave for touches
2249         https://bugs.webkit.org/show_bug.cgi?id=199803
2250         <rdar://problem/53127223>
2251
2252         Reviewed by Dean Jackson.
2253
2254         In order to dispatch boundary events (pointerover/out/enter/leave) when the implicit pointer capture is released on iOS,
2255         we need to track the target of the pointer events that was dispatched last for a given pointer id. Then we compare that
2256         target with the current target when dispatching a new pointer event and determine whether we should dispatch boundary
2257         events using the exact same approach used to dispatch mouse boundary events in EventHandler::updateMouseEventTargetNode().
2258
2259         Tests: pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html
2260                pointerevents/ios/boundary-events-without-pointer-capture.html
2261
2262         * page/PointerCaptureController.cpp:
2263         (WebCore::hierarchyHasCapturingEventListeners):
2264         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
2265         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
2266         (WebCore::PointerCaptureController::ensureCapturingDataForPointerEvent):
2267         (WebCore::PointerCaptureController::cancelPointer):
2268         * page/PointerCaptureController.h:
2269
2270 2019-09-21  Zalan Bujtas  <zalan@apple.com>
2271
2272         [LFC] LayoutContext::m_formattingContextRootListForLayout should be a WeakHashSet
2273         https://bugs.webkit.org/show_bug.cgi?id=202068
2274         <rdar://problem/55579352>
2275
2276         Reviewed by Alex Christensen.
2277
2278         * layout/LayoutContext.cpp:
2279         (WebCore::Layout::LayoutContext::layout):
2280         (WebCore::Layout::LayoutContext::styleChanged):
2281         (WebCore::Layout::LayoutContext::markNeedsUpdate):
2282         * layout/LayoutContext.h:
2283         * page/FrameViewLayoutContext.cpp:
2284         (WebCore::layoutUsingFormattingContext):
2285
2286 2019-09-19  Andy Estes  <aestes@apple.com>
2287
2288         [Apple Pay] Clean up handling of summary items and payment method updates
2289         https://bugs.webkit.org/show_bug.cgi?id=202018
2290         <rdar://problem/55470632>
2291
2292         Reviewed by Tim Horton.
2293
2294         Replaced the PaymentMethodUpdate struct with a class that knows how to convert from
2295         ApplePayPaymentMethodUpdate structs to PKPaymentRequestPaymentMethodUpdate instances.
2296
2297         Moved some scattered-around free functions for converting payment summary items into
2298         PaymentSummaryItems{.h,Cocoa.mm}.
2299
2300         * Modules/applepay/ApplePayPaymentMethodUpdate.h:
2301         * Modules/applepay/ApplePaySession.cpp:
2302         (WebCore::finishConverting):
2303         (WebCore::convertAndValidateTotal):
2304         (WebCore::convertAndValidate):
2305         * Modules/applepay/ApplePaySessionPaymentRequest.h:
2306         * Modules/applepay/PaymentCoordinator.h:
2307         * Modules/applepay/PaymentCoordinatorClient.h:
2308         * Modules/applepay/PaymentHeaders.h:
2309         * Modules/applepay/PaymentMethodUpdate.h: Added.
2310         * Modules/applepay/PaymentSummaryItems.h: Added.
2311         * Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: Added.
2312         (WebCore::PaymentMethodUpdate::PaymentMethodUpdate):
2313         (WebCore::PaymentMethodUpdate::totalAndLineItems const):
2314         (WebCore::PaymentMethodUpdate::platformUpdate const):
2315         * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: Added.
2316         (WebCore::toDecimalNumber):
2317         (WebCore::toPKPaymentSummaryItemType):
2318         (WebCore::toPKPaymentSummaryItem):
2319         (WebCore::platformSummaryItems):
2320         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2321         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
2322         * SourcesCocoa.txt:
2323         * WebCore.xcodeproj/project.pbxproj:
2324         * testing/MockPaymentCoordinator.cpp:
2325         (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
2326
2327 2019-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2328
2329         Assertion fires when animating a discrete property with values range and multiple animators
2330         https://bugs.webkit.org/show_bug.cgi?id=201926
2331
2332         Reviewed by Darin Adler.
2333
2334         The first animator of a property is considered the result element. The
2335         other animators will be just contributers to the first animator. For the
2336         first animator and in SVGSMILElement::progress(), we call resetAnimatedType()
2337         which creates m_animator in SVGAnimateElementBase::animator(). But for 
2338         the other animators we do not call resetAnimatedType(). So their m_animator
2339         will stay null until they are used for the first time.
2340
2341         If SVGAnimationElement::startedActiveInterval() calls calculateToAtEndOfDurationValue()
2342         for a discrete property this will have no effect and the call should be
2343         ignored. So SVGAnimateElementBase::calculateToAtEndOfDurationValue()
2344         should bail out early if isDiscreteAnimator() is true.
2345
2346         The bug is isDiscreteAnimator() will return false if the m_animator is 
2347         null even if the animated property is discrete, e.g. SVGAnimatedString.
2348         The fix is to make isDiscreteAnimator() ensure m_animator is created.
2349
2350         Unrelated change:
2351         Make most of the protected methods of SVGAnimateElementBase be private.
2352
2353         Test: svg/animations/multiple-discrete-values-animate.svg
2354
2355         * svg/SVGAnimateElementBase.cpp:
2356         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2357         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
2358
2359 2019-09-20  Keith Rollin  <krollin@apple.com>
2360
2361         Remove dead code for a specific macOS and iOS SDK
2362         https://bugs.webkit.org/show_bug.cgi?id=202054
2363         <rdar://problem/55569619>
2364
2365         Reviewed by Zalan Bujtas.
2366
2367         ComplexTextController::collectComplexTextRunsForCharacters in
2368         ComplexTextControllerCoreText.mm has some code for compatibility with
2369         specifically macOS 10.14.0 and iOS 12.0 (see Bug 186571). We don't
2370         build for these targets any more (when we build for macOS 10.14, it's
2371         for a later minor revision), so this code can be removed.
2372
2373         No new tests -- no new or changed functionality.
2374
2375         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2376         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2377
2378 2019-09-20  Alex Christensen  <achristensen@webkit.org>
2379
2380         Remove unnecessary abstractions around WebsiteDataStore
2381         https://bugs.webkit.org/show_bug.cgi?id=201655
2382
2383         Reviewed by Chris Dumez.
2384
2385         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
2386         (WebCore::DatabaseManager::platformInitialize):
2387
2388 2019-09-20  Alex Christensen  <achristensen@webkit.org>
2389
2390         [resource-timing] Report performance entries with all HTTP status codes
2391         https://bugs.webkit.org/show_bug.cgi?id=202040
2392
2393         Reviewed by Joseph Pecoraro.
2394
2395         This follows a Chromium change at https://chromium-review.googlesource.com/c/chromium/src/+/1796544
2396         The spec change is being discussed at https://github.com/w3c/resource-timing/issues/165
2397
2398         Test: imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html
2399
2400         I had to slightly modify the test to make sure the entry count was > 0 instead of == 1 to reduce flakyness because sometimes we load the 200 image twice.
2401         I'll submit a PR to WPT, too.
2402
2403         * loader/ResourceTimingInformation.cpp:
2404         (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
2405
2406 2019-09-20  Keith Rollin  <krollin@apple.com>
2407
2408         Remove check of setSourceAppPid selector that's no longer needed
2409         https://bugs.webkit.org/show_bug.cgi?id=201971
2410         <rdar://problem/55505761>
2411
2412         Reviewed by Andy Estes.
2413
2414         Bug 172152 introduced a check of the NEFilterSource selector
2415         setSourceAppPid in order to support OS's that didn't support it. All
2416         supported Cocoa platforms now support it, so the check can be removed.
2417
2418         No new tests -- no new or changed functionality.
2419
2420         * platform/cocoa/NetworkExtensionContentFilter.mm:
2421         (WebCore::NetworkExtensionContentFilter::initialize):
2422
2423 2019-09-20  Keith Rollin  <krollin@apple.com>
2424
2425         Remove some support for < iOS 13
2426         https://bugs.webkit.org/show_bug.cgi?id=201967
2427         <rdar://problem/55504738>
2428
2429         Reviewed by Andy Estes.
2430
2431         Remove some support for iOS versions less than 13.0.
2432
2433         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
2434         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
2435         values >= 130000. This means that expressions like
2436         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
2437         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
2438
2439         After version checks have been removed, there are some cases where the
2440         preprocessor conditional looks like "#if PLATFORM(MAC) ||
2441         PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
2442         PLATFORM(COCOA)". This additional cleanup will be performed in a
2443         subsequent patch.
2444
2445         This removal is part of a series of patches effecting the removal of
2446         dead code for old versions of iOS. This particular pass involves
2447         changes in which Andy Estes was involved. These changes are isolated
2448         from other similar changes in order to facilitate the reviewing
2449         process.
2450
2451         No new tests -- no new or changed functionality.
2452
2453         * platform/cocoa/NetworkExtensionContentFilter.mm:
2454         (WebCore::NetworkExtensionContentFilter::initialize):
2455
2456 2019-09-20  Chris Dumez  <cdumez@apple.com>
2457
2458         Document no longer needs to store a SessionID
2459         https://bugs.webkit.org/show_bug.cgi?id=202024
2460
2461         Reviewed by Geoffrey Garen.
2462
2463         Document no longer needs to store a SessionID, now that we have a single
2464         session per WebProcess. It can simply get its sessionID from its Page.
2465
2466         * Modules/mediastream/RTCPeerConnection.cpp:
2467         (WebCore::RTCPeerConnection::create):
2468         * Modules/websockets/WebSocketChannel.cpp:
2469         (WebCore::WebSocketChannel::didOpenSocketStream):
2470         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2471         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2472         * dom/DOMImplementation.cpp:
2473         (WebCore::createXMLDocument):
2474         (WebCore::DOMImplementation::createDocument):
2475         (WebCore::DOMImplementation::createHTMLDocument):
2476         * dom/DOMImplementation.h:
2477         * dom/Document.cpp:
2478         (WebCore::Document::Document):
2479         (WebCore::m_undoManager):
2480         (WebCore::Document::create):
2481         (WebCore::Document::createNonRenderedPlaceholder):
2482         (WebCore::Document::cloneDocumentWithoutChildren const):
2483         (WebCore::Document::sessionID const):
2484         (WebCore::Document::privateBrowsingStateDidChange):
2485         (WebCore::Document::ensureTemplateDocument):
2486         (WebCore::Document::logger):
2487         (WebCore::Document::didLogMessage):
2488         * dom/Document.h:
2489         (WebCore::Document::create):
2490         * dom/XMLDocument.h:
2491         (WebCore::XMLDocument::create):
2492         (WebCore::XMLDocument::createXHTML):
2493         (WebCore::XMLDocument::XMLDocument):
2494         * html/FTPDirectoryDocument.cpp:
2495         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
2496         * html/FTPDirectoryDocument.h:
2497         * html/HTMLAnchorElement.cpp:
2498         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2499         * html/HTMLDocument.cpp:
2500         (WebCore::HTMLDocument::createSynthesizedDocument):
2501         (WebCore::HTMLDocument::HTMLDocument):
2502         (WebCore::HTMLDocument::cloneDocumentWithoutChildren const):
2503         * html/HTMLDocument.h:
2504         (WebCore::HTMLDocument::create):
2505         * html/ImageDocument.cpp:
2506         (WebCore::ImageDocument::ImageDocument):
2507         * html/MediaDocument.cpp:
2508         (WebCore::MediaDocument::MediaDocument):
2509         * html/MediaDocument.h:
2510         * html/PluginDocument.cpp:
2511         (WebCore::PluginDocument::PluginDocument):
2512         * html/TextDocument.cpp:
2513         (WebCore::TextDocument::TextDocument):
2514         * html/TextDocument.h:
2515         * inspector/DOMPatchSupport.cpp:
2516         (WebCore::DOMPatchSupport::patchDocument):
2517         * loader/CookieJar.cpp:
2518         (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
2519         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
2520         * loader/CookieJar.h:
2521         * loader/DocumentWriter.cpp:
2522         (WebCore::DocumentWriter::createDocument):
2523         * loader/SinkDocument.cpp:
2524         (WebCore::SinkDocument::SinkDocument):
2525         * loader/cache/CachedResource.cpp:
2526         (WebCore::CachedResource::setResponse):
2527         (WebCore::CachedResource::varyHeaderValuesMatch):
2528         * loader/cache/CachedSVGDocument.cpp:
2529         (WebCore::CachedSVGDocument::finishLoading):
2530         * loader/cache/CachedSVGFont.cpp:
2531         (WebCore::CachedSVGFont::ensureCustomFontData):
2532         * page/Page.cpp:
2533         (WebCore::Page::configureLoggingChannel):
2534         * platform/network/CacheValidation.cpp:
2535         (WebCore::cookieRequestHeaderFieldValue):
2536         (WebCore::collectVaryingRequestHeaders):
2537         (WebCore::verifyVaryingRequestHeaders):
2538         * platform/network/CacheValidation.h:
2539         * svg/SVGDocument.cpp:
2540         (WebCore::SVGDocument::SVGDocument):
2541         (WebCore::SVGDocument::cloneDocumentWithoutChildren const):
2542         * svg/SVGDocument.h:
2543         (WebCore::SVGDocument::create):
2544         * workers/service/ServiceWorkerContainer.cpp:
2545         (WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
2546         * worklets/WorkletGlobalScope.cpp:
2547         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
2548         * worklets/WorkletGlobalScope.h:
2549         * xml/DOMParser.cpp:
2550         (WebCore::DOMParser::parseFromString):
2551         * xml/DOMParser.h:
2552         * xml/DOMParser.idl:
2553         * xml/XMLHttpRequest.cpp:
2554         * xml/XSLTProcessor.cpp:
2555         (WebCore::XSLTProcessor::createDocumentFromSource):
2556
2557 2019-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2558
2559         [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements (Addressing review comments)
2560         https://bugs.webkit.org/show_bug.cgi?id=199843
2561
2562         Reviewed by Darin Adler.
2563
2564         Make RenderSVGEllipse calculate of the ellipse's rx and ry more efficiently.
2565
2566         * rendering/svg/RenderSVGEllipse.cpp:
2567         (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
2568
2569 2019-09-20  Keith Rollin  <krollin@apple.com>
2570
2571         Remove some support for < iOS 13
2572         https://bugs.webkit.org/show_bug.cgi?id=202032
2573         <rdar://problem/55548468>
2574
2575         Reviewed by Alex Christensen.
2576
2577         Remove some support for iOS versions less than 13.0.
2578
2579         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
2580         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
2581         values >= 130000. This means that expressions like
2582         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
2583         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
2584
2585         This removal is part of a series of patches effecting the removal of
2586         dead code for old versions of iOS. This particular pass involves
2587         changes in which Dan Bates was involved. These changes are isolated
2588         from other similar changes in order to facilitate the reviewing
2589         process.
2590
2591         No new tests -- no new or changed functionality.
2592
2593         * platform/network/cf/ResourceRequestCFNet.cpp:
2594         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2595         (WebCore::ResourceRequest::doUpdateResourceRequest):
2596         * platform/network/cocoa/CookieCocoa.mm:
2597         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
2598         * platform/network/cocoa/ResourceRequestCocoa.mm:
2599         (WebCore::ResourceRequest::doUpdateResourceRequest):
2600         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2601
2602 2019-09-20  Truitt Savell  <tsavell@apple.com>
2603
2604         Unreviewed, rolling out r250114.
2605
2606         Broke ~16 webgpu/ tests on Mojave wk2
2607
2608         Reverted changeset:
2609
2610         "Web Inspector: Canvas: show WebGPU shader pipelines"
2611         https://bugs.webkit.org/show_bug.cgi?id=201675
2612         https://trac.webkit.org/changeset/250114
2613
2614 2019-09-20  Antti Koivisto  <antti@apple.com>
2615
2616         Implement Position::upstream and Position::downstream with line layout iterator
2617         https://bugs.webkit.org/show_bug.cgi?id=202043
2618
2619         Reviewed by Zalan Bujtas.
2620
2621         These can eventually work without switching to lineboxes.
2622
2623         * dom/Position.cpp:
2624         (WebCore::Position::upstream const):
2625         (WebCore::Position::downstream const):
2626
2627         Factor the loops into TextBox::isLastOnLine function.
2628
2629         * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
2630         (WebCore::LineLayoutInterface::TextBox::isLastOnLine const):
2631
2632         Looking into root boxes is a much more efficient way to figure this out.
2633
2634         (WebCore::LineLayoutInterface::TextBox::isLast const):
2635         (WebCore::LineLayoutInterface::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const):
2636         (WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInTextOrder):
2637         * rendering/line/LineLayoutInterfaceTextBoxes.h:
2638
2639 2019-09-20  Zalan Bujtas  <zalan@apple.com>
2640
2641         [LFC] Introduce LayoutContext class
2642         https://bugs.webkit.org/show_bug.cgi?id=202026
2643         <rdar://problem/55546622>
2644
2645         Reviewed by Antti Koivisto.
2646
2647         Move context related functionality from LayoutState to LayoutContext.
2648         To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout().  
2649
2650         * Sources.txt:
2651         * WebCore.xcodeproj/project.pbxproj:
2652         * layout/FormattingContext.cpp:
2653         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
2654         * layout/FormattingContext.h:
2655         * layout/FormattingContextGeometry.cpp:
2656         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2657         * layout/LayoutState.cpp:
2658         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
2659         (WebCore::Layout::LayoutState::updateLayout): Deleted.
2660         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted.
2661         (WebCore::Layout::LayoutState::styleChanged): Deleted.
2662         (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted.
2663         (WebCore::Layout::LayoutState::createFormattingContext): Deleted.
2664         (WebCore::Layout::LayoutState::run): Deleted.
2665         * layout/LayoutState.h:
2666         (WebCore::Layout::LayoutState::hasFormattingState const):
2667         (WebCore::Layout::LayoutState::setQuirksMode):
2668         (WebCore::Layout::LayoutState::inNoQuirksMode const):
2669         (WebCore::Layout::LayoutState::updateAll): Deleted.
2670         * layout/Verification.cpp:
2671         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
2672         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted.
2673         * layout/blockformatting/BlockFormattingContext.cpp:
2674         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
2675         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2676         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2677         * layout/blockformatting/BlockInvalidation.cpp:
2678         (WebCore::Layout::computeUpdateType):
2679         (WebCore::Layout::computeUpdateTypeForAncestor):
2680         (WebCore::Layout::BlockInvalidation::invalidate):
2681         * layout/blockformatting/BlockInvalidation.h:
2682         * layout/displaytree/DisplayBox.h:
2683         * layout/inlineformatting/InlineFormattingContext.cpp:
2684         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
2685         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
2686         * layout/inlineformatting/InlineInvalidation.cpp:
2687         (WebCore::Layout::InlineInvalidation::invalidate):
2688         * layout/inlineformatting/InlineInvalidation.h:
2689         * layout/layouttree/LayoutTreeBuilder.cpp:
2690         (WebCore::Layout::printLayoutTreeForLiveDocuments):
2691         * layout/tableformatting/TableFormattingContext.cpp:
2692         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2693         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
2694         * layout/tableformatting/TableInvalidation.cpp:
2695         (WebCore::Layout::TableInvalidation::invalidate):
2696         * layout/tableformatting/TableInvalidation.h:
2697         * page/FrameViewLayoutContext.cpp:
2698         (WebCore::layoutUsingFormattingContext):
2699
2700 2019-09-19  Joonghun Park  <pjh0718@gmail.com>
2701
2702         Unreviewed. Fix Build error below since r248879.
2703
2704         warning: unused variable ‘canvas’ [-Wunused-variable]
2705
2706         No new tests, no new behavioral changes.
2707
2708         * html/canvas/GPUBasedCanvasRenderingContext.cpp:
2709         (WebCore::GPUBasedCanvasRenderingContext::notifyCanvasContentChanged):
2710
2711 2019-09-19  Devin Rousso  <drousso@apple.com>
2712
2713         Web Inspector: Canvas: show WebGPU shader pipelines
2714         https://bugs.webkit.org/show_bug.cgi?id=201675
2715
2716         Reviewed by Joseph Pecoraro.
2717
2718         Tests: inspector/canvas/requestShaderSource-webgpu.html
2719                inspector/canvas/shaderProgram-add-remove-webgpu.html
2720                inspector/canvas/updateShader-webgpu.html
2721
2722         Create common base classes for `WebGPUPipeline` and `GPUPipeline` so that Web Inspector can
2723         instrument both render and compute shader pipelines.
2724
2725         Refactor `InspectorShaderProgram` to support both `WebGLProgram` and `WebGPUPipeline` so
2726         that the same object can be used for all types of shader "program"s.
2727
2728         Keep a copy of each shader module's source, and allow the shader module to be updated.
2729
2730         * Modules/webgpu/WebGPUDevice.h:
2731         * Modules/webgpu/WebGPUDevice.cpp:
2732         (WebCore::WebGPUDevice::createShaderModule const):
2733         (WebCore::WebGPUDevice::createRenderPipeline): Added.
2734         (WebCore::WebGPUDevice::createComputePipeline): Added.
2735         (WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
2736         (WebCore::WebGPUDevice::createComputePipeline const): Deleted.
2737
2738         * Modules/webgpu/WebGPUPipeline.h: Added.
2739         (WebCore::WebGPUPipeline::isRenderPipeline const):
2740         (WebCore::WebGPUPipeline::isComputePipeline const):
2741         (WebCore::WebGPUPipeline::scriptExecutionContext const):
2742         * Modules/webgpu/WebGPUPipeline.cpp: Added.
2743         (WebCore::WebGPUPipeline::instancesMutex):
2744         (WebCore::WebGPUPipeline::WebGPUPipeline):
2745         (WebCore::WebGPUPipeline::~WebGPUPipeline):
2746         * platform/graphics/gpu/GPUPipeline.cpp: Added.
2747         * platform/graphics/gpu/GPUPipeline.h: Added.
2748         (WebCore::GPUPipeline::isRenderPipeline const):
2749         (WebCore::GPUPipeline::isComputePipeline const):
2750
2751         * Modules/webgpu/WebGPUComputePipeline.idl:
2752         * Modules/webgpu/WebGPUComputePipeline.h:
2753         (WebCore::WebGPUComputePipeline::computePipeline const): Deleted.
2754         * Modules/webgpu/WebGPUComputePipeline.cpp:
2755         (WebCore::WebGPUComputePipeline::create):
2756         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
2757         (WebCore::WebGPUComputePipeline::recompile): Added.
2758         * platform/graphics/gpu/GPUComputePipeline.h:
2759         (WebCore::GPUComputePipeline::isComputePipeline): Added.
2760         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2761         (WebCore::GPUComputePipeline::tryCreate):
2762         (WebCore::GPUComputePipeline::GPUComputePipeline):
2763         (WebCore::GPUComputePipeline::recompile): Added.
2764
2765         * Modules/webgpu/WebGPURenderPipeline.idl:
2766         * Modules/webgpu/WebGPURenderPipeline.h:
2767         (WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.
2768         * Modules/webgpu/WebGPURenderPipeline.cpp:
2769         (WebCore::WebGPURenderPipeline::create):
2770         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
2771         (WebCore::WebGPURenderPipeline::recompile): Added.
2772         * platform/graphics/gpu/GPURenderPipeline.h:
2773         (WebCore::GPURenderPipeline::isRenderPipeline): Added.
2774         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2775         (WebCore::tryCreateMtlRenderPipelineState):
2776         (WebCore::GPURenderPipeline::tryCreate):
2777         (WebCore::GPURenderPipeline::GPURenderPipeline):
2778         (WebCore::GPURenderPipeline::recompile): Added.
2779
2780         * Modules/webgpu/WebGPUShaderModule.h:
2781         (WebCore::WebGPUShaderModule::source const): Added.
2782         * Modules/webgpu/WebGPUShaderModule.cpp:
2783         (WebCore::WebGPUShaderModule::update): Added.
2784         * Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
2785         * platform/graphics/gpu/GPUProgrammableStageDescriptor.h:
2786         (WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):
2787
2788         * inspector/InspectorShaderProgram.h:
2789         * inspector/InspectorShaderProgram.cpp:
2790         (WebCore::InspectorShaderProgram::create):
2791         (WebCore::InspectorShaderProgram::InspectorShaderProgram):
2792         (WebCore::InspectorShaderProgram::program const): Added.
2793         (WebCore::InspectorShaderProgram::pipeline const): Added.
2794         (WebCore::shaderForType): Added.
2795         (WebCore::InspectorShaderProgram::requestShaderSource): Added.
2796         (WebCore::InspectorShaderProgram::updateShader): Added.
2797         (WebCore::InspectorShaderProgram::context const): Deleted.
2798         (WebCore::InspectorShaderProgram::shaderForType): Deleted.
2799
2800         * inspector/agents/InspectorCanvasAgent.h:
2801         * inspector/agents/InspectorCanvasAgent.cpp:
2802         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
2803         (WebCore::InspectorCanvasAgent::discardAgent):
2804         (WebCore::InspectorCanvasAgent::enable):
2805         (WebCore::InspectorCanvasAgent::disable):
2806         (WebCore::InspectorCanvasAgent::requestShaderSource):
2807         (WebCore::InspectorCanvasAgent::updateShader):
2808         (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
2809         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
2810         (WebCore::InspectorCanvasAgent::frameNavigated):
2811         (WebCore::InspectorCanvasAgent::didCreateWebGLProgram): Added.
2812         (WebCore::InspectorCanvasAgent::willDestroyWebGLProgram): Added.
2813         (WebCore::InspectorCanvasAgent::isWebGLProgramDisabled): Added.
2814         (WebCore::InspectorCanvasAgent::isWebGLProgramHighlighted): Added.
2815         (WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Added.
2816         (WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Added.
2817         (WebCore::InspectorCanvasAgent::programDestroyedTimerFired): Added.
2818         (WebCore::InspectorCanvasAgent::reset): Added.
2819         (WebCore::InspectorCanvasAgent::unbindProgram):
2820         (WebCore::InspectorCanvasAgent::findInspectorProgram):
2821         (WebCore::InspectorCanvasAgent::didCreateProgram): Deleted.
2822         (WebCore::InspectorCanvasAgent::willDeleteProgram): Deleted.
2823         (WebCore::InspectorCanvasAgent::isShaderProgramDisabled): Deleted.
2824         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted): Deleted.
2825         (WebCore::InspectorCanvasAgent::clearCanvasData): Deleted.
2826         * inspector/InspectorInstrumentation.h:
2827         (WebCore::InspectorInstrumentation::didCreateWebGLProgram): Added.
2828         (WebCore::InspectorInstrumentation::willDestroyWebGLProgram): Added.
2829         (WebCore::InspectorInstrumentation::isWebGLProgramDisabled): Added.
2830         (WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): Added.
2831         (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Added.
2832         (WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Added.
2833         (WebCore::InspectorInstrumentation::didCreateProgram): Deleted.
2834         (WebCore::InspectorInstrumentation::willDeleteProgram): Deleted.
2835         (WebCore::InspectorInstrumentation::isShaderProgramDisabled): Deleted.
2836         (WebCore::InspectorInstrumentation::isShaderProgramHighlighted): Deleted.
2837         * inspector/InspectorInstrumentation.cpp:
2838         (WebCore::InspectorInstrumentation::didCreateWebGLProgramImpl): Added.
2839         (WebCore::InspectorInstrumentation::willDestroyWebGLProgramImpl): Added.
2840         (WebCore::InspectorInstrumentation::isWebGLProgramDisabledImpl): Added.
2841         (WebCore::InspectorInstrumentation::isWebGLProgramHighlightedImpl): Added.
2842         (WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Added.
2843         (WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Added.
2844         (WebCore::InspectorInstrumentation::didCreateProgramImpl): Deleted.
2845         (WebCore::InspectorInstrumentation::willDeleteProgramImpl): Deleted.
2846         (WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl): Deleted.
2847         (WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl): Deleted.
2848
2849         * html/canvas/WebGLProgram.h:
2850         * html/canvas/WebGLProgram.cpp:
2851         (WebCore::WebGLProgram::WebGLProgram):
2852         (WebCore::WebGLProgram::~WebGLProgram):
2853         * html/canvas/WebGLRenderingContextBase.cpp:
2854         (WebCore::InspectorScopedShaderProgramHighlight::showHightlight):
2855         (WebCore::WebGLRenderingContextBase::createProgram):
2856         (WebCore::WebGLRenderingContextBase::deleteProgram):
2857         (WebCore::WebGLRenderingContextBase::drawArrays):
2858         (WebCore::WebGLRenderingContextBase::drawElements):
2859         Rename WebGL program instrumentation points to be less ambiguous.
2860
2861         * Sources.txt:
2862         * WebCore.xcodeproj/project.pbxproj:
2863
2864 2019-09-19  Chris Dumez  <cdumez@apple.com>
2865
2866         WorkerGlobalScope does not need a SessionID
2867         https://bugs.webkit.org/show_bug.cgi?id=201991
2868
2869         Reviewed by Alex Christensen.
2870
2871         WorkerGlobalScope does not need a SessionID, now that we have a single session
2872         per WebProcess.
2873
2874         * dom/Document.cpp:
2875         (WebCore::Document::resume):
2876         (WebCore::Document::privateBrowsingStateDidChange):
2877         * dom/Document.h:
2878         * dom/ScriptExecutionContext.h:
2879         * loader/DocumentLoader.cpp:
2880         (WebCore::DocumentLoader::matchRegistration):
2881         (WebCore::DocumentLoader::commitData):
2882         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2883         (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
2884         * testing/Internals.cpp:
2885         (WebCore::Internals::serviceWorkerClientIdentifier const):
2886         (WebCore::Internals::storeRegistrationsOnDisk):
2887         (WebCore::Internals::hasServiceWorkerRegistration):
2888         (WebCore::Internals::terminateServiceWorker):
2889         (WebCore::Internals::hasServiceWorkerConnection):
2890         * workers/DedicatedWorkerGlobalScope.cpp:
2891         (WebCore::DedicatedWorkerGlobalScope::create):
2892         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2893         * workers/DedicatedWorkerGlobalScope.h:
2894         * workers/DedicatedWorkerThread.cpp:
2895         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2896         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2897         * workers/DedicatedWorkerThread.h:
2898         * workers/Worker.cpp:
2899         (WebCore::Worker::notifyFinished):
2900         * workers/WorkerGlobalScope.cpp:
2901         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2902         * workers/WorkerGlobalScope.h:
2903         * workers/WorkerGlobalScopeProxy.h:
2904         * workers/WorkerMessagingProxy.cpp:
2905         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2906         * workers/WorkerMessagingProxy.h:
2907         * workers/WorkerThread.cpp:
2908         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2909         (WebCore::WorkerThread::WorkerThread):
2910         (WebCore::WorkerThread::workerThread):
2911         * workers/WorkerThread.h:
2912         * workers/service/ServiceWorker.cpp:
2913         (WebCore::ServiceWorker::postMessage):
2914         * workers/service/ServiceWorkerContainer.cpp:
2915         (WebCore::mainThreadConnection):
2916         (WebCore::ServiceWorkerContainer::addRegistration):
2917         (WebCore::ServiceWorkerContainer::removeRegistration):
2918         (WebCore::ServiceWorkerContainer::updateRegistration):
2919         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2920         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
2921         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2922         (WebCore::ServiceWorkerContainer::notifyFailedFetchingScript):
2923         (WebCore::ServiceWorkerContainer::ensureSWClientConnection):
2924         * workers/service/ServiceWorkerGlobalScope.cpp:
2925         (WebCore::ServiceWorkerGlobalScope::create):
2926         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
2927         * workers/service/ServiceWorkerGlobalScope.h:
2928         * workers/service/ServiceWorkerProvider.cpp:
2929         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
2930         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
2931         * workers/service/ServiceWorkerProvider.h:
2932         * workers/service/WorkerSWClientConnection.cpp:
2933         (WebCore::WorkerSWClientConnection::WorkerSWClientConnection):
2934         (WebCore::WorkerSWClientConnection::matchRegistration):
2935         (WebCore::WorkerSWClientConnection::getRegistrations):
2936         (WebCore::WorkerSWClientConnection::whenRegistrationReady):
2937         (WebCore::WorkerSWClientConnection::addServiceWorkerRegistrationInServer):
2938         (WebCore::WorkerSWClientConnection::removeServiceWorkerRegistrationInServer):
2939         (WebCore::WorkerSWClientConnection::didResolveRegistrationPromise):
2940         (WebCore::WorkerSWClientConnection::postMessageToServiceWorker):
2941         (WebCore::WorkerSWClientConnection::serverConnectionIdentifier const):
2942         (WebCore::WorkerSWClientConnection::syncTerminateWorker):
2943         (WebCore::WorkerSWClientConnection::registerServiceWorkerClient):
2944         (WebCore::WorkerSWClientConnection::finishFetchingScriptInServer):
2945         (WebCore::WorkerSWClientConnection::scheduleJob):
2946         * workers/service/WorkerSWClientConnection.h:
2947         * workers/service/context/ServiceWorkerThread.cpp:
2948         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
2949         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
2950         * workers/service/context/ServiceWorkerThread.h:
2951         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2952         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
2953         * workers/service/context/ServiceWorkerThreadProxy.h:
2954         * worklets/WorkletGlobalScope.h:
2955         (WebCore::WorkletGlobalScope::sessionID const):
2956         * xml/DOMParser.cpp:
2957         (WebCore::DOMParser::parseFromString):
2958         * xml/DOMParser.h:
2959         * xml/DOMParser.idl:
2960         * xml/XMLHttpRequest.cpp:
2961
2962 2019-09-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2963
2964         [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and<rect> elements
2965         https://bugs.webkit.org/show_bug.cgi?id=199843
2966
2967         Reviewed by Simon Fraser, Nikolas Zimmermann.
2968
2969         The specification is: https://www.w3.org/TR/SVG2/geometry.html#RxProperty.
2970
2971         Change the initial value of rx and ry to be "auto". Change the parser to
2972         parse LengthOrAuto for these properties. Handle the case if one of them
2973         is missing.
2974
2975         Tests: svg/custom/ellipse-radius-auto-dynamic.svg
2976                svg/custom/ellipse-radius-auto-initial.svg
2977                svg/custom/ellipse-radius-length-initial.svg
2978                svg/custom/rect-radius-auto-dynamic.svg
2979                svg/custom/rect-radius-auto-initial.svg
2980                svg/custom/rect-radius-length-initial.svg
2981
2982         * css/CSSProperties.json:
2983         * css/parser/CSSPropertyParser.cpp:
2984         (WebCore::consumeRxOrRy):
2985         * rendering/style/RenderStyle.h:
2986         (WebCore::RenderStyle::initialRadius):
2987         * rendering/style/SVGRenderStyleDefs.cpp:
2988         (WebCore::StyleLayoutData::StyleLayoutData):
2989         * rendering/svg/RenderSVGEllipse.cpp:
2990         (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
2991
2992 2019-09-19  Peng Liu  <peng.liu6@apple.com>
2993
2994         HTMLVideoElement with a broken poster image will take square dimension
2995         https://bugs.webkit.org/show_bug.cgi?id=174122
2996         <rdar://problem/33121806>
2997
2998         Reviewed by Daniel Bates.
2999
3000         For a video element, if only the width attribute is given and the height attribute is missing,
3001         an invalid poster image will make its aspect ratio to be 1, which is the historical WebKit behavior
3002         if we're painting alt text and/or a broken image. This fix prevents that behavior to impact video elements.
3003
3004         We add a virtual function shouldDisplayBrokenImageIcon() to RenderImage and it will return true
3005         only when the image source is given but cannot be downloaded. RenderMedia overrides this virtual function
3006         and always return false because it never shows the broken image icon. RenderVideo inherits
3007         that behavior from RenderMedia.
3008
3009         Then, in RenderImage::computeIntrinsicRatioInformation(), we only set the aspect ratio to 1
3010         when we need to show the broken image icon. It is the historical WebKit behavior that we want to keep
3011         for image element, but we also want to avoid its impact (this bug) on video elements.
3012
3013         We also replace the imageResource().errorOccurred() with shouldDisplayBrokenImageIcon() in
3014         TreeBuilder::createLayoutBox() for the same reason.
3015
3016         The logic to display the broken image icon in RenderImage::renderReplaced() is also cleaned up.
3017
3018         Test: media/video-poster-not-found.html
3019
3020         * layout/layouttree/LayoutTreeBuilder.cpp:
3021         (WebCore::Layout::TreeBuilder::createLayoutBox):
3022         * rendering/RenderImage.cpp:
3023         (WebCore::RenderImage::shouldDisplayBrokenImageIcon const):
3024         (WebCore::RenderImage::paintReplaced):
3025         (WebCore::RenderImage::computeIntrinsicRatioInformation const):
3026         * rendering/RenderImage.h:
3027         * rendering/RenderMedia.h:
3028
3029 2019-09-19  Antti Koivisto  <antti@apple.com>
3030
3031         Turn static DocumentRuleSets::s_isInvalidatingStyleWithRuleSets assertion bit into a member
3032         https://bugs.webkit.org/show_bug.cgi?id=201985
3033         <rdar://problem/54851871>
3034
3035         Reviewed by Zalan Bujtas.
3036
3037         This assert bit was catching cases that are not dangerous. Turn it into a member to narrow the scope.
3038
3039         * css/DocumentRuleSets.cpp:
3040         (WebCore::DocumentRuleSets::~DocumentRuleSets):
3041         (WebCore::DocumentRuleSets::collectFeatures const):
3042         (): Deleted.
3043         * css/DocumentRuleSets.h:
3044         (WebCore::DocumentRuleSets::isInvalidatingStyleWithRuleSets):
3045         * style/AttributeChangeInvalidation.cpp:
3046         (WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
3047         * style/ClassChangeInvalidation.cpp:
3048         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
3049
3050 2019-09-19  Zalan Bujtas  <zalan@apple.com>
3051
3052         [LFC] Remove redundant Layout::Box::ElementTypes
3053         https://bugs.webkit.org/show_bug.cgi?id=201963
3054
3055         Reviewed by Antti Koivisto.
3056
3057         These types can be solved through RenderStyle.
3058
3059         * layout/layouttree/LayoutBox.cpp:
3060         (WebCore::Layout::Box::isPaddingApplicable const):
3061         * layout/layouttree/LayoutBox.h:
3062         (WebCore::Layout::Box::isTableHeader const):
3063         (WebCore::Layout::Box::isTableBody const):
3064         (WebCore::Layout::Box::isTableFooter const):
3065         (WebCore::Layout::Box::isTableRow const):
3066         (WebCore::Layout::Box::isTableColumnGroup const):
3067         (WebCore::Layout::Box::isTableColumn const):
3068         (WebCore::Layout::Box::isTableCell const):
3069         * layout/layouttree/LayoutTreeBuilder.cpp:
3070         (WebCore::Layout::TreeBuilder::createLayoutBox):
3071         * page/FrameViewLayoutContext.cpp:
3072         (WebCore::layoutUsingFormattingContext):
3073
3074 2019-09-19  Zalan Bujtas  <zalan@apple.com>
3075
3076         [LFC][IFC] InlineFormattingContext::InlineLayout should not need to call LayoutState::establishedFormattingState
3077         https://bugs.webkit.org/show_bug.cgi?id=201972
3078         <rdar://problem/55505869>
3079
3080         Reviewed by Antti Koivisto.
3081
3082         InlineLayout has access to InlineFormattingContext, so it should just query it instead of calling LayoutState::establishedFormattingState.
3083
3084         * layout/inlineformatting/InlineFormattingContext.h:
3085         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const):
3086         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingState):
3087         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3088         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
3089         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
3090         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3091         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const): Deleted.
3092         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const): Deleted.
3093
3094 2019-09-19  Zalan Bujtas  <zalan@apple.com>
3095
3096         [LFC] FloatingContext should take the root container.
3097         https://bugs.webkit.org/show_bug.cgi?id=201968
3098         <rdar://problem/55505090>
3099
3100         Reviewed by Antti Koivisto.
3101
3102         Now FormattingContext::root() does not need to be public anymore.
3103
3104         * layout/FormattingContext.h:
3105         (WebCore::Layout::FormattingContext::root const):
3106         * layout/blockformatting/BlockFormattingContext.cpp:
3107         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
3108         * layout/floats/FloatingContext.cpp:
3109         (WebCore::Layout::FloatingContext::FloatingContext):
3110         (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
3111         * layout/floats/FloatingContext.h:
3112         (WebCore::Layout::FloatingContext::root const):
3113         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3114         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
3115         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
3116
3117 2019-09-18  Brent Fulgham  <bfulgham@apple.com>
3118
3119         [FTW] Correct ImageBufferData and clear operations
3120         https://bugs.webkit.org/show_bug.cgi?id=201862
3121
3122         Reviewed by Fujii Hironori.
3123
3124         This patch corrects several problems in the canvas implementation:
3125         1. The implementation of ImageBufferDataDirect2D did not properly handle the case of a
3126            'getData' request for less than the size of the full bitmap.
3127         2. The implementation of 'Clear' was not correct when the size of the region to be
3128            cleared is less than the size of the render target.
3129         3. 'endDraw' fails if any clip regions are active at the end of the operation. The
3130            stack needs to be unwound when endDraw is called.
3131
3132         This patch corrects all three problems.
3133
3134         Tested by canvas LayoutTests.
3135
3136         * platform/graphics/win/Direct2DOperations.cpp:
3137         (WebCore::Direct2D::clearRect): Correct partial render target case.
3138         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3139         (WebCore::ImageBufferData::getData const): Correct partial buffer case.
3140         (WebCore::ImageBufferData::putData): Ditto.
3141         (WebCore::ImageBufferData::readDataFromBitmapIfNeeded): Added.
3142         (WebCore::copyRectFromSourceToDest): Added.
3143         (WebCore::ImageBufferData::copyRectFromSourceToData): Added.
3144         * platform/graphics/win/PlatformContextDirect2D.cpp:
3145         (WebCore::PlatformContextDirect2D::endDraw): Correct failures caused by
3146         dangling clip regions when 'endDraw' is called.
3147         (WebCore::PlatformContextDirect2D::flush): Don't call post-draw observer;
3148         this is already handled in the draw operations, and endDraw.
3149         (WebCore::PlatformContextDirect2D::restore): Recognize that the clip
3150         and transparency stack might be empty when restore is called.
3151
3152 2019-09-18  Andy Estes  <aestes@apple.com>
3153
3154         Unreviewed, fixed a crash in ssl/applepay/ApplePayCancelEvent.https.html
3155
3156         After r250060 (which landed very shortly after the patch that introduced ApplePayCancelEvent),
3157         all Events must be IsoHeap-ed. ApplePayCancelEvent was not IsoHeap-ed, and so this caused
3158         assertion failures in ssl/applepay/ApplePayCancelEvent.https.html.
3159         
3160         Added the WTF_MAKE_ISO_ALLOCATED macros to ApplePayCancelEvent without a review to stop the
3161         test from failing in EWS.
3162
3163         * Modules/applepay/ApplePayCancelEvent.cpp:
3164         * Modules/applepay/ApplePayCancelEvent.h:
3165
3166 2019-09-18  Chris Dumez  <cdumez@apple.com>
3167
3168         WebSocketStream does not need a SessionID
3169         https://bugs.webkit.org/show_bug.cgi?id=201960
3170
3171         Reviewed by Geoffrey Garen.
3172
3173         WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.
3174
3175         * platform/network/cf/SocketStreamHandleImpl.h:
3176         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3177         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
3178
3179 2019-09-18  Chris Dumez  <cdumez@apple.com>
3180
3181         LibWebRTCProvider does not need sessionIDs anymore
3182         https://bugs.webkit.org/show_bug.cgi?id=201959
3183
3184         Reviewed by Geoffrey Garen.
3185
3186         LibWebRTCProvider does not need sessionIDs anymore, now that we have a single session per WebProcess.
3187
3188         * Modules/mediastream/PeerConnectionBackend.cpp:
3189         (WebCore::PeerConnectionBackend::registerMDNSName):
3190         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3191         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
3192         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3193
3194 2019-09-18  Zalan Bujtas  <zalan@apple.com>
3195
3196         [LFC] FormattingContext::Geometry/MarginCollapse/Quirk classes should not need to access non-const Display::Box
3197         https://bugs.webkit.org/show_bug.cgi?id=201944
3198         <rdar://problem/55493279>
3199
3200         Reviewed by Antti Koivisto.
3201
3202         This patch improves const correctness so that the Geometry/MarginCollapse/Quirk objects could not access non-const Display::Boxes (to mutate the display tree).
3203         (The MarginCollapse::Update* functions are about updating the margin values on previously processed boxes so strictly speaking they are not margin collapsing related, but they somewhat belong to the MarginCollapse class -since they deal with margins.)
3204
3205         * layout/FormattingContext.h:
3206         (WebCore::Layout::FormattingContext::formattingState const):
3207         (WebCore::Layout::FormattingContext::formattingState):
3208         * layout/FormattingState.cpp:
3209         (WebCore::Layout::FormattingState::displayBox):
3210         (WebCore::Layout::FormattingState::displayBox const): Deleted.
3211         * layout/FormattingState.h:
3212         * layout/blockformatting/BlockFormattingContext.cpp:
3213         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
3214         * layout/blockformatting/BlockFormattingContext.h:
3215         (WebCore::Layout::BlockFormattingContext::formattingState const):
3216         (WebCore::Layout::BlockFormattingContext::formattingState):
3217         * layout/blockformatting/BlockMarginCollapse.cpp:
3218         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
3219         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
3220         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore const):
3221         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const):
3222         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
3223         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const): Deleted.
3224         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues): Deleted.
3225         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore): Deleted.
3226         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter): Deleted.
3227         * layout/inlineformatting/InlineFormattingContext.cpp:
3228         (WebCore::Layout::InlineFormattingContext::collectInlineContent):
3229         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Deleted.
3230         * layout/inlineformatting/InlineFormattingContext.h:
3231         (WebCore::Layout::InlineFormattingContext::formattingState const):
3232         (WebCore::Layout::InlineFormattingContext::formattingState):
3233         * layout/tableformatting/TableFormattingContext.h:
3234         (WebCore::Layout::TableFormattingContext::formattingState const):
3235         (WebCore::Layout::TableFormattingContext::formattingState):
3236
3237 2019-09-18  Chris Dumez  <cdumez@apple.com>
3238
3239         BlobRegistry no longer needs SessionIDs
3240         https://bugs.webkit.org/show_bug.cgi?id=201936
3241
3242         Reviewed by Geoffrey Garen.
3243
3244         BlobRegistry no longer needs SessionIDs, now that we have a single session per WebProcess.
3245
3246         * Modules/entriesapi/DOMFileSystem.cpp:
3247         (WebCore::DOMFileSystem::getFile):
3248         * Modules/entriesapi/DOMFileSystem.h:
3249         * Modules/entriesapi/FileSystemFileEntry.cpp:
3250         (WebCore::FileSystemFileEntry::file):
3251         * Modules/entriesapi/FileSystemFileEntry.h:
3252         * Modules/entriesapi/FileSystemFileEntry.idl:
3253         * Modules/fetch/FetchBody.cpp:
3254         (WebCore::FetchBody::fromFormData):
3255         * Modules/fetch/FetchBody.h:
3256         * Modules/fetch/FetchBodyConsumer.cpp:
3257         (WebCore::blobFromData):
3258         (WebCore::resolveWithTypeAndData):
3259         (WebCore::FetchBodyConsumer::resolve):
3260         (WebCore::FetchBodyConsumer::takeAsBlob):
3261         * Modules/fetch/FetchBodyConsumer.h:
3262         * Modules/fetch/FetchBodyOwner.cpp:
3263         (WebCore::FetchBodyOwner::blob):
3264         * Modules/fetch/FetchLoader.cpp:
3265         (WebCore::FetchLoader::~FetchLoader):
3266         (WebCore::FetchLoader::startLoadingBlobURL):
3267         * Modules/fetch/FetchLoader.h:
3268         * Modules/indexeddb/IDBTransaction.cpp:
3269         (WebCore::IDBTransaction::putOrAddOnServer):
3270         * Modules/mediarecorder/MediaRecorder.cpp:
3271         (WebCore::MediaRecorder::createRecordingDataBlob):
3272         * Modules/mediasource/MediaSourceRegistry.cpp:
3273         (WebCore::MediaSourceRegistry::unregisterURL):
3274         * Modules/mediasource/MediaSourceRegistry.h:
3275         * Modules/mediastream/RTCDataChannel.cpp:
3276         (WebCore::RTCDataChannel::didReceiveRawData):
3277         * Modules/websockets/WebSocket.cpp:
3278         (WebCore::WebSocket::didReceiveBinaryData):
3279         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3280         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
3281         * bindings/js/SerializedScriptValue.cpp:
3282         (WebCore::CloneDeserializer::readFile):
3283         (WebCore::CloneDeserializer::readTerminal):
3284         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
3285         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
3286         * bindings/js/SerializedScriptValue.h:
3287         * dom/DataTransfer.cpp:
3288         (WebCore::DataTransfer::DataTransfer):
3289         (WebCore::DataTransfer::createForCopyAndPaste):
3290         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
3291         (WebCore::DataTransfer::createForInputEvent):
3292         (WebCore::DataTransfer::createForDrag):
3293         (WebCore::DataTransfer::createForDragStartEvent):
3294         (WebCore::DataTransfer::createForDrop):
3295         (WebCore::DataTransfer::createForUpdatingDropTarget):
3296         * dom/DataTransfer.h:
3297         * editing/ReplaceRangeWithTextCommand.cpp:
3298         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
3299         * editing/ReplaceSelectionCommand.cpp:
3300         (WebCore::ReplaceSelectionCommand::inputEventDataTransfer const):
3301         * editing/SpellingCorrectionCommand.cpp:
3302         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
3303         * editing/TypingCommand.cpp:
3304         (WebCore::TypingCommand::inputEventDataTransfer const):
3305         * editing/WebCorePasteboardFileReader.cpp:
3306         (WebCore::WebCorePasteboardFileReader::readFilename):
3307         (WebCore::WebCorePasteboardFileReader::readBuffer):
3308         * editing/WebCorePasteboardFileReader.h:
3309         * editing/cocoa/WebContentReaderCocoa.mm:
3310         (WebCore::createFragmentForImageAttachment):
3311         (WebCore::replaceRichContentWithAttachments):
3312         (WebCore::createFragmentAndAddResources):
3313         (WebCore::sanitizeMarkupWithArchive):
3314         (WebCore::WebContentReader::readImage):
3315         (WebCore::attachmentForFilePath):
3316         (WebCore::attachmentForData):
3317         * editing/markup.cpp:
3318         (WebCore::restoreAttachmentElementsInFragment):
3319         * fileapi/Blob.cpp:
3320         (WebCore::BlobURLRegistry::registerURL):
3321         (WebCore::BlobURLRegistry::unregisterURL):
3322         (WebCore::Blob::Blob):
3323         (WebCore::Blob::~Blob):
3324         * fileapi/Blob.h:
3325         (WebCore::Blob::create):
3326         (WebCore::Blob::deserialize):
3327         (WebCore::Blob::slice const):
3328         * fileapi/Blob.idl:
3329         * fileapi/File.cpp:
3330         (WebCore::File::createWithRelativePath):
3331         (WebCore::File::create):
3332         (WebCore::File::File):
3333         * fileapi/File.h:
3334         * fileapi/File.idl:
3335         * fileapi/FileReaderLoader.cpp:
3336         (WebCore::FileReaderLoader::~FileReaderLoader):
3337         (WebCore::FileReaderLoader::start):
3338         * fileapi/FileReaderLoader.h:
3339         * fileapi/ThreadableBlobRegistry.cpp:
3340         (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
3341         (WebCore::ThreadableBlobRegistry::registerBlobURL):
3342         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
3343         (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice):
3344         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
3345         * fileapi/ThreadableBlobRegistry.h:
3346         * html/FileInputType.cpp:
3347         (WebCore::FileInputType::appendFormData const):
3348         (WebCore::FileInputType::filesChosen):
3349         * html/FileListCreator.cpp:
3350         (WebCore::appendDirectoryFiles):
3351         (WebCore::FileListCreator::FileListCreator):
3352         (WebCore::FileListCreator::createFileList):
3353         * html/FileListCreator.h:
3354         (WebCore::FileListCreator::create):
3355         * html/HTMLAttachmentElement.cpp:
3356         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
3357         * html/HTMLCanvasElement.cpp:
3358         (WebCore::HTMLCanvasElement::toBlob):
3359         * html/PublicURLManager.cpp:
3360         (WebCore::PublicURLManager::revoke):
3361         (WebCore::PublicURLManager::stop):
3362         * html/URLRegistry.h:
3363         * loader/PolicyChecker.cpp:
3364         (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
33