1 2019-03-01 Antoine Quint <graouts@apple.com>
3 [iOS] Turn mouse event simulation on by default
4 https://bugs.webkit.org/show_bug.cgi?id=195218
5 <rdar://problem/48516794>
7 Reviewed by Dean Jackson.
9 * page/RuntimeEnabledFeatures.h:
11 2019-03-01 Chris Dumez <cdumez@apple.com>
13 Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
14 https://bugs.webkit.org/show_bug.cgi?id=195230
15 <rdar://problem/47925359>
17 Reviewed by Ryosuke Niwa.
19 Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
20 to address crashes on iOS WK1.
22 * platform/network/NetworkStateNotifier.cpp:
23 (WebCore::shouldSuppressThreadSafetyCheck):
24 (WebCore::NetworkStateNotifier::singleton):
26 2019-03-01 Simon Fraser <simon.fraser@apple.com>
28 Show mouse event regions in the overlay
29 https://bugs.webkit.org/show_bug.cgi?id=195227
31 Reviewed by Tim Horton.
33 Enhance event region overlays to show more kinds of events.
35 * page/DebugPageOverlays.cpp:
36 (WebCore::touchEventRegionColors):
37 (WebCore::NonFastScrollableRegionOverlay::drawRect):
39 2019-03-01 Zalan Bujtas <zalan@apple.com>
41 [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
42 https://bugs.webkit.org/show_bug.cgi?id=195220
43 <rdar://problem/48518979>
45 Reviewed by Simon Fraser.
47 didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
48 when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
49 Let's just check if we've got a pending style recalc when the DOM timer comes back.
51 Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
54 (WebCore::Document::scheduleStyleRecalc):
55 * page/ios/ContentChangeObserver.cpp:
56 (WebCore::hasPendingStyleRecalc):
57 (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
58 (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
59 (WebCore::ContentChangeObserver::startObservingContentChanges):
60 (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
61 * page/ios/ContentChangeObserver.h:
62 (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
63 (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
64 (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
66 2019-03-01 John Wilander <wilander@apple.com>
68 Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
69 https://bugs.webkit.org/show_bug.cgi?id=195196
70 <rdar://problem/48006419>
72 Reviewed by Brent Fulgham.
74 Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
75 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
76 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
77 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
78 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
80 Trackers abuse link query parameters to transport user identifiers cross-site.
81 This patch detects such navigations and applies further restrictions to
82 client-site cookies on the destination page.
84 * platform/network/NetworkStorageSession.cpp:
85 (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
86 Now sets the regular 7-day cap and a reduced 1-day cap.
87 (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
88 Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
89 NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
90 it now clears out two types of page-specific data.
91 (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
92 This function receives a cross-site navigation and checks if the originating
93 site is a prevalent resource. If so, it marks the page or stricter cookie
95 (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
96 Test infrastructure. This sets a state that overrides the regular per-page
97 clear of data. The reason is that the double clear was racy and caused test
99 (WebCore::NetworkStorageSession::clientSideCookieCap const):
100 New function that returns the current cookie lifetime cap.
101 (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
102 Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
103 * platform/network/NetworkStorageSession.h:
104 * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
105 (WebCore::NetworkStorageSession::setCookiesFromDOM const):
106 Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
108 2019-03-01 Rob Buis <rbuis@igalia.com>
110 Adjust XMLHttpRequest Content-Type handling
111 https://bugs.webkit.org/show_bug.cgi?id=184645
113 Reviewed by Youenn Fablet.
115 Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
117 Test: web-platform-tests/xhr/send-content-type-charset.htm
119 [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
121 * platform/network/ParsedContentType.cpp:
122 (WebCore::ParsedContentType::setCharset):
123 * platform/network/ParsedContentType.h:
124 * xml/XMLHttpRequest.cpp:
125 (WebCore::replaceCharsetInMediaTypeIfNeeded):
126 (WebCore::XMLHttpRequest::send):
127 (WebCore::replaceCharsetInMediaType): Deleted.
129 2019-03-01 Youenn Fablet <youenn@apple.com>
131 Update originsMatch to handle the case of file origins which enforce file path separation
132 https://bugs.webkit.org/show_bug.cgi?id=195216
134 Reviewed by Brady Eidson.
136 Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
137 Make sure originsMatch returns true if either compared origins are the same object
138 or they have the same file path separation behavior.
140 * page/SecurityOrigin.cpp:
141 (WebCore::areOriginsMatching):
142 (WebCore::originsMatch):
144 2019-03-01 Youenn Fablet <youenn@apple.com>
146 Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
147 https://bugs.webkit.org/show_bug.cgi?id=195213
149 Reviewed by Alex Christensen.
151 Add traits to enable enum IPC encoding.
152 No change of behavior.
154 * Modules/indexeddb/IndexedDB.h:
156 2019-03-01 Don Olmstead <don.olmstead@sony.com>
158 [WinCairo] Enable service worker
159 https://bugs.webkit.org/show_bug.cgi?id=188318
161 Reviewed by Youenn Fablet.
164 * testing/ServiceWorkerInternals.h:
165 * workers/service/context/SWContextManager.cpp:
166 (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
167 * workers/service/context/SWContextManager.h:
169 2019-03-01 Sihui Liu <sihui_liu@apple.com>
171 Add a quirk for bostongloble.com and latimes.com
172 https://bugs.webkit.org/show_bug.cgi?id=195155
174 Reviewed by Geoffrey Garen.
176 Covered by manual testing.
178 * Modules/webdatabase/DOMWindowWebDatabase.idl:
179 * bindings/scripts/CodeGeneratorJS.pm:
180 (GenerateRuntimeEnableConditionalString):
181 * bindings/scripts/IDLAttributes.json:
182 * bindings/scripts/preprocess-idls.pl:
183 (GenerateConstructorAttributes):
185 (WebCore::Quirks::hasWebSQLSupportQuirk const):
188 2019-03-01 Zalan Bujtas <zalan@apple.com>
190 [ContentChangeObserver] Rename members and move implementation to header.
191 https://bugs.webkit.org/show_bug.cgi?id=195198
192 <rdar://problem/48499967>
194 Reviewed by Simon Fraser.
196 * page/ios/ContentChangeObserver.cpp:
197 (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
198 (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
199 (WebCore::ContentChangeObserver::startObservingStyleRecalc):
200 (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
201 (WebCore::ContentChangeObserver::startObservingContentChanges):
202 (WebCore::ContentChangeObserver::stopObservingContentChanges):
203 (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
204 (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
205 (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
206 (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
207 (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
208 (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
209 (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
210 (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
211 (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
212 (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
213 (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
214 (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
215 (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
216 (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
217 (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
218 (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
219 * page/ios/ContentChangeObserver.h:
220 (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
221 (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
222 (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
223 (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
224 (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
225 (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
226 (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
227 (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
228 (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
229 (WebCore::ContentChangeObserver::isObservingContentChanges const):
230 (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
231 (WebCore::ContentChangeObserver::clearObservedDOMTimers):
233 2019-03-01 Zalan Bujtas <zalan@apple.com>
235 [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
236 https://bugs.webkit.org/show_bug.cgi?id=195197
237 <rdar://problem/48498332>
239 Reviewed by Simon Fraser.
241 Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
243 * page/ios/ContentChangeObserver.cpp:
244 (WebCore::ContentChangeObserver::didContentVisibilityChange):
245 (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
246 * page/ios/ContentChangeObserver.h:
248 2019-03-01 Jer Noble <jer.noble@apple.com>
250 [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
251 https://bugs.webkit.org/show_bug.cgi?id=195217
253 Reviewed by Eric Carlson.
255 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
256 (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
258 2019-03-01 Justin Fan <justin_fan@apple.com>
260 [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
261 https://bugs.webkit.org/show_bug.cgi?id=195191
263 Rubber-stamped by Dean Jackson.
265 Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
267 * Configurations/FeatureDefines.xcconfig:
269 2019-02-28 Fujii Hironori <Hironori.Fujii@sony.com>
271 HTTPSUpgradeList.db database should be opened in readonly mode
272 https://bugs.webkit.org/show_bug.cgi?id=195194
273 <rdar://problem/47103889>
275 Unreviewed build fix for curl.
277 * platform/network/curl/CookieJarDB.cpp:
278 (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
280 2019-02-28 Chris Dumez <cdumez@apple.com>
282 Unreviewed Windows build fix after r242251.
284 * platform/win/SearchPopupMenuDB.cpp:
285 (WebCore::SearchPopupMenuDB::openDatabase):
287 2019-02-28 Zalan Bujtas <zalan@apple.com>
289 [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
290 https://bugs.webkit.org/show_bug.cgi?id=195143
291 <rdar://problem/48462351>
293 Reviewed by Simon Fraser.
295 Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
298 (WebCore::DOMTimer::removeById):
299 * page/DOMWindow.cpp:
300 (WebCore::DOMWindow::clearTimeout):
301 * page/ios/ContentChangeObserver.cpp:
302 (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
303 (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
304 (WebCore::ContentChangeObserver::didRemoveDOMTimer):
305 (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
306 * page/ios/ContentChangeObserver.h:
308 2019-02-28 Chris Dumez <cdumez@apple.com>
310 HTTPSUpgradeList.db database should be opened in readonly mode
311 https://bugs.webkit.org/show_bug.cgi?id=195194
312 <rdar://problem/47103889>
314 Reviewed by Youenn Fablet.
316 Add parameter to SQLiteDatabase::open() to specific the open flags.
318 * Modules/webdatabase/Database.cpp:
319 (WebCore::Database::performOpenAndVerify):
320 * platform/sql/SQLiteDatabase.cpp:
321 (WebCore::SQLiteDatabase::open):
322 * platform/sql/SQLiteDatabase.h:
323 * platform/sql/SQLiteFileSystem.cpp:
324 * platform/sql/SQLiteFileSystem.h:
326 2019-02-28 Brady Eidson <beidson@apple.com>
329 Universal links from Google search results pages don't open the app
330 https://bugs.webkit.org/show_bug.cgi?id=195126
334 * page/SecurityOrigin.cpp:
335 (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
337 2019-02-28 Simon Fraser <simon.fraser@apple.com>
339 [iOS] Dark flash when opening Google AMP pages
340 https://bugs.webkit.org/show_bug.cgi?id=195193
341 rdar://problem/48326442
343 Reviewed by Zalan Bujtas.
345 After the incremental compositing updates changes, it was possible for a change in the size
346 of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
347 a composited descendant that is not a descendant in z-order. When Google search results
348 create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
349 leaving the #222 background of an intermediate element visible.
351 Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
352 that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
353 this flag affects all descendants; in future, we might be able to clear it for grand-children.
355 Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
356 compositing/geometry/ancestor-clip-change.html
358 * rendering/RenderLayer.cpp:
359 (WebCore::RenderLayer::updateLayerPositions):
360 (WebCore::RenderLayer::updateLayerPosition):
361 * rendering/RenderLayer.h:
362 * rendering/RenderLayerBacking.cpp:
363 (WebCore::RenderLayerBacking::updateAfterLayout):
364 * rendering/RenderLayerBacking.h:
366 2019-02-28 Myles C. Maxfield <mmaxfield@apple.com>
368 Use-after-move in RenderCombineText::combineTextIfNeeded()
369 https://bugs.webkit.org/show_bug.cgi?id=195188
371 Reviewed by Zalan Bujtas.
373 r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
374 symptom, but this patch fixes the source of the problem (and reverts r242204).
376 The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
378 FontDescription bestFitDescription;
380 FontCascade compressedFont(WTFMove(bestFitDescription), ...);
384 Clearly this is wrong.
386 Test: fast/text/text-combine-crash-2.html
388 * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
389 (WebCore::FontDescription::platformResolveGenericFamily):
390 * rendering/RenderCombineText.cpp:
391 (WebCore::RenderCombineText::combineTextIfNeeded):
393 2019-02-28 Zalan Bujtas <zalan@apple.com>
395 [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
396 https://bugs.webkit.org/show_bug.cgi?id=195172
397 <rdar://problem/48479259>
399 Reviewed by Simon Fraser.
401 Let's scope start/stopObserving call pairs.
404 (WebCore::Document::updateStyleIfNeeded):
406 (WebCore::DOMTimer::fired):
407 * page/ios/ContentChangeObserver.cpp:
408 (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
409 (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
410 (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
411 (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
412 (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
413 (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
414 (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
415 (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
416 * page/ios/ContentChangeObserver.h:
417 * rendering/updating/RenderTreeUpdater.cpp:
418 (WebCore::RenderTreeUpdater::updateElementRenderer):
420 2019-02-28 Antoine Quint <graouts@apple.com>
422 Enable the Pointer Events runtime flag by default
423 https://bugs.webkit.org/show_bug.cgi?id=195156
425 Reviewed by Dean Jackson.
427 * page/RuntimeEnabledFeatures.h:
429 2019-02-28 Zalan Bujtas <zalan@apple.com>
431 [ContentChangeObserver] Make observed state reset explicit.
432 https://bugs.webkit.org/show_bug.cgi?id=195185
433 <rdar://problem/48488342>
435 Reviewed by Simon Fraser.
437 Use setObservedContentChange only for setting the observed change while observing.
439 * page/ios/ContentChangeObserver.cpp:
440 (WebCore::ContentChangeObserver::startObservingContentChanges):
441 (WebCore::ContentChangeObserver::resetObservedContentChange):
442 (WebCore::ContentChangeObserver::removeObservedDOMTimer):
443 * page/ios/ContentChangeObserver.h:
445 2019-02-28 Commit Queue <commit-queue@webkit.org>
447 Unreviewed, rolling out r242210.
448 https://bugs.webkit.org/show_bug.cgi?id=195179
450 it broke hover menus on losaltosonline.com (Requested by zalan
455 "[ContentChangeObserver] Move timer removal code from
456 DOMWindow::clearTimeout to DOMTimer::removeById"
457 https://bugs.webkit.org/show_bug.cgi?id=195143
458 https://trac.webkit.org/changeset/242210
460 2019-02-28 Zalan Bujtas <zalan@apple.com>
462 [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
463 https://bugs.webkit.org/show_bug.cgi?id=195143
464 <rdar://problem/48462351>
466 Reviewed by Simon Fraser.
468 Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
471 (WebCore::DOMTimer::removeById):
472 * page/DOMWindow.cpp:
473 (WebCore::DOMWindow::clearTimeout):
474 * page/ios/ContentChangeObserver.cpp:
475 (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
476 (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
477 (WebCore::ContentChangeObserver::didRemoveDOMTimer):
478 (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
479 * page/ios/ContentChangeObserver.h:
481 2019-02-28 Charles Vazac <cvazac@akamai.com>
483 Fix Resource Timing buffer edge cases for WPT
484 https://bugs.webkit.org/show_bug.cgi?id=193213
486 Reviewed by Youenn Fablet.
488 Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
490 * page/Performance.cpp:
491 (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
492 resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
493 expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
494 the secondary buffer.
496 2019-02-28 Takashi Komori <Takashi.Komori@sony.com>
498 [Curl] HTTP Body is missing with redirection.
499 https://bugs.webkit.org/show_bug.cgi?id=191651
501 Reviewed by Don Olmstead.
503 Implement updateFromDelegatePreservingOldProperties for curl port.
505 Tests: http/tests/navigation/post-301-response.html
506 http/tests/navigation/post-302-response.html
507 http/tests/navigation/post-303-response.html
508 http/tests/navigation/post-307-response.html
509 http/tests/navigation/post-308-response.html
511 * platform/Curl.cmake:
512 * platform/network/curl/ResourceRequest.h:
513 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
514 * platform/network/curl/ResourceRequestCurl.cpp: Added.
515 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
517 2019-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
519 [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
520 https://bugs.webkit.org/show_bug.cgi?id=195159
522 Reviewed by Don Olmstead.
524 Use COORDINATED_GRAPHICS instead.
526 * platform/graphics/GraphicsContext3D.h:
527 * platform/graphics/PlatformLayer.h:
528 * platform/graphics/cairo/ImageBufferCairo.cpp:
529 (WebCore::ImageBufferData::ImageBufferData):
530 (WebCore::ImageBufferData::~ImageBufferData):
531 * platform/graphics/cairo/ImageBufferDataCairo.h:
532 * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
533 * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
534 * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
535 (Nicosia::GC3DLayer::swapBuffersIfNeeded):
536 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
537 (WebCore::GraphicsContext3D::reshapeFBOs):
538 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
539 (WebCore::GraphicsContext3D::prepareTexture):
540 * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
541 (WebCore::GraphicsContext3D::reshapeFBOs):
542 * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
543 (WebCore::GraphicsContext3D::GraphicsContext3D):
544 (WebCore::GraphicsContext3D::~GraphicsContext3D):
545 * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
546 (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
547 (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
548 * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
549 * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
550 * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
551 * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
552 * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
553 * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
554 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
555 (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
556 (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
557 (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
558 * rendering/RenderLayerBacking.cpp:
559 (WebCore::RenderLayerBacking::paintsIntoWindow const):
560 * rendering/RenderLayerCompositor.cpp:
561 (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
563 2019-02-28 Myles C. Maxfield <mmaxfield@apple.com>
565 Locale names can be nullptr
566 https://bugs.webkit.org/show_bug.cgi?id=195171
567 <rdar://problem/48262376>
569 Reviewed by Dean Jackson.
571 Nullptr can't be used in keys to HashMaps, so take an early out in this case.
573 This is a partial revert of r241288.
575 * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
576 (WebCore::FontDescription::platformResolveGenericFamily):
578 2019-02-28 Justin Fan <justin_fan@apple.com>
580 [Web GPU] Enable Web GPU only on 64-bit
581 https://bugs.webkit.org/show_bug.cgi?id=195139
583 Because Metal is only supported on 64 bit apps.
585 Unreviewed build fix.
587 * Configurations/FeatureDefines.xcconfig:
589 2019-02-27 Zalan Bujtas <zalan@apple.com>
591 [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
592 https://bugs.webkit.org/show_bug.cgi?id=195128
593 <rdar://problem/48456752>
595 Reviewed by Simon Fraser.
597 Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
599 * WebCore.xcodeproj/project.pbxproj:
600 * page/ios/ContentChangeObserver.mm:
601 (WebCore::ContentChangeObserver::setObservedContentChange):
602 * platform/ios/wak/WKContentObservation.cpp:
603 (WKSetObservedContentChange):
604 * platform/ios/wak/WKContentObservation.h:
605 * platform/ios/wak/WKContentObservationInternal.h: Removed.
607 2019-02-27 Simon Fraser <simon.fraser@apple.com>
609 Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
612 (WebCore::Document::lastModified const):
613 * html/FTPDirectoryDocument.cpp:
614 (WebCore::processFileDateString):
615 * mathml/MathMLElement.cpp:
616 (WebCore::convertToPercentageIfNeeded):
617 (WebCore::MathMLElement::collectStyleForPresentationAttribute):
618 * page/cocoa/ResourceUsageOverlayCocoa.mm:
619 (WebCore::ResourceUsageOverlay::platformDraw):
620 * page/linux/ResourceUsageOverlayLinux.cpp:
621 (WebCore::cpuUsageString):
622 (WebCore::gcTimerString):
623 * platform/DateComponents.cpp:
624 (WebCore::DateComponents::toStringForTime const):
625 (WebCore::DateComponents::toString const):
626 * platform/LocalizedStrings.cpp:
627 (WebCore::localizedString):
628 * platform/audio/HRTFElevation.cpp:
629 (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
630 * platform/mock/MockRealtimeVideoSource.cpp:
631 (WebCore::MockRealtimeVideoSource::drawText):
632 * rendering/RenderLayerCompositor.cpp:
633 (WebCore::RenderLayerCompositor::logLayerInfo):
634 * rendering/RenderTheme.cpp:
635 (WebCore::RenderTheme::formatMediaControlsTime const):
637 2019-02-27 Zalan Bujtas <zalan@apple.com>
639 [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
640 https://bugs.webkit.org/show_bug.cgi?id=195091
641 <rdar://problem/48427271>
643 Reviewed by Tim Horton.
645 * page/ios/ContentChangeObserver.h:
646 * page/ios/ContentChangeObserver.mm:
647 (WebCore::ContentChangeObserver::startObservingContentChanges):
648 (WebCore::ContentChangeObserver::stopObservingContentChanges):
649 (WebCore::ContentChangeObserver::isObservingContentChanges):
650 * platform/ios/wak/WKContentObservation.cpp:
651 (WKObservingContentChanges): Deleted.
652 (WKStartObservingContentChanges): Deleted.
653 (WKStopObservingContentChanges): Deleted.
654 * platform/ios/wak/WKContentObservation.h:
655 * platform/ios/wak/WKContentObservationInternal.h:
657 2019-02-27 Brady Eidson <beidson@apple.com>
659 Universal links from Google search results pages don't open the app.
660 <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
662 Reviewed by Geoffrey Garen.
664 Covered by new API tests.
666 * loader/DocumentLoader.cpp:
667 (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
668 an iframe if it is from the same security origin as the main frame.
670 2019-02-27 Zalan Bujtas <zalan@apple.com>
672 [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
673 https://bugs.webkit.org/show_bug.cgi?id=195090
674 <rdar://problem/48426771>
676 Reviewed by Tim Horton.
678 Also remove some unused functions from WKContentObservationInternal.
680 * page/ios/ContentChangeObserver.h:
681 * page/ios/ContentChangeObserver.mm:
682 (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
683 (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
684 (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
685 * platform/ios/wak/WKContentObservation.cpp:
686 (WKStartObservingDOMTimerScheduling): Deleted.
687 (WKStopObservingDOMTimerScheduling): Deleted.
688 (WKIsObservingDOMTimerScheduling): Deleted.
689 * platform/ios/wak/WKContentObservation.h:
690 * platform/ios/wak/WKContentObservationInternal.h:
692 2019-02-27 Zalan Bujtas <zalan@apple.com>
694 [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
695 https://bugs.webkit.org/show_bug.cgi?id=195087
697 Reviewed by Simon Fraser.
699 Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
701 * page/ios/ContentChangeObserver.h:
702 * page/ios/ContentChangeObserver.mm:
703 (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
704 (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
705 (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
706 (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
707 (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
708 (WebCore::ContentChangeObserver::setObservedContentChange):
709 * platform/ios/wak/WKContentObservation.cpp:
710 (WKSetObservedContentChange):
711 (WKStartObservingStyleRecalcScheduling): Deleted.
712 (WKStopObservingStyleRecalcScheduling): Deleted.
713 (WKIsObservingStyleRecalcScheduling): Deleted.
714 (WKSetShouldObserveNextStyleRecalc): Deleted.
715 (WKShouldObserveNextStyleRecalc): Deleted.
716 * platform/ios/wak/WKContentObservation.h:
718 2019-02-27 Zalan Bujtas <zalan@apple.com>
720 [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
721 https://bugs.webkit.org/show_bug.cgi?id=195070
722 <rdar://problem/48417650>
724 Reviewed by Tim Horton.
726 Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
728 * page/ios/ContentChangeObserver.h:
729 * page/ios/ContentChangeObserver.mm:
730 (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
731 (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
732 (WebCore::ContentChangeObserver::clearObservedDOMTimers):
733 (WebCore::ContentChangeObserver::setObservedContentChange):
734 (WebCore::ContentChangeObserver::containsObservedDOMTimer):
735 (WebCore::ContentChangeObserver::addObservedDOMTimer):
736 (WebCore::ContentChangeObserver::removeObservedDOMTimer):
737 * platform/ios/wak/WKContentObservation.cpp:
738 (WKStartObservingDOMTimerScheduling):
739 (WKSetObservedContentChange):
740 (WebThreadGetObservedDOMTimers): Deleted.
741 (WebThreadCountOfObservedDOMTimers): Deleted.
742 (WebThreadClearObservedDOMTimers): Deleted.
743 (WebThreadContainsObservedDOMTimer): Deleted.
744 (WebThreadAddObservedDOMTimer): Deleted.
745 (WebThreadRemoveObservedDOMTimer): Deleted.
746 * platform/ios/wak/WKContentObservation.h:
748 2019-02-27 Justin Fan <justin_fan@apple.com>
749 Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
751 Unreviewed build fix.
753 * Modules/webgpu/WebGPUBuffer.cpp:
754 (WebCore::WebGPUBuffer::setSubData):
755 * Modules/webgpu/WebGPUBuffer.h:
756 * Modules/webgpu/WebGPUBufferBinding.h:
757 * Modules/webgpu/WebGPURenderPassEncoder.idl:
758 * platform/graphics/gpu/GPUBufferBinding.h:
759 * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
760 * platform/graphics/gpu/GPUVertexInputDescriptor.h:
762 2019-02-27 John Wilander <wilander@apple.com>
764 Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
765 https://bugs.webkit.org/show_bug.cgi?id=195071
766 <rdar://problem/48417690>
768 Reviewed by Alex Christensen and Brent Fulgham.
770 No new tests. This patch maintains functionality covered by plenty of layout
771 tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
773 This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
774 and makes the necessary infrastructure changes to support that.
776 The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
777 HashSets since we never used the counts for anything. This change simplified
778 encoding and decoding for IPC and will eventually simplify encoding and
779 decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
780 model version 14 and below.
782 The patch also makes WebCore::RegistrableDomain's String constructor private.
783 A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
784 is introduced to better signal to users that creating a registrable domain
785 object with a string may create an object that doesn't match a registrable
786 domain in a valid HTTP-family URL. This change (private String constructor)
787 motivated a change in WebCore::AdClickAttribution where the Source and
788 Destination structs now take a URL as parameter instead of a String.
790 Finally, this patch harmonizes parameter and variable naming, going from
791 "origin" to "domain" and "mainFrame" to "topFrame."
793 * html/HTMLAnchorElement.cpp:
794 (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
795 * html/HTMLMediaElement.cpp:
796 (WebCore::HTMLMediaElement::mediaSessionTitle const):
797 * loader/AdClickAttribution.h:
798 (WebCore::AdClickAttribution::Source::Source):
799 (WebCore::AdClickAttribution::Source::deletedValue):
800 (WebCore::AdClickAttribution::Destination::Destination):
801 (WebCore::AdClickAttribution::Destination::deletedValue):
802 (WebCore::AdClickAttribution::decode):
803 * loader/ResourceLoadObserver.cpp:
804 (WebCore::ResourceLoadObserver::logSubresourceLoading):
805 (WebCore::ResourceLoadObserver::logWebSocketLoading):
806 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
807 (WebCore::ResourceLoadObserver::statisticsForURL):
808 (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
809 * loader/ResourceLoadObserver.h:
810 * loader/ResourceLoadStatistics.cpp:
811 (WebCore::encodeHashSet):
812 (WebCore::ResourceLoadStatistics::encode const):
813 (WebCore::decodeHashCountedSet):
814 (WebCore::decodeHashSet):
815 (WebCore::ResourceLoadStatistics::decode):
816 (WebCore::appendHashSet):
817 (WebCore::ResourceLoadStatistics::toString const):
818 (WebCore::ResourceLoadStatistics::merge):
819 (WebCore::encodeHashCountedSet): Deleted.
820 (WebCore::encodeOriginHashSet): Deleted.
821 (WebCore::decodeOriginHashSet): Deleted.
822 (WebCore::appendHashCountedSet): Deleted.
823 * loader/ResourceLoadStatistics.h:
824 * platform/RegistrableDomain.h:
825 (WebCore::RegistrableDomain::uncheckedCreateFromString):
826 (WebCore::RegistrableDomain::RegistrableDomain):
827 * testing/Internals.cpp:
828 (WebCore::Internals::resourceLoadStatisticsForURL):
829 (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
830 * testing/Internals.h:
831 * testing/Internals.idl:
833 2019-02-27 Justin Fan <justin_fan@apple.com>
835 [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
836 https://bugs.webkit.org/show_bug.cgi?id=195077
837 <rdar://problem/47805229>
839 Reviewed by Dean Jackson.
841 Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be
842 used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
843 update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
845 Tests: webgpu/buffer-command-buffer-races.html
846 webgpu/map-read-buffers.html
848 * Modules/webgpu/WebGPUBindGroup.h:
849 (WebCore::WebGPUBindGroup::bindGroup const):
850 * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
851 (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
852 * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
853 (WebCore::WebGPUBuffer::setSubData):
854 (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
855 (WebCore::WebGPUBuffer::destroy):
856 (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
857 * Modules/webgpu/WebGPUBuffer.h:
858 (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
859 * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
860 * Modules/webgpu/WebGPUCommandBuffer.cpp:
861 (WebCore::WebGPUCommandBuffer::beginRenderPass):
862 * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
863 (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
864 * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
865 * Modules/webgpu/WebGPURenderPassEncoder.cpp:
866 (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
868 * WebCore.xcodeproj/project.pbxproj:
869 * platform/graphics/gpu/GPUBuffer.h:
870 (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
871 (WebCore::GPUBuffer::isVertex const):
872 (WebCore::GPUBuffer::isUniform const):
873 (WebCore::GPUBuffer::isStorage const):
874 (WebCore::GPUBuffer::isReadOnly const):
875 (WebCore::GPUBuffer::isMappable const):
876 (WebCore::GPUBuffer::isMapWrite const):
877 (WebCore::GPUBuffer::isMapRead const):
878 (WebCore::GPUBuffer::isMapWriteable const):
879 (WebCore::GPUBuffer::isMapReadable const):
880 * platform/graphics/gpu/GPUBufferBinding.h:
881 * platform/graphics/gpu/GPUCommandBuffer.h:
882 (WebCore::GPUCommandBuffer::usedBuffers const):
883 (WebCore::GPUCommandBuffer::useBuffer):
884 * platform/graphics/gpu/GPUDevice.cpp:
885 (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
886 (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
887 * platform/graphics/gpu/GPUDevice.h:
888 * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
889 (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
890 * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
891 (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
892 * platform/graphics/gpu/GPURenderPassEncoder.h:
893 * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
894 (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
895 (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
896 (WebCore::GPUBuffer::GPUBuffer):
897 (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
898 (WebCore::GPUBuffer::state const):
899 (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
900 (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
901 (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
902 (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
903 (WebCore::GPUBuffer::registerMappingCallback):
904 (WebCore::GPUBuffer::runMappingCallback):
905 (WebCore::GPUBuffer::unmap):
906 (WebCore::GPUBuffer::destroy):
907 (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
908 * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
909 (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
910 (WebCore::GPUProgrammablePassEncoder::setBindGroup):
911 * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
912 (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
913 * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
914 (WebCore::GPURenderPassEncoder::tryCreate):
915 (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
916 (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
917 (WebCore::GPURenderPassEncoder::create): Deleted.
919 Buffer size updates in the IDL:
920 * Modules/webgpu/GPUBufferDescriptor.idl:
921 * Modules/webgpu/WebGPUBuffer.idl:
922 * Modules/webgpu/WebGPUBufferBinding.idl:
923 * Modules/webgpu/WebGPUCommandBuffer.idl:
924 * Modules/webgpu/WebGPURenderPassEncoder.idl:
925 * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
926 * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
928 2019-02-27 Youenn Fablet <youenn@apple.com>
930 Remove LeetCode FetchRequest quirk
931 https://bugs.webkit.org/show_bug.cgi?id=195100
933 Reviewed by Alex Christensen.
935 Covered by manual testing.
937 * Modules/fetch/FetchRequest.cpp:
938 (WebCore::needsSignalQuirk):
940 2019-02-27 Chris Dumez <cdumez@apple.com>
942 Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
943 https://bugs.webkit.org/show_bug.cgi?id=195101
944 <rdar://problem/48423023>
946 Reviewed by Geoffrey Garen.
948 Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
949 tries to register a "devicemotion" event listener and fails because the API is disabled. This is
950 needed to unblock the site and proceed with the login flow.
952 Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
953 guard the quirk behind this flag.
955 * page/DOMWindow.cpp:
956 (WebCore::DOMWindow::addEventListener):
957 (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
960 2019-02-27 Antoine Quint <graouts@apple.com>
962 Support Pointer Events on macOS
963 https://bugs.webkit.org/show_bug.cgi?id=195008
964 <rdar://problem/47454419>
966 Reviewed by Dean Jackson.
968 We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
969 a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
970 exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
971 and the same behavior also extends to "pointerup".
973 Tests: pointerevents/mouse/over-enter-out-leave.html
974 pointerevents/mouse/pointer-capture.html
975 pointerevents/mouse/pointer-event-basic-properties.html
976 pointerevents/mouse/pointer-events-before-mouse-events.html
977 pointerevents/mouse/pointerdown-prevent-default.html
979 * Configurations/FeatureDefines.xcconfig:
980 * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
981 property does not have any effect on macOS.
982 (WebCore::Document::invalidateRenderingDependentRegions):
983 (WebCore::Document::nodeWillBeRemoved):
984 (WebCore::Document::updateTouchActionElements):
987 (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
988 If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
990 * dom/PointerEvent.cpp:
991 (WebCore::pointerEventType):
992 (WebCore::PointerEvent::create):
993 * dom/PointerEvent.h:
994 * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
995 (WebCore::hierarchyHasCapturingEventListeners):
996 (WebCore::EventHandler::updateMouseEventTargetNode):
997 * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
998 (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
999 (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
1000 pending target override needs to be considered to determine whether a given element has pointer capture enabled.
1001 (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
1003 * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
1004 * style/StyleTreeResolver.cpp:
1005 (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
1007 2019-02-27 Sihui Liu <sihui_liu@apple.com>
1009 Network Process is put to suspended when holding locked IndexedDB files
1010 https://bugs.webkit.org/show_bug.cgi?id=195024
1011 <rdar://problem/45194169>
1013 Reviewed by Geoffrey Garen.
1015 We found network process was suspended when IDBDatabase was being closed in the background database thread,
1016 holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by
1017 taking background assertion in UI process until the closes are done and locks are released.
1019 * Modules/indexeddb/server/IDBServer.cpp:
1020 (WebCore::IDBServer::IDBServer::create):
1021 (WebCore::IDBServer::IDBServer::IDBServer):
1022 (WebCore::IDBServer::IDBServer::createBackingStore):
1023 (WebCore::IDBServer::IDBServer::closeDatabase):
1024 (WebCore::IDBServer::IDBServer::didCloseDatabase):
1025 * Modules/indexeddb/server/IDBServer.h:
1026 (WebCore::IDBServer::IDBServer::create):
1027 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1028 (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1029 (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1030 (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1031 (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1032 (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1033 (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
1034 * Modules/indexeddb/server/UniqueIDBDatabase.h:
1036 2019-02-26 Simon Fraser <simon.fraser@apple.com>
1038 Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1039 https://bugs.webkit.org/show_bug.cgi?id=194973
1041 Reviewed by Antti Koivisto.
1043 This patch cleans up how the scrolling tree responds to scrolls.
1045 First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1046 UI process scroll position.
1048 On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1049 bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1050 update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1051 updates related layers on this node (counter-scrolling layers etc), and then tells the
1052 scrolling tree, which recurses through descendant nodes so they can adjust their layer
1055 On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1056 which does the above other than setting scrolledContentsLayer (since we're reacting to
1057 layer state changes, not producing them).
1059 updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1060 ScrollingTree does the tree walk so classes don't have to implement
1061 updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1062 how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1063 need to cross frame boundaries).
1065 We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1066 since the fixed state was computed with the "layout" scroll position, so we have to account
1067 for the scroll delta since the last committed position. It's possible we could improve this
1070 * page/scrolling/ScrollingTree.cpp:
1071 (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1072 (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
1073 (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
1074 (WebCore::ScrollingTree::mainFrameLayoutViewport):
1075 (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
1076 * page/scrolling/ScrollingTree.h:
1077 * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1078 (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
1079 * page/scrolling/ScrollingTreeFrameHostingNode.h:
1080 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1081 (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
1082 (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
1083 * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1084 * page/scrolling/ScrollingTreeNode.cpp:
1085 (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
1086 (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
1087 * page/scrolling/ScrollingTreeNode.h:
1088 * page/scrolling/ScrollingTreeScrollingNode.cpp:
1089 (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
1090 (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
1091 (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
1092 (WebCore::ScrollingTreeScrollingNode::scrollBy):
1093 (WebCore::ScrollingTreeScrollingNode::scrollTo):
1094 (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
1095 (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
1096 (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
1097 (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
1098 (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
1099 * page/scrolling/ScrollingTreeScrollingNode.h:
1100 * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
1101 (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
1102 (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
1103 * page/scrolling/ThreadedScrollingTree.cpp:
1104 (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1105 * page/scrolling/ThreadedScrollingTree.h:
1106 * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1107 * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1108 (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
1109 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
1110 * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1111 * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1112 (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
1113 (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
1114 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1115 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1116 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1117 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1118 (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1119 (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
1120 (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
1121 (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1122 (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
1123 (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
1124 (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
1125 (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
1126 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
1127 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
1128 (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
1129 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1131 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1132 (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
1133 (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
1134 (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
1135 (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
1136 (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
1137 (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
1138 (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
1139 (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
1140 * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1141 (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
1142 (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
1143 (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
1144 (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
1145 (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
1146 (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
1148 2019-02-22 Simon Fraser <simon.fraser@apple.com>
1150 Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1151 https://bugs.webkit.org/show_bug.cgi?id=194973
1153 Reviewed by Antti Koivisto.
1155 The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
1156 layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
1157 and require different code for each scrolling node subclass, and adds a choke point that we can use to update
1158 the layout viewport.
1160 We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
1161 an alias for the scroll position.
1163 Add some isRootNode() checks for things that should only affect the main frame.
1165 * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
1167 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1168 (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
1169 * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1170 (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
1171 (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
1172 (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
1173 * page/scrolling/ScrollingTreeScrollingNode.cpp:
1174 (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
1175 (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
1176 (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
1177 * page/scrolling/ScrollingTreeScrollingNode.h:
1178 (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
1179 * page/scrolling/ios/ScrollingTreeIOS.cpp:
1180 (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
1181 * page/scrolling/ios/ScrollingTreeIOS.h:
1182 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1183 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1184 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1185 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1186 (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1187 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1188 (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
1189 (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
1190 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1191 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1192 (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
1194 2019-02-27 Ulrich Pflueger <up@nanocosmos.de>
1196 [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
1197 https://bugs.webkit.org/show_bug.cgi?id=194747
1198 <rdar://problem/48148469>
1200 Reviewed by Jer Noble.
1202 Prevent unintended frame drops by including last frame duration in discontinuity check.
1204 Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
1206 * Modules/mediasource/SourceBuffer.cpp:
1207 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1209 2019-02-27 Timothy Hatcher <timothy@apple.com>
1211 REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
1212 https://bugs.webkit.org/show_bug.cgi?id=195086
1213 rdar://problem/48419124
1215 Reviewed by Tim Horton.
1217 * platform/mac/ScrollAnimatorMac.mm:
1218 (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
1220 2019-02-26 Wenson Hsieh <wenson_hsieh@apple.com>
1222 Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
1223 https://bugs.webkit.org/show_bug.cgi?id=195067
1224 <rdar://problem/44812080>
1226 Reviewed by Tim Horton.
1228 This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
1229 would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
1230 by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
1231 really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
1232 specific guards around this logic.
1234 Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
1235 a very subtle behavior change covered by the new layout test below.
1237 Test: editing/undo/redo-text-insertion-in-non-editable-node.html
1239 * editing/InsertIntoTextNodeCommand.cpp:
1240 (WebCore::InsertIntoTextNodeCommand::doReapply):
1241 * editing/InsertIntoTextNodeCommand.h:
1243 2019-02-26 Keith Miller <keith_miller@apple.com>
1245 Code quality cleanup in NeverDestroyed
1246 https://bugs.webkit.org/show_bug.cgi?id=194824
1248 Reviewed by Mark Lam.
1250 name_names.pl should not just assume the layout of LazyNeverDestroyed.
1252 * dom/make_names.pl:
1253 (printNamesCppFile):
1255 2019-02-26 Zalan Bujtas <zalan@apple.com>
1257 Do not try to observe the timer when Page is nullptr
1258 https://bugs.webkit.org/show_bug.cgi?id=195076
1260 Reviewed by Tim Horton.
1262 Covered by fast/dom/Window/timer-null-script-execution-context.html.
1264 * page/DOMTimer.cpp:
1265 (WebCore::DOMTimer::install):
1267 2019-02-20 Jer Noble <jer.noble@apple.com>
1269 [Cocoa] Media elements will restart network buffering just before suspending
1270 https://bugs.webkit.org/show_bug.cgi?id=193691
1272 Reviewed by Eric Carlson.
1274 API Test: WebKit.ProcessSuspendMediaBuffering
1276 Allow the Page to suspend all media buffering in its child Documents.
1279 (WebCore::Document::suspendAllMediaBuffering):
1280 (WebCore::Document::resumeAllMediaBuffering):
1282 * html/MediaElementSession.cpp:
1283 (WebCore::MediaElementSession::dataBufferingPermitted const):
1284 (WebCore::MediaElementSession::suspendBuffering):
1285 (WebCore::MediaElementSession::resumeBuffering):
1286 (WebCore::MediaElementSession::bufferingSuspended const):
1287 * html/MediaElementSession.h:
1289 (WebCore::Page::suspendAllMediaBuffering):
1290 (WebCore::Page::resumeAllMediaBuffering):
1292 (WebCore::Page::mediaPlaybackIsSuspended const):
1293 (WebCore::Page::mediaBufferingIsSuspended const):
1294 (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
1295 * platform/audio/PlatformMediaSession.h:
1296 (WebCore::PlatformMediaSession::suspendBuffering):
1297 (WebCore::PlatformMediaSession::resumeBuffering):
1298 * platform/audio/PlatformMediaSessionManager.cpp:
1299 (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
1300 (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
1301 * platform/audio/PlatformMediaSessionManager.h:
1303 2019-02-26 Youenn Fablet <youenn@apple.com>
1305 Move service worker response validation from the service worker client to the service worker itself
1306 https://bugs.webkit.org/show_bug.cgi?id=194716
1308 Reviewed by Geoffrey Garen.
1310 Added response validation at service worker side.
1312 No change of behavior except for now logging validation error messages in the console.
1313 Covered by rebased tests.
1315 * workers/service/context/ServiceWorkerFetch.cpp:
1316 (WebCore::ServiceWorkerFetch::validateResponse):
1317 (WebCore::ServiceWorkerFetch::processResponse):
1318 (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1320 2019-02-26 Sihui Liu <sihui_liu@apple.com>
1322 [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
1323 https://bugs.webkit.org/show_bug.cgi?id=195036
1325 Reviewed by Geoffrey Garen.
1327 When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but
1328 also transactions in committing process.
1330 Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise
1331 there is a reference cycle of TransactionOpration.
1333 Covered by existing tests storage/indexeddb/IDBObject-leak.html.
1335 * Modules/indexeddb/IDBDatabase.cpp:
1336 (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
1337 * Modules/indexeddb/IDBTransaction.cpp:
1338 (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
1339 * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1340 (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
1341 * Modules/indexeddb/client/IDBConnectionProxy.h:
1342 * Modules/indexeddb/client/TransactionOperation.h:
1343 (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the
1344 operation is in completion process.
1346 2019-02-26 Zalan Bujtas <zalan@apple.com>
1348 [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
1349 https://bugs.webkit.org/show_bug.cgi?id=195066
1350 <rdar://problem/48411682>
1352 Reviewed by Tim Horton.
1354 Now all the empty clearContentChangeObservers() implementations can be removed.
1357 (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1358 * loader/EmptyClients.h:
1359 * page/ChromeClient.h:
1361 (WebCore::Frame::willDetachPage):
1362 * page/ios/ContentChangeObserver.h:
1363 * page/ios/ContentChangeObserver.mm:
1364 (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1365 (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
1366 (WebCore::ContentChangeObserver::willDetachPage):
1368 2019-02-26 Zalan Bujtas <zalan@apple.com>
1370 [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
1371 https://bugs.webkit.org/show_bug.cgi?id=195062
1372 <rdar://problem/48409258>
1374 Reviewed by Tim Horton.
1376 Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
1379 (WebCore::Document::scheduleStyleRecalc):
1380 * page/DOMTimer.cpp:
1381 (WebCore::DOMTimer::install):
1382 * page/ios/ContentChangeObserver.h:
1383 * page/ios/ContentChangeObserver.mm:
1384 (WebCore::ContentChangeObserver::didInstallDOMTimer):
1385 (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
1386 (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
1388 2019-02-26 Chris Dumez <cdumez@apple.com>
1390 [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
1391 https://bugs.webkit.org/show_bug.cgi?id=195054
1392 <rdar://problem/48330549>
1394 Reviewed by Geoff Garen.
1396 Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
1398 * page/MemoryRelease.cpp:
1399 (WebCore::releaseNoncriticalMemory):
1400 (WebCore::releaseCriticalMemory):
1401 (WebCore::releaseMemory):
1402 * page/MemoryRelease.h:
1404 2019-02-26 Commit Queue <commit-queue@webkit.org>
1406 Unreviewed, rolling out r241970.
1407 https://bugs.webkit.org/show_bug.cgi?id=195057
1409 made the QuickLook.LegacyQuickLookContent API test flakey
1410 (Requested by estes on #webkit).
1414 "[iOS] Break a reference cycle between PreviewLoader and
1416 https://bugs.webkit.org/show_bug.cgi?id=194964
1417 https://trac.webkit.org/changeset/241970
1419 2019-02-26 Zalan Bujtas <zalan@apple.com>
1421 [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
1422 https://bugs.webkit.org/show_bug.cgi?id=195023
1423 <rdar://problem/48381885>
1425 Reviewed by Tim Horton.
1427 In the future we might decide that certain activities don't require DOMTimer observation, but that should
1428 be internal to ContentChangeObserver.
1430 * page/ios/ContentChangeObserver.h:
1431 * page/ios/ContentChangeObserver.mm:
1432 (WebCore::ContentChangeObserver::startObservingContentChanges):
1433 (WebCore::ContentChangeObserver::stopObservingContentChanges):
1434 * page/ios/EventHandlerIOS.mm:
1435 (WebCore::EventHandler::mouseMoved):
1437 2019-02-26 Zalan Bujtas <zalan@apple.com>
1439 [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
1440 https://bugs.webkit.org/show_bug.cgi?id=195032
1441 <rdar://problem/48388063>
1443 Reviewed by Tim Horton.
1445 This might eventually turn into a regular start/stop content observing call.
1448 (WebCore::Document::updateStyleIfNeeded):
1449 * page/ios/ContentChangeObserver.h:
1450 * page/ios/ContentChangeObserver.mm:
1451 (WebCore::ContentChangeObserver::startObservingStyleResolve):
1452 (WebCore::ContentChangeObserver::stopObservingStyleResolve):
1454 2019-02-26 Zalan Bujtas <zalan@apple.com>
1456 [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
1457 https://bugs.webkit.org/show_bug.cgi?id=195035
1458 <rdar://problem/48389123>
1460 Reviewed by Tim Horton.
1462 Visibility checking logic belongs to ContentChangeObserver.
1464 * page/ios/ContentChangeObserver.h:
1465 * page/ios/ContentChangeObserver.mm:
1466 (WebCore::elementImplicitVisibility):
1467 (WebCore::ContentChangeObserver::StyleChange::StyleChange):
1468 (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
1469 * rendering/updating/RenderTreeUpdater.cpp:
1470 (WebCore::RenderTreeUpdater::updateElementRenderer):
1471 (WebCore::elementImplicitVisibility): Deleted.
1472 (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
1473 (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
1475 2019-02-26 Philippe Normand <pnormand@igalia.com>
1477 [EGL] Runtime support for RGB565 pixel layout
1478 https://bugs.webkit.org/show_bug.cgi?id=194817
1480 Reviewed by Carlos Garcia Campos.
1482 Currently our graphics pipeline always relies on a ARGB8888 (32
1483 bpp) pixel configuration. On some low-end (old) embedded platforms
1484 the graphics driver is sometimes optimized for 16 bpp
1485 configurations, such as RGB565. On those platforms the application
1486 can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
1487 "RGB565" to adjust to the best pixel configuration supported by
1488 the screen and graphics driver.
1490 * platform/graphics/egl/GLContextEGL.cpp:
1491 (WebCore::GLContextEGL::getEGLConfig):
1493 2019-02-26 Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
1495 [WPE] Add API for webview background color configuration
1496 https://bugs.webkit.org/show_bug.cgi?id=192305
1498 Reviewed by Michael Catanzaro.
1500 Adapt the FrameView API to allow a default non-white background color.
1503 (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
1505 * page/FrameView.cpp:
1506 (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
1507 (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
1508 used only in non-dark-mode-css build configurations.
1510 * testing/Internals.cpp:
1511 (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
1513 2019-02-25 Yongjun Zhang <yongjun_zhang@apple.com>
1515 scalableNativeWebpageParameters() is not preserved on new page navigation.
1516 https://bugs.webkit.org/show_bug.cgi?id=194892
1517 <rdar://problem/47538280>
1519 If a page's current default viewport configuration is scalableNativeWebpageParameters due to
1520 the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
1521 configuration until we derive the right values from viewport meta-tag.
1523 Reviewed by Wenson Hsieh.
1525 Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
1527 * page/ViewportConfiguration.cpp:
1528 (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
1529 (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
1530 (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
1531 based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
1532 (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
1533 (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
1534 * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
1535 static method to fixedNativeWebpageParameters which better reflects the actual behavior.
1537 2019-02-25 Zalan Bujtas <zalan@apple.com>
1539 [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
1540 https://bugs.webkit.org/show_bug.cgi?id=194988
1541 <rdar://problem/48343040>
1543 Reviewed by Tim Horton.
1545 ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
1547 * page/DOMWindow.cpp:
1548 (WebCore::DOMWindow::clearTimeout):
1549 * page/ios/ContentChangeObserver.h:
1550 * page/ios/ContentChangeObserver.mm:
1551 (WebCore::ContentChangeObserver::startObservingDOMTimer):
1552 (WebCore::ContentChangeObserver::stopObservingDOMTimer):
1553 (WebCore::ContentChangeObserver::removeDOMTimer):
1555 2019-02-25 Zalan Bujtas <zalan@apple.com>
1557 [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
1558 https://bugs.webkit.org/show_bug.cgi?id=194987
1559 <rdar://problem/48342910>
1561 Reviewed by Tim Horton.
1563 Content obvservation logic should all move to the ContentChangeObserver class.
1565 * page/DOMTimer.cpp:
1566 (WebCore::DOMTimer::install):
1567 (WebCore::DOMTimer::fired):
1569 (WebCore::Page::Page):
1571 (WebCore::Page::contentChangeObserver):
1572 * page/ios/ContentChangeObserver.h:
1573 * page/ios/ContentChangeObserver.mm:
1574 (WebCore::ContentChangeObserver::ContentChangeObserver):
1575 (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
1576 (WebCore::ContentChangeObserver::startObservingDOMTimer):
1577 (WebCore::ContentChangeObserver::stopObservingDOMTimer):
1578 (WebCore::ContentChangeObserver::containsObservedDOMTimer):
1579 (WebCore::ContentChangeObserver::addObservedDOMTimer):
1580 (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1582 2019-02-25 John Wilander <wilander@apple.com>
1584 Introduce and adopt new class RegistrableDomain for eTLD+1
1585 https://bugs.webkit.org/show_bug.cgi?id=194791
1586 <rdar://problem/48179240>
1588 Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
1590 A new API test was added. Plenty of existing layout tests under
1591 http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
1593 This patch introduces and adopts a new class called WebCore::RegistrableDomain
1594 which represents a domain's eTLD+1 (effective top level domain plus one) and is
1595 the basis for the term "site," as in same-site. Other popular names include
1596 high-level domain, primary domain, and top privately controlled/owned domain.
1597 Effective top level domains are enumerated on the Public Suffix List
1598 (https://publicsuffix.org).
1600 This class just uses the full domain for when the Public Suffix List cannot help
1601 finding the registrable domain and for WebKit ports that haven't enabled
1602 PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
1603 for the null or unique origin (this matches how these origins were handled
1606 The implementation is a wrapper around a String and the functions and class
1607 members that now make use of this new class used to handle regular String
1608 objects which didn't help much in terms of type safety or guarantees that the
1609 string had already been converted to an eTLD+1.
1611 We've at least two bad bugs in the Storage Access API because of confusion
1612 between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
1613 will prohibit such bugs in the future.
1615 Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
1616 WebCore::RegistrableDomain for partitioning in a later patch.
1618 This patch also enhances parameter naming by:
1619 - Removing parts that refer to "primary" as in primaryDomain.
1620 - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
1621 - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
1622 - Using the term "domain" consistently instead of e.g. "host."
1624 * WebCore.xcodeproj/project.pbxproj:
1626 (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
1627 (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
1629 * html/HTMLAnchorElement.cpp:
1630 (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1631 * html/HTMLMediaElement.cpp:
1632 (WebCore::HTMLMediaElement::mediaSessionTitle const):
1633 * loader/AdClickAttribution.cpp:
1634 (WebCore::AdClickAttribution::url const):
1635 (WebCore::AdClickAttribution::referrer const):
1636 (WebCore::AdClickAttribution::toString const):
1637 * loader/AdClickAttribution.h:
1638 (WebCore::AdClickAttribution::Source::Source):
1639 (WebCore::AdClickAttribution::Source::matches const):
1640 (WebCore::AdClickAttribution::Source::deleteValue):
1641 (WebCore::AdClickAttribution::Destination::Destination):
1642 (WebCore::AdClickAttribution::Destination::matches const):
1643 (WebCore::AdClickAttribution::Destination::deleteValue):
1644 * loader/ResourceLoadObserver.cpp:
1645 (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
1646 (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
1647 (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
1648 (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
1649 (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
1650 (WebCore::ResourceLoadObserver::logSubresourceLoading):
1651 (WebCore::ResourceLoadObserver::logWebSocketLoading):
1652 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1653 (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
1654 (WebCore::ResourceLoadObserver::logFontLoad):
1655 (WebCore::ResourceLoadObserver::logCanvasRead):
1656 (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1657 (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1658 (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1659 (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
1660 (WebCore::ResourceLoadObserver::statisticsForOrigin):
1661 (WebCore::primaryDomain): Deleted.
1662 (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
1663 * loader/ResourceLoadObserver.h:
1664 * loader/ResourceLoadStatistics.cpp:
1665 (WebCore::ResourceLoadStatistics::encode const):
1666 (WebCore::ResourceLoadStatistics::decode):
1667 (WebCore::ResourceLoadStatistics::toString const):
1668 (WebCore::ResourceLoadStatistics::merge):
1669 (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
1670 * loader/ResourceLoadStatistics.h:
1671 (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
1673 (WebCore::Page::logNavigation):
1674 (WebCore::Page::mainFrameLoadStarted):
1676 * page/PerformanceMonitor.cpp:
1677 (WebCore::reportPageOverPostLoadResourceThreshold):
1678 * platform/RegistrableDomain.h: Added.
1679 (WebCore::RegistrableDomain::RegistrableDomain):
1680 (WebCore::RegistrableDomain::isEmpty const):
1681 (WebCore::RegistrableDomain::string const):
1682 (WebCore::RegistrableDomain::operator!= const):
1683 (WebCore::RegistrableDomain::operator== const):
1684 (WebCore::RegistrableDomain::matches const):
1685 (WebCore::RegistrableDomain::isolatedCopy const):
1686 (WebCore::RegistrableDomain::isHashTableDeletedValue const):
1687 (WebCore::RegistrableDomain::hash const):
1688 (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
1689 (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
1690 (WebCore::RegistrableDomain::encode const):
1691 (WebCore::RegistrableDomain::decode):
1692 * platform/network/NetworkStorageSession.cpp:
1693 (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
1694 (WebCore::NetworkStorageSession::shouldBlockCookies const):
1695 (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
1696 (WebCore::NetworkStorageSession::removePrevalentDomains):
1697 (WebCore::NetworkStorageSession::hasStorageAccess const):
1698 (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
1699 (WebCore::NetworkStorageSession::grantStorageAccess):
1700 (WebCore::getPartitioningDomain): Deleted.
1701 * platform/network/NetworkStorageSession.h:
1703 2019-02-25 Chris Fleizach <cfleizach@apple.com>
1705 AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
1706 https://bugs.webkit.org/show_bug.cgi?id=190138
1707 <rdar://problem/44907695>
1709 Reviewed by Joanmarie Diggs.
1711 Make sure that footer elements use the right role depending on their context.
1712 If scoped to body, they become contentinfo. Otherwise they are just delineated by
1715 * accessibility/AccessibilityObject.cpp:
1716 (WebCore::AccessibilityObject::isLandmark const):
1717 * accessibility/AccessibilityRenderObject.cpp:
1718 (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
1719 (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
1720 (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1721 * accessibility/AccessibilityRenderObject.h:
1722 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1723 (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1724 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1725 (-[WebAccessibilityObjectWrapper subrole]):
1727 2019-02-25 Sihui Liu <sihui_liu@apple.com>
1729 IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
1730 https://bugs.webkit.org/show_bug.cgi?id=194709
1732 Reviewed by Geoffrey Garen.
1734 When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so
1735 IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle.
1737 Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
1738 between IDBOpenDBRequest and IDBTransaction.
1740 Test: storage/indexeddb/IDBObject-leak.html
1742 * Modules/indexeddb/IDBDatabase.cpp:
1743 (WebCore::IDBDatabase::connectionToServerLost):
1744 * Modules/indexeddb/IDBTransaction.cpp:
1745 (WebCore::IDBTransaction::IDBTransaction):
1746 (WebCore::IDBTransaction::~IDBTransaction):
1747 (WebCore::IDBTransaction::connectionClosedFromServer):
1748 * Modules/indexeddb/IDBTransaction.h:
1749 * testing/Internals.cpp:
1750 (WebCore::Internals::numberOfIDBTransactions const):
1751 * testing/Internals.h:
1752 * testing/Internals.idl:
1754 2019-02-25 Zalan Bujtas <zalan@apple.com>
1756 Add missing stream parameter. Unreviewed.
1758 * page/DOMTimer.cpp:
1759 (WebCore::DOMTimer::fired):
1761 2019-02-25 Zalan Bujtas <zalan@apple.com>
1763 Unreviewed build fix after r242032.
1765 * page/DOMTimer.cpp:
1766 (WebCore::DOMTimer::install):
1768 2019-02-20 Darin Adler <darin@apple.com>
1770 Incorrect use of String::foldCase for font family names
1771 https://bugs.webkit.org/show_bug.cgi?id=194895
1773 Reviewed by Myles C. Maxfield.
1775 * platform/graphics/FontCascadeDescription.cpp:
1776 (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
1777 familyNamesAreEqual instead of calling convertToASCIILowercase directly.
1778 (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
1779 operator== when we want case sensitive family name comparisons. This is a special
1780 case to accomodate CoreText, which uses "."-prefix names for internal fonts that
1781 are treated case sensitively. (Ideally webpages would not use these fonts at all.)
1782 (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
1783 when we want case sensitive family name hashing.
1784 (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
1785 AtomicString so we can use this at an additional call site. Converting from an
1786 AtomicString to a String if free and automatic at the existing call sites. Use
1787 convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
1788 here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
1789 must be consistent. 2) this is considerably faster, and 3) font family names don't
1790 need arbitrary Unicode case folding, it's only A-Z that should be folded.
1791 * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
1792 in the foldedFamilyName function.
1794 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1795 (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
1796 FontCascadeDescription::foldedFamilyName to correctly fold font family names.
1798 2019-02-25 Charlie Turner <cturner@igalia.com>
1800 [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
1801 https://bugs.webkit.org/show_bug.cgi?id=194992
1803 Reviewed by Xabier Rodriguez-Calvar.
1805 Refactoring, no new tests.
1807 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1808 (transformCaps): Simplify the code a little. The idea to use this
1809 utility function came from a review upstream here:
1810 https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
1812 2019-02-25 Alicia Boya GarcĂa <aboya@igalia.com>
1814 [MSE][GStreamer] Batch player duration updates
1815 https://bugs.webkit.org/show_bug.cgi?id=194220
1817 Reviewed by Xabier Rodriguez-Calvar.
1819 This saves up a ton of CPU cycles doing layout unnecessarily when all
1820 the appended frames extend the duration of the movie, like in
1821 YTTV 2018 59.DASHLatencyVP9.
1823 This patch is an optimization that introduces no new behavior.
1825 * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1826 (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
1827 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1828 (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
1829 (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
1830 (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
1831 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1833 2019-02-25 Miguel Gomez <magomez@igalia.com>
1835 [WPE] Add support for holepunch using an external video player
1836 https://bugs.webkit.org/show_bug.cgi?id=194899
1838 Reviewed by Xabier Rodriguez-Calvar.
1840 Implement the holepunch feature to allow playback using an external player. This creates
1841 a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
1842 whose goal is to just draw a transparent rectangle in the position where the video should be.
1843 This can be used to allow a player placed on a lower plane than the browser to become visible.
1845 Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
1847 * PlatformWPE.cmake:
1848 * platform/HolePunch.cmake: Added.
1849 * platform/graphics/MediaPlayer.cpp:
1850 (WebCore::buildMediaEnginesVector):
1851 * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
1852 (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
1853 (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
1854 (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
1855 (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
1856 (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
1857 (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
1858 (WebCore::MediaPlayerPrivateHolePunch::proxy const):
1859 (WebCore::mimeTypeCache):
1860 (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
1861 (WebCore::MediaPlayerPrivateHolePunch::supportsType):
1862 (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
1863 (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
1864 * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
1865 * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1866 (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1868 2019-02-24 Zalan Bujtas <zalan@apple.com>
1870 Introduce ContentChangeObserver class
1871 https://bugs.webkit.org/show_bug.cgi?id=194977
1872 <rdar://problem/48338115>
1874 Reviewed by Simon Fraser.
1876 This patch is about piping through all the related WK* calls.
1879 * WebCore.xcodeproj/project.pbxproj:
1881 (WebCore::Document::scheduleStyleRecalc):
1882 (WebCore::Document::updateStyleIfNeeded):
1883 (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1884 * loader/FrameLoader.cpp:
1885 * page/DOMTimer.cpp:
1886 (WebCore::DOMTimer::install):
1887 (WebCore::DOMTimer::fired):
1888 * page/DOMWindow.cpp:
1889 (WebCore::DOMWindow::clearTimeout):
1891 (WebCore::Frame::willDetachPage):
1893 (WebCore::Page::contentChangeObserver):
1894 * page/ios/EventHandlerIOS.mm:
1895 (WebCore::EventHandler::mouseMoved):
1896 * rendering/updating/RenderTreeUpdater.cpp:
1897 (WebCore::RenderTreeUpdater::updateElementRenderer):
1898 (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1899 (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1901 2019-02-24 Simon Fraser <simon.fraser@apple.com>
1903 Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
1904 https://bugs.webkit.org/show_bug.cgi?id=194984
1906 Reviewed by Sam Weinig.
1908 Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
1910 Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
1911 current layout viewport rect. Instead, set the layout viewport on the root
1912 node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
1914 * page/scrolling/ScrollingTree.cpp:
1915 (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1916 (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
1917 * page/scrolling/ScrollingTree.h:
1918 * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1919 (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
1920 * page/scrolling/ScrollingTreeFrameHostingNode.h:
1921 * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1922 * page/scrolling/ScrollingTreeNode.h:
1923 * page/scrolling/ScrollingTreeScrollingNode.cpp:
1924 (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
1925 * page/scrolling/ScrollingTreeScrollingNode.h:
1926 * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1927 * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1928 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1929 * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1930 * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1931 (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
1932 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1933 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1934 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1935 (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
1936 (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1938 2019-02-24 Devin Rousso <drousso@apple.com>
1940 Web Inspector: Change the InspectorOverlay to use native rather than canvas
1941 https://bugs.webkit.org/show_bug.cgi?id=105023
1942 <rdar://problem/13443692>
1944 Reviewed by Brian Burg.
1946 Should be no change in observed functionality.
1948 * inspector/InspectorOverlay.h:
1949 * inspector/InspectorOverlay.cpp:
1950 (WebCore::truncateWithEllipsis): Added.
1951 (WebCore::localPointToRootPoint): Added.
1952 (WebCore::contentsQuadToCoordinateSystem):
1953 (WebCore::effectiveElementForNode): Added.
1954 (WebCore::quadToPath): Added.
1955 (WebCore::drawOutlinedQuadWithClip): Added.
1956 (WebCore::drawOutlinedQuad): Added.
1957 (WebCore::drawFragmentHighlight): Added.
1958 (WebCore::drawShapeHighlight): Added.
1959 (WebCore::InspectorOverlay::paint):
1960 (WebCore::InspectorOverlay::setIndicating):
1961 (WebCore::InspectorOverlay::shouldShowOverlay const):
1962 (WebCore::InspectorOverlay::update):
1963 (WebCore::InspectorOverlay::setShowPaintRects): Added.
1964 (WebCore::InspectorOverlay::showPaintRect):
1965 (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
1966 (WebCore::InspectorOverlay::drawNodeHighlight):
1967 (WebCore::InspectorOverlay::drawQuadHighlight):
1968 (WebCore::InspectorOverlay::drawPaintRects):
1969 (WebCore::InspectorOverlay::drawBounds): Added.
1970 (WebCore::InspectorOverlay::drawRulers):
1971 (WebCore::InspectorOverlay::drawElementTitle): Added.
1972 (WebCore::contentsQuadToPage): Deleted.
1973 (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
1974 (WebCore::buildObjectForPoint): Deleted.
1975 (WebCore::buildObjectForRect): Deleted.
1976 (WebCore::buildArrayForQuad): Deleted.
1977 (WebCore::buildObjectForHighlight): Deleted.
1978 (WebCore::buildObjectForSize): Deleted.
1979 (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
1980 (WebCore::buildArrayForRendererFragments): Deleted.
1981 (WebCore::localPointToRoot): Deleted.
1982 (WebCore::appendPathCommandAndPoints): Deleted.
1983 (WebCore::appendPathSegment): Deleted.
1984 (WebCore::buildObjectForShapeOutside): Deleted.
1985 (WebCore::buildObjectForElementData): Deleted.
1986 (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
1987 (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
1988 (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
1989 (WebCore::InspectorOverlay::overlayPage): Deleted.
1990 (WebCore::InspectorOverlay::forcePaint): Deleted.
1991 (WebCore::InspectorOverlay::reset): Deleted.
1992 (WebCore::evaluateCommandInOverlay): Deleted.
1993 (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
1994 (WebCore::InspectorOverlay::freePage): Deleted.
1996 * inspector/agents/InspectorPageAgent.cpp:
1997 (WebCore::InspectorPageAgent::disable):
1998 (WebCore::InspectorPageAgent::setShowPaintRects):
1999 Drive-by: rename `setShowingPaintRects` to better match the protocol.
2001 * inspector/agents/page/PageDebuggerAgent.h:
2002 * inspector/agents/page/PageDebuggerAgent.cpp:
2003 (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2004 (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
2005 Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
2007 * inspector/InspectorController.h:
2008 * inspector/InspectorController.cpp:
2009 (WebCore::InspectorController::createLazyAgents):
2010 (WebCore::InspectorController::disconnectFrontend):
2011 (WebCore::InspectorController::disconnectAllFrontends):
2012 (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
2014 * testing/Internals.h:
2015 * testing/Internals.idl:
2016 * testing/Internals.cpp:
2017 (WebCore::Internals::inspectorHighlightObject): Deleted.
2019 * inspector/InspectorOverlayPage.css: Removed.
2020 * inspector/InspectorOverlayPage.html: Removed.
2021 * inspector/InspectorOverlayPage.js: Removed.
2024 * DerivedSources-input.xcfilelist:
2025 * DerivedSources-output.xcfilelist:
2026 * DerivedSources.make:
2027 * WebCore.xcodeproj/project.pbxproj:
2029 2019-02-20 Darin Adler <darin@apple.com>
2031 Finish removing String::format
2032 https://bugs.webkit.org/show_bug.cgi?id=194893
2034 Reviewed by Daniel Bates.
2037 (WebCore::Document::lastModified const): Use makeString and pad.
2038 * html/FTPDirectoryDocument.cpp:
2039 (WebCore::processFileDateString): Ditto.
2041 * mathml/MathMLElement.cpp:
2042 (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
2044 * page/cocoa/ResourceUsageOverlayCocoa.mm:
2045 (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
2047 * page/linux/ResourceUsageOverlayLinux.cpp:
2048 (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
2049 (WebCore::gcTimerString): Use String::number.
2051 * platform/DateComponents.cpp:
2052 (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
2053 (WebCore::DateComponents::toString const): Ditto.
2055 * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
2056 and that was also inaccurate.
2058 * platform/audio/HRTFElevation.cpp:
2059 (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2060 Use makeString and pad.
2061 * platform/mock/MockRealtimeVideoSource.cpp:
2062 (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2063 * rendering/RenderLayerCompositor.cpp:
2064 (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2065 * rendering/RenderTheme.cpp:
2066 (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2068 2019-02-24 Michael Catanzaro <mcatanzaro@igalia.com>
2070 [WPE][GTK] Remove user agent quirk for washingtonpost.com
2071 https://bugs.webkit.org/show_bug.cgi?id=194981
2073 Reviewed by Žan Doberšek.
2075 Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
2077 * platform/UserAgentQuirks.cpp:
2078 (WebCore::urlRequiresChromeBrowser):
2080 2019-02-23 Simon Fraser <simon.fraser@apple.com>
2082 Remove remnants of iOS WK1 scrolling tree code
2083 https://bugs.webkit.org/show_bug.cgi?id=194980
2085 Reviewed by Sam Weinig.
2087 Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
2088 to reduce maintenance costs and simplify.
2090 Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
2091 since that was the only concrete subclass, removing code which never applies to iOS WK2
2092 (e.g. the synchronous scrolling code path).
2095 * WebCore.xcodeproj/project.pbxproj:
2097 * page/scrolling/ScrollingCoordinator.cpp:
2098 * page/scrolling/ScrollingTree.h:
2099 * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2100 * page/scrolling/ScrollingTreeNode.h:
2101 * page/scrolling/ScrollingTreeScrollingNode.cpp:
2102 (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
2103 * page/scrolling/ScrollingTreeScrollingNode.h:
2104 (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
2105 (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
2106 (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
2107 (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
2108 (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
2109 (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
2110 (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
2111 (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
2112 (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
2113 (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
2114 (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
2115 (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
2116 (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
2117 (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
2118 (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
2119 (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
2120 (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
2121 (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
2122 (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
2123 (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
2124 (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
2125 (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
2126 (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
2127 (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
2128 (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
2129 (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
2130 * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
2131 * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
2132 * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
2133 * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
2134 * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
2135 * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
2136 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2137 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2139 2019-02-23 Justin Fan <justin_fan@apple.com>
2141 [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
2142 https://bugs.webkit.org/show_bug.cgi?id=194665
2144 Reviewed by Dean Jackson.
2146 Test: map-write-buffers.html. Other tests updated to match new API.
2148 * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
2149 (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
2150 (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
2151 * Modules/webgpu/WebGPUBindGroupDescriptor.h:
2152 * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
2153 (WebCore::WebGPUBuffer::create):
2154 (WebCore::WebGPUBuffer::WebGPUBuffer):
2155 (WebCore::WebGPUBuffer::mapReadAsync):
2156 (WebCore::WebGPUBuffer::mapWriteAsync):
2157 (WebCore::WebGPUBuffer::unmap):
2158 (WebCore::WebGPUBuffer::destroy):
2159 (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
2160 * Modules/webgpu/WebGPUBuffer.h:
2161 (WebCore::WebGPUBuffer::buffer const):
2162 (WebCore::WebGPUBuffer::mapping const): Deleted.
2163 * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
2164 * Modules/webgpu/WebGPUCommandBuffer.cpp:
2165 (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
2166 * Modules/webgpu/WebGPUDevice.cpp:
2167 (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
2168 (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
2169 * Modules/webgpu/WebGPUDevice.h:
2170 * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
2171 (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
2172 * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2173 (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
2174 * platform/graphics/gpu/GPUBuffer.cpp: Added.
2175 (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
2176 * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
2177 (WebCore::GPUBuffer::isVertex const):
2178 (WebCore::GPUBuffer::isUniform const):
2179 (WebCore::GPUBuffer::isStorage const):
2180 (WebCore::GPUBuffer::isReadOnly const):
2181 (WebCore::GPUBuffer::PendingMapPromise::create):
2182 (WebCore::GPUBuffer::isMappable const):
2183 (WebCore::GPUBuffer::isMapWriteable const):
2184 (WebCore::GPUBuffer::isMapReadable const):
2185 (WebCore::GPUBuffer::mapping const): Deleted.
2186 * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
2187 * platform/graphics/gpu/GPUDevice.cpp:
2188 (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer.
2189 (WebCore::GPUDevice::createBuffer const): Deleted.
2190 * platform/graphics/gpu/GPUDevice.h:
2191 * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2192 (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
2193 (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
2194 (WebCore::GPUBuffer::GPUBuffer):
2195 (WebCore::GPUBuffer::~GPUBuffer):
2196 (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
2197 (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
2198 (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
2199 (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
2200 (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
2201 (WebCore::GPUBuffer::create): Deleted.
2202 * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2203 (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
2205 Add symbols for new files:
2207 * WebCore.xcodeproj/project.pbxproj:
2209 2019-02-23 Keith Miller <keith_miller@apple.com>
2211 Add new mac target numbers
2212 https://bugs.webkit.org/show_bug.cgi?id=194955
2214 Reviewed by Tim Horton.
2216 * Configurations/Base.xcconfig:
2217 * Configurations/DebugRelease.xcconfig:
2219 2019-02-23 chris fleizach <cfleizach@apple.com>
2221 AX: WebKit is incorrectly mapping the <meter> element to progressbar
2222 https://bugs.webkit.org/show_bug.cgi?id=164051
2223 <rdar://problem/29055615>
2225 Reviewed by Joanmarie Diggs.
2227 Add a specific role for meter and map that to the appropriate mac role.
2229 * accessibility/AccessibilityNodeObject.cpp:
2230 (WebCore::AccessibilityNodeObject::canHaveChildren const):
2231 (WebCore::AccessibilityNodeObject::isProgressIndicator const):
2232 * accessibility/AccessibilityObject.cpp:
2233 (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
2234 (WebCore::AccessibilityObject::isRangeControl const):
2235 (WebCore::AccessibilityObject::computedRoleString const):
2236 * accessibility/AccessibilityObjectInterface.h:
2237 * accessibility/AccessibilityProgressIndicator.cpp:
2238 (WebCore::AccessibilityProgressIndicator::roleValue const):
2239 * accessibility/AccessibilityProgressIndicator.h:
2240 * accessibility/AccessibilityRenderObject.cpp:
2241 (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
2242 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2243 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2244 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2245 (createAccessibilityRoleMap):
2247 2019-02-22 Ryosuke Niwa <rniwa@webkit.org>
2249 Crash in SWServerJobQueue::runNextJobSynchronously
2250 https://bugs.webkit.org/show_bug.cgi?id=194974
2252 Reviewed by Geoffrey Garen.
2254 We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
2255 or there is a timer heap corruption again :(
2257 Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
2258 but convert an existing release assert to a debug assert since this appears to be hitting
2259 too frequently in wild.
2261 * workers/service/server/SWServerJobQueue.cpp:
2262 (WebCore::SWServerJobQueue::runNextJobSynchronously):
2264 2019-02-22 Simon Fraser <simon.fraser@apple.com>
2266 Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
2267 https://bugs.webkit.org/show_bug.cgi?id=194968
2269 Reviewed by Antti Koivisto.
2271 Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
2272 you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
2274 ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
2277 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2278 (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
2279 * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2280 * page/scrolling/ScrollingTreeScrollingNode.cpp:
2281 (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
2282 (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
2283 (WebCore::ScrollingTreeScrollingNode::scrollBy):
2284 (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
2285 (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
2286 * page/scrolling/ScrollingTreeScrollingNode.h:
2287 * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2288 * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2289 (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
2290 (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
2291 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2292 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2293 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2294 (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2295 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2296 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
2297 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2298 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2299 (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
2300 (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
2301 * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2302 (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
2303 * platform/PlatformWheelEvent.h:
2304 (WebCore::PlatformWheelEvent::delta const):
2305 * platform/ScrollTypes.h:
2307 2019-02-22 Eric Liang <ericliang@apple.com>
2309 AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
2310 https://bugs.webkit.org/show_bug.cgi?id=194923
2312 Reviewed by Chris Fleizach.
2314 Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
2316 Test: accessibility/mac/children-in-navigation-order-returns-children.html
2318 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2319 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2321 2019-02-22 Tim Horton <timothy_horton@apple.com>
2323 ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
2324 https://bugs.webkit.org/show_bug.cgi?id=194963
2326 Reviewed by Dean Jackson.
2328 Tested by existing failing API test.
2331 (WebCore::Page::installedPageOverlaysChanged): Deleted.
2333 (WebCore::Page::pageOverlayController):
2334 * page/PageOverlayController.cpp:
2335 (WebCore::PageOverlayController::installedPageOverlaysChanged):
2336 (WebCore::PageOverlayController::detachViewOverlayLayers):
2337 (WebCore::PageOverlayController::installPageOverlay):
2338 (WebCore::PageOverlayController::uninstallPageOverlay):
2339 (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
2340 * page/PageOverlayController.h:
2341 As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
2342 Also, make it ignore isInWindow state; otherwise, if you install a overlay
2343 and then come into window, nothing installs the root layer. There is no
2344 need for this code to follow in-window state manually anymore since
2345 the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
2347 Make some methods private, and make detachViewOverlayLayers only touch
2348 *view* overlays, so that we don't detach the document-relative root
2349 layer when you drop to having no view overlays. This maintains
2350 existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
2352 Now there are no callers of willDetachRootLayer, so remove it.
2354 2019-02-22 Andy Estes <aestes@apple.com>
2356 [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
2357 https://bugs.webkit.org/show_bug.cgi?id=194964
2358 <rdar://problem/48279441>
2360 Reviewed by Alex Christensen.
2362 When a document's QuickLook preview is loaded, a reference cycle is created between
2363 PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
2364 ResourceLoader::releaseResources().
2366 Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
2368 * loader/ResourceLoader.cpp:
2369 (WebCore::ResourceLoader::releaseResources):
2371 2019-02-22 Sihui Liu <sihui_liu@apple.com>
2373 Crash under IDBServer::IDBConnectionToClient::identifier() const
2374 https://bugs.webkit.org/show_bug.cgi?id=194843
2375 <rdar://problem/48203102>
2377 Reviewed by Geoffrey Garen.
2379 UniqueIDBDatabase should ignore requests from connections that are already closed.
2381 Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually.
2382 One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
2383 disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
2384 may start a version change transaction and ask for identifier from the connection that is already gone.
2386 * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2387 (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
2388 * Modules/indexeddb/server/IDBConnectionToClient.h:
2389 (WebCore::IDBServer::IDBConnectionToClient::isClosed):
2390 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2391 (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
2392 (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2393 (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2394 * Modules/indexeddb/server/UniqueIDBDatabase.h:
2396 2019-02-22 Wenson Hsieh <wenson_hsieh@apple.com>
2398 Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
2399 https://bugs.webkit.org/show_bug.cgi?id=194703
2400 <rdar://problem/48111775>
2402 Reviewed by Ryosuke Niwa.
2404 Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
2405 even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
2406 scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
2407 "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
2409 To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
2410 EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
2412 Tests: fast/events/before-input-events-prevent-block-text-direction.html
2413 fast/events/before-input-events-prevent-inline-text-direction.html
2415 * editing/CompositeEditCommand.cpp:
2416 (WebCore::CompositeEditCommand::apply):
2417 * editing/EditAction.cpp:
2418 (WebCore::undoRedoLabel):
2419 * editing/EditAction.h:
2420 * editing/EditCommand.cpp:
2421 (WebCore::inputTypeNameForEditingAction):
2422 * editing/Editor.cpp:
2423 (WebCore::inputEventDataForEditingStyleAndAction):
2424 (WebCore::Editor::setBaseWritingDirection):
2425 * editing/EditorCommand.cpp:
2426 (WebCore::executeMakeTextWritingDirectionLeftToRight):
2427 (WebCore::executeMakeTextWritingDirectionNatural):
2428 (WebCore::executeMakeTextWritingDirectionRightToLeft):
2430 2019-02-22 Rob Buis <rbuis@igalia.com>
2432 Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
2433 https://bugs.webkit.org/show_bug.cgi?id=160172
2435 Reviewed by Frédéric Wang.
2437 Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
2438 from HTTPParsers instead.
2440 No new tests, already covered by MathML tests.
2442 * mathml/MathMLElement.cpp:
2443 (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
2444 * mathml/MathMLElement.h:
2445 * mathml/MathMLPresentationElement.cpp:
2446 (WebCore::MathMLPresentationElement::parseMathMLLength):
2447 * mathml/MathMLTokenElement.cpp:
2448 (WebCore::MathMLTokenElement::convertToSingleCodePoint):
2450 2019-02-22 Eric Carlson <eric.carlson@apple.com>
2452 Update some media logging
2453 https://bugs.webkit.org/show_bug.cgi?id=194915
2455 Reviewed by Jer Noble.
2457 No new tests, no functional change.
2459 * Modules/mediasource/SourceBuffer.cpp:
2460 (WebCore::SourceBuffer::evictCodedFrames):
2461 (WebCore::SourceBuffer::provideMediaData):
2462 (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
2464 * html/HTMLMediaElement.cpp:
2465 (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
2466 (WebCore::HTMLMediaElement::loadResource):
2467 (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2468 (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
2469 (WebCore::HTMLMediaElement::seekTask):
2470 (WebCore::HTMLMediaElement::playInternal):
2471 (WebCore::HTMLMediaElement::pauseInternal):
2472 (WebCore::HTMLMediaElement::setLoop):
2473 (WebCore::HTMLMediaElement::setControls):
2474 (WebCore::HTMLMediaElement::sourceWasRemoved):
2476 * html/MediaElementSession.cpp:
2477 (WebCore::convertEnumerationToString):
2479 * html/MediaElementSession.h:
2480 (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
2482 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2483 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2485 2019-02-22 Rob Buis <rbuis@igalia.com>
2487 Fix unitless usage of mathsize
2488 https://bugs.webkit.org/show_bug.cgi?id=194940
2490 Reviewed by Frédéric Wang.
2492 Convert unitless lengths to percentage values to correct the computed
2495 * mathml/MathMLElement.cpp:
2496 (WebCore::convertToPercentageIfNeeded):
2497 (WebCore::MathMLElement::collectStyleForPresentationAttribute):
2499 2019-02-21 Simon Fraser <simon.fraser@apple.com>
2501 Hardcode Visual Viewports on everywhere except iOS WK1
2502 https://bugs.webkit.org/show_bug.cgi?id=194928
2504 Reviewed by Zalan Bujtas.
2506 Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
2507 change the default value of the Setting to 'true', and hardcode WebView on iOS to
2508 set it to false. The setting has shipped for several years and there's no need to turn
2511 Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
2512 Visual Viewports are not enabled.
2514 Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
2515 that only runs in WK2
2517 * page/Settings.yaml:
2518 * page/scrolling/AsyncScrollingCoordinator.cpp:
2519 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2520 (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2521 (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
2522 * page/scrolling/AsyncScrollingCoordinator.h:
2523 * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2524 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2525 (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2526 (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2527 (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
2528 * page/scrolling/ScrollingStateFrameScrollingNode.h:
2529 * page/scrolling/ScrollingTree.cpp:
2530 (WebCore::ScrollingTree::commitTreeState):
2531 * page/scrolling/ScrollingTree.h:
2532 (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
2533 (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
2534 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2535 (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
2536 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2537 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2538 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2540 2019-02-21 Darin Adler <darin@apple.com>
2542 Some refinements for Node and Document
2543 https://bugs.webkit.org/show_bug.cgi?id=194764
2545 Reviewed by Ryosuke Niwa.
2547 * accessibility/AccessibilityObject.cpp:
2548 (WebCore::AccessibilityObject::press): Use shadowHost instead of
2549 deprecatedShadowAncestorNode.
2550 (WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
2551 (WebCore::AccessibilityObject::focusedUIElement const): Use existing page
2552 function to streamline.
2554 * accessibility/AccessibilityRenderObject.cpp:
2555 (WebCore::AccessibilityRenderObject::accessKey const): Use
2556 attributeWithoutSynchronization for efficiency and consistency with other
2557 code working with the accesskey attribute.
2559 * dom/ContainerNode.cpp:
2560 (WebCore::ContainerNode::childrenChanged): Added call to
2561 invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
2563 * dom/DecodedDataDocumentParser.cpp:
2564 (WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
2565 type change of createDecoderIfNeeded to decoder.
2566 (WebCore::DecodedDataDocumentParser::flush): Ditto.
2569 (WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
2570 to match WebKit coding style. Changed to use unique_ptr instead of separate
2571 boolean to keep track of map validity status.
2572 (WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
2573 clarify that this is a cache. Changed to use composedTreeDescendants rather
2574 than explicit calls to shadowRoot. Use add instead of set so that first element
2575 in document order wins, instead of last element in document order. Updated
2576 to make a new map in a new unique_ptr instead of populating a map.
2577 (WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
2578 invalidateAccessKeyMap, and left an inline part in the header so the fast case
2579 of quickly checking for a null pointer can be inlined.
2580 (WebCore::Document::doctype const): Use downcast instead of static_cast.
2581 (WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
2582 from here to childrenChanged and accesskey attribute change handling.
2583 (WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
2584 directly since this is the only place that does it and we don't need to factor
2585 that one line of code into a function.
2586 (WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
2587 that always returns nullptr and can be inlined.
2588 (WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
2589 (WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
2590 the create function, since Document::create now always involves no frame.
2591 (WebCore::Document::didAssociateFormControl): Changed argument type to a reference
2592 and simplified the logic with a local variable.
2593 (WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
2594 checks and rearranged things so that m_associatedFormControls will always
2595 get cleared even if the document is no longer associated with a page.
2597 * dom/Document.h: Removed unnnecessary explicit values for enumerations (first
2598 value is always zero, etc.) and formatted simple enumerations in a single line
2599 for easier reading. Moved Document::create fucntion bodies out of line, removed
2600 the frame argument from the simple "create with URL" overload and made the frame
2601 argument for createNonRenderedPlaceholder be a reference rather than a pointer.
2602 Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
2603 invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
2604 m_elementsByAccessKey to m_accessKeyCache and changed its type.
2605 Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
2606 setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
2608 * dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
2609 placeholder returning null.
2612 (WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
2613 value of the accesskey attribute is changed. Also moved the class attribute code
2614 so the attributes here are in alphabetical order (only class and id were out of
2615 alphabetical order).
2618 (WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
2619 use deprecatedShadowAncestorNode and used boolean operators to make it a
2620 single line and easier to understand. Also added a FIXME since the
2621 containsIncludingShadowDOM function is so similar, yet differently written.
2622 (WebCore::Node::contains const): Rewrote as a single line to make this easier
2623 to read and to *slightly* improve the speed in the "this == node" case.
2624 (WebCore::Node::containsIncludingHostElements const): Use downcast.
2625 (WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
2627 * dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
2629 * editing/ReplaceSelectionCommand.cpp:
2630 (WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
2631 instead of deprecatedShadowAncestorNode.
2633 * html/FormAssociatedElement.cpp:
2634 (WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
2635 didAssociateFormControl.
2636 (WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
2638 * html/HTMLAreaElement.cpp:
2639 (WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
2640 attribute, because we want to call the base class parseAttribute in that case.
2642 * html/HTMLFormElement.cpp:
2643 (WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
2644 didAssociateFormControl.
2646 * html/HTMLSelectElement.cpp:
2647 (WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
2648 attribute with mysterious FIXME, because we want to call the base class
2649 parseAttribute in that case. The old code had no effect before; the access key
2650 logic would still find the attribute; if the goal is to ignore the attribute
2651 for these elements we will need a different solution.
2652 * html/HTMLTextAreaElement.cpp:
2653 (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
2655 * loader/DocumentLoader.cpp:
2656 (WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
2657 nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
2658 m_frame was always null.
2659 (WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.
2661 * loader/DocumentWriter.cpp:
2662 (WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
2663 the passed in frame, which was always nullptr, and initialized some booleans and an
2664 enumeration, which are now initialized in the class definition.
2665 (WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
2666 (WebCore::DocumentWriter::begin): Updated now that State is an enum class.
2667 (WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
2668 to return a reference.
2669 (WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
2670 updated now that State is an enum class.
2671 (WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
2673 (WebCore::DocumentWriter::end): Ditto.
2675 * loader/DocumentWriter.h: Removed unneeded include and forward declaration.
2676 Removed the frame pointer argument to the constructor, caller was always passing a
2677 nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
2678 to decoder and changed it to return a reference. Initialized m_frame,
2679 m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
2680 to initialize them in a constructor. Renamed the enum from WriterState to State since
2681 it's a member of DocumentWriter already, and made it an enum class rather than ending
2682 each enumeration value with WritingState.
2684 * page/DragController.cpp:
2685 (WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
2686 one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
2688 (WebCore::hasEnabledColorInputAsShadowHost): Added.
2689 (WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
2690 Also added FIXME since it seems this should instead be using parentElementInComposedTree.
2691 (WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
2692 (WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
2693 and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
2694 into a local variable to simplify code.
2695 (WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.
2697 * page/EventHandler.cpp:
2698 (WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.
2700 * page/FocusController.cpp:
2701 (WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.
2703 * workers/service/context/ServiceWorkerThreadProxy.cpp:
2704 (WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
2705 Document::createNonRenderedPlaceholder.
2707 2019-02-21 Daniel Bates <dabates@apple.com>
2709 Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
2710 https://bugs.webkit.org/show_bug.cgi?id=194906
2711 <rdar://problem/44305947>
2713 Reviewed by Brent Fulgham.
2715 Ensure that a request for a top-level navigation is annotated as such regardless of whether
2716 the request has a computed Same Site policy.
2718 "New loads" initiated by a the client (Safari) either by API or a human either explicitly
2719 typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
2720 are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
2721 from an existing page. (Command + click should be thought of as a convenience to the user from
2722 having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
2723 Currently the frame loader marks a request as a top-level navigation if and only if the request
2724 does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
2725 policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
2726 Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
2727 tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
2728 Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
2729 WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.
2731 [1] See Note for (1) in <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
2732 [2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>
2734 Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php
2736 * loader/FrameLoader.cpp:
2737 (WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
2738 level navigation bit.
2739 * platform/network/ResourceRequestBase.cpp:
2740 (WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
2741 level navigation bit.
2743 2019-02-21 Per Arne Vollan <pvollan@apple.com>
2745 Layout Test fast/text/international/khmer-selection.html is crashing
2746 https://bugs.webkit.org/show_bug.cgi?id=191368
2748 Reviewed by Brent Fulgham.
2750 GlyphBuffer's offset array wasn't getting filled by UniscribeController.
2751 Our underlining code requires this array.
2753 Uniscribe gives us a character -> glyph mapping, so we just have to compute
2754 the inverse and give it to the GlyphBuffer.
2756 This patch is written by Myles C. Maxfield.
2758 Test: fast/text/international/khmer-selection.html.
2760 * platform/graphics/GlyphBuffer.h:
2761 (WebCore::GlyphBuffer::add):
2762 * platform/graphics/displaylists/DisplayListItems.cpp:
2763 (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
2764 * platform/graphics/win/UniscribeController.cpp:
2765 (WebCore::UniscribeController::advance):
2766 (WebCore::UniscribeController::itemizeShapeAndPlace):
2767 (WebCore::UniscribeController::shapeAndPlaceItem):
2768 * platform/graphics/win/UniscribeController.h:
2770 2019-02-21 Sihui Liu <sihui_liu@apple.com>
2772 IndexedDB: leak UniqueIDBDatabase in layout tests
2773 https://bugs.webkit.org/show_bug.cgi?id=194870
2774 <rdar://problem/48163812>
2776 Reviewed by Geoffrey Garen.
2778 UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it
2779 receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
2780 pointer should be released when a database task finishes, but it didn't perform a check when a confirm message
2783 No new test as the order of task completion and confirmation arrival is uncertain.
2785 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2786 (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2788 2019-02-21 Andy Estes <aestes@apple.com>
2790 contentfiltering tests leak documents
2791 https://bugs.webkit.org/show_bug.cgi?id=189434
2794 Reviewed by Simon Fraser.
2796 Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
2798 This fixes world leaks in several tests in LayoutTests/contentfiltering/.
2800 * bindings/js/ScriptController.h:
2801 * loader/ContentFilter.cpp:
2802 (WebCore::ContentFilter::didDecide):
2804 2019-02-21 Don Olmstead <don.olmstead@sony.com>
2806 [CMake][Win] Fix !USE(CF) build of WebCore
2807 https://bugs.webkit.org/show_bug.cgi?id=194879
2809 Reviewed by Konstantin Tokarev.
2811 * PlatformAppleWin.cmake:
2812 * PlatformWin.cmake:
2813 * PlatformWinCairo.cmake:
2815 2019-02-21 Zalan Bujtas <zalan@apple.com>
2817 [LFC][Floats] Add support for placing formatting roots in-between floats.
2818 https://bugs.webkit.org/show_bug.cgi?id=194902
2820 Reviewed by Antti Koivisto.
2822 This patch add support for placing a formatting root box in-between existing floats.
2823 The initial vertical position of a formatting root is its static position which can make the box
2824 placed above exsiting floats (whereas we can never place a regular float above existing floats.)
2826 Test: fast/block/block-only/floats-and-block-formatting-roots.html
2828 * layout/blockformatting/BlockFormattingContext.cpp:
2829 (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2830 * layout/floats/FloatingContext.cpp:
2831 (WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
2832 (WebCore::Layout::FloatPair::isEmpty const):
2833 (WebCore::Layout::FloatPair::operator* const):
2834 (WebCore::Layout::Iterator::operator* const):
2835 (WebCore::Layout::begin):
2836 (WebCore::Layout::end):
2837 (WebCore::Layout::FloatingContext::positionForFloat const):
2838 (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2839 (WebCore::Layout::findAvailablePosition):
2840 (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
2841 (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
2842 (WebCore::Layout::FloatPair::FloatPair):
2843 (WebCore::Layout::FloatPair::left const):
2844 (WebCore::Layout::FloatPair::right const):
2845 (WebCore::Layout::FloatPair::intersects const):
2846 (WebCore::Layout::FloatPair::operator == const):
2847 (WebCore::Layout::FloatPair::horizontalConstraints const):
2848 (WebCore::Layout::FloatPair::bottom const):
2849 (WebCore::Layout::Iterator::operator++):
2850 (WebCore::Layout::Iterator::set):
2851 (WebCore::Layout::FloatingPair::isEmpty const): Deleted.
2852 (WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
2853 (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
2854 (WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
2855 (WebCore::Layout::FloatingPair::FloatingPair): Deleted.
2856 (WebCore::Layout::FloatingPair::left const): Deleted.
2857 (WebCore::Layout::FloatingPair::right const): Deleted.
2858 (WebCore::Layout::FloatingPair::intersects const): Deleted.
2859 (WebCore::Layout::FloatingPair::operator == const): Deleted.
2860 (WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
2861 (WebCore::Layout::FloatingPair::bottom const): Deleted.
2862 * layout/floats/FloatingContext.h:
2864 2019-02-21 Rob Buis <rbuis@igalia.com>
2866 Update MIME type parser
2867 https://bugs.webkit.org/show_bug.cgi?id=180526
2869 Reviewed by Darin Adler.
2871 Further testing showed the MIME parser needs these fixes:
2872 - stripWhitespace is wrong for removing HTTP whitespace, use
2873 stripLeadingAndTrailingHTTPSpaces instead.
2874 - HTTP Token code points checking for Rfc2045 and Mimesniff were
2875 mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
2876 - Quoted Strings were not unescaped/escaped, this seems ok for
2877 serializing but is wrong when gettings individual parameter values.
2878 Implement [1] and [2] Step 2.4 to properly unescape and escape.
2880 This change also tries to avoid hard to read uses of find.
2882 Test: ParsedContentType.Serialize
2884 [1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
2885 [2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
2887 * platform/network/ParsedContentType.cpp:
2888 (WebCore::skipSpaces):
2889 (WebCore::parseToken):
2890 (WebCore::isNotQuoteOrBackslash):
2891 (WebCore::collectHTTPQuotedString):
2892 (WebCore::containsNonTokenCharacters):
2893 (WebCore::parseQuotedString):
2894 (WebCore::ParsedContentType::parseContentType):
2895 (WebCore::ParsedContentType::create):
2896 (WebCore::ParsedContentType::setContentType):
2897 (WebCore::containsNonQuoteStringTokenCharacters):
2898 (WebCore::ParsedContentType::setContentTypeParameter):
2899 (WebCore::ParsedContentType::serialize const):
2900 (WebCore::substringForRange): Deleted.
2901 (WebCore::isNonTokenCharacter): Deleted.
2902 (WebCore::isNonQuotedStringTokenCharacter): Deleted.
2903 * platform/network/ParsedContentType.h:
2905 2019-02-20 Simon Fraser <simon.fraser@apple.com>
2907 REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
2908 https://bugs.webkit.org/show_bug.cgi?id=194889
2909 rdar://problem/47755552
2911 Reviewed by Tim Horton.
2913 After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
2914 position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
2915 with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
2916 update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
2918 Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
2921 Not currently testable.
2923 * rendering/RenderLayerCompositor.cpp:
2924 (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2926 2019-02-20 Dean Jackson <dino@apple.com>
2928 Rotation animations sometimes use the wrong origin (affects apple.com)
2929 https://bugs.webkit.org/show_bug.cgi?id=194878
2930 <rdar://problem/43908047>
2932 Reviewed by Simon Fraser.
2934 Some versions of CoreAnimation apply additive animations in reverse
2935 order. Detect this and reverse the list of animations we provide.
2937 Update the existing animations/additive-transform-animations.html test to
2938 be a ref-test that would identify this failure. Previously it relied on
2941 * platform/graphics/ca/GraphicsLayerCA.cpp: Use
2942 HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
2943 not to flip the list of animations (and mark the correct ones as
2945 (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2946 (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2948 2019-02-20 Don Olmstead <don.olmstead@sony.com>
2950 [Win] Guard CF usage in RenderThemeWin
2951 https://bugs.webkit.org/show_bug.cgi?id=194875
2953 Reviewed by Alex Christensen.
2955 No new tests. No change in behavior.
2957 Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
2959 * rendering/RenderThemeWin.cpp:
2960 (WebCore::RenderThemeWin::stringWithContentsOfFile):
2961 (WebCore::RenderThemeWin::mediaControlsStyleSheet):
2962 (WebCore::RenderThemeWin::mediaControlsScript):
2963 * rendering/RenderThemeWin.h:
2965 2019-02-20 Ryosuke Niwa <rniwa@webkit.org>
2967 Crash in DOMWindowExtension::suspendForPageCache
2968 https://bugs.webkit.org/show_bug.cgi?id=194871
2970 Reviewed by Chris Dumez.
2972 This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
2974 We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
2975 dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
2976 Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
2979 * page/DOMWindow.cpp:
2980 (WebCore::DOMWindow::willDestroyCachedFrame):
2981 (WebCore::DOMWindow::willDestroyDocumentInFrame):
2982 (WebCore::DOMWindow::willDetachDocumentFromFrame):
2983 (WebCore::DOMWindow::suspendForPageCache):
2984 (WebCore::DOMWindow::resumeFromPageCache):
2985 * page/DOMWindowExtension.cpp:
2986 (WebCore::DOMWindowExtension::suspendForPageCache):
2988 2019-02-20 Alex Christensen <achristensen@webkit.org>
2990 Always call CompletionHandlers after r240909
2991 https://bugs.webkit.org/show_bug.cgi?id=194823
2993 Reviewed by Ryosuke Niwa.
2995 * loader/PolicyChecker.cpp:
2996 (WebCore::PolicyChecker::checkNavigationPolicy):
2997 (WebCore::PolicyChecker::checkNewWindowPolicy):
2999 2019-02-20 Andy Estes <aestes@apple.com>
3001 [Xcode] Add SDKVariant.xcconfig to various Xcode projects
3002 https://bugs.webkit.org/show_bug.cgi?id=194869
3004 Rubber-stamped by Jer Noble.
3006 * WebCore.xcodeproj/project.pbxproj:
3008 2019-02-20 Said Abou-Hallawa <sabouhallawa@apple.com>
3010 drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
3011 https://bugs.webkit.org/show_bug.cgi?id=194746
3013 Reviewed by Dean Jackson.
3015 Test: fast/canvas/canvas-drawImage-composite-copy.html
3017 If the source canvas of drawImage() is the same as the destination and
3018 globalCompositeOperation is set to "copy", copy the srcRect from the
3019 canvas to a temporary buffer before calling clearCanvas() then drawImage
3020 from this temporary buffer.
3022 * html/canvas/CanvasRenderingContext2DBase.cpp:
3023 (WebCore::CanvasRenderingContext2DBase::drawImage):
3024 * platform/graphics/ImageBuffer.cpp:
3025 (WebCore::ImageBuffer::copyRectToBuffer):
3026 * platform/graphics/ImageBuffer.h:
3028 2019-02-20 Simon Fraser <simon.fraser@apple.com>
3030 REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
3031 https://bugs.webkit.org/show_bug.cgi?id=194866
3033 Reviewed by Antti Koivisto.
3035 r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
3036 a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
3037 the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
3039 * rendering/RenderLayerCompositor.cpp:
3040 (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
3042 2019-02-20 Daniel Bates <dabates@apple.com>
3044 [iOS] Tweak UI for focus rings
3045 https://bugs.webkit.org/show_bug.cgi?id=194864
3046 <rdar://problem/47831886>
3048 Reviewed by Brent Fulgham.
3050 Make use of UIKit constants to make focus rings pretty.
3052 * platform/graphics/cocoa/GraphicsContextCocoa.mm:
3053 (WebCore::drawFocusRingAtTime):
3055 2019-02-20 Timothy Hatcher <timothy@apple.com>
3057 RenderThemeIOS should use RenderTheme's color cache instead of its own.
3058 https://bugs.webkit.org/show_bug.cgi?id=194822
3059 rdar://problem/48208296
3061 Reviewed by Tim Horton.
3063 Tested by fast/css/apple-system-colors.html.
3065 * css/CSSValueKeywords.in:
3066 * css/parser/CSSPropertyParser.cpp:
3067 (WebCore::isAppleLegacyCssValueKeyword):
3068 * platform/graphics/Color.h:
3069 * platform/graphics/cg/ColorCG.cpp:
3070 (WebCore::makeRGBAFromCGColor):
3071 (WebCore::Color::Color):
3072 * rendering/RenderThemeIOS.h:
3073 * rendering/RenderThemeIOS.mm:
3074 (WebCore::RenderThemeIOS::systemColor const):
3075 * rendering/RenderThemeMac.mm:
3076 (WebCore::RenderThemeMac::systemColor const):
3078 2019-02-20 LoĂŻc Yhuel <loic.yhuel@softathome.com>
3080 Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
3081 https://bugs.webkit.org/show_bug.cgi?id=194819
3083 Reviewed by Joseph Pecoraro.
3085 Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
3087 * Modules/websockets/WebSocketChannel.h:
3088 (WebCore::WebSocketChannel::hasCreatedHandshake):
3089 * inspector/agents/page/PageNetworkAgent.cpp:
3090 Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
3092 2019-02-20 Zalan Bujtas <zalan@apple.com>
3094 [LFC][Floats] Make FloatAvoider::resetPosition implicit
3095 https://bugs.webkit.org/show_bug.cgi?id=194855
3097 Reviewed by Antti Koivisto.
3099 Let's compute the initial top/left position during c'tor time.
3100 This is in preparation for fixing formatting root box placement in a float context.
3102 * layout/floats/FloatAvoider.cpp:
3103 (WebCore::Layout::FloatAvoider::resetPosition): Deleted.
3104 * layout/floats/FloatAvoider.h:
3105 (WebCore::Layout::FloatAvoider::displayBox):
3106 (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
3107 * layout/floats/FloatBox.cpp:
3108 (WebCore::Layout::FloatBox::FloatBox):
3109 (WebCore::Layout::FloatBox::initialVerticalPosition const):
3110 * layout/floats/FloatBox.h:
3111 * layout/floats/FloatingContext.cpp:
3112 (WebCore::Layout::FloatingContext::floatingPosition const):
3114 2019-02-20 Don Olmstead <don.olmstead@sony.com>
3116 [MSVC] Fix compilation errors with lambdas in Service Workers
3117 https://bugs.webkit.org/show_bug.cgi?id=194841
3119 Reviewed by Alex Christensen.
3121 No new tests. No change in behavior.
3123 MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
3124 referring to the enclosing lambda according to MSVC. This patch works around this behavior
3125 through by using the `protectedThis` pattern in WebKit code.
3127 * workers/service/server/RegistrationDatabase.cpp:
3128 (WebCore::RegistrationDatabase::openSQLiteDatabase):
3130 2019-02-20 Adrian Perez de Castro <aperez@igalia.com>
3132 [WPE][GTK] Enable support for CONTENT_EXTENSIONS
3133 https://bugs.webkit.org/show_bug.cgi?id=167941
3135 Reviewed by Carlos Garcia Campos.
3137 * platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
3138 to the list of files with translatable strings.
3140 2019-02-19 Simon Fraser <simon.fraser@apple.com>
3142 REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
3143 https://bugs.webkit.org/show_bug.cgi?id=194827
3144 rdar://problem/47620594
3146 Reviewed by Antti Koivisto.
3148 Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
3149 layer configurations, since a repaint implies that a layer gains painted content. This is done
3150 via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
3151 The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
3152 for the root. The configuration state that matters here is whether the layer contains painted content,
3153 and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
3154 and feeds into GraphicsLayer::drawsContent().
3156 However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
3157 then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
3158 causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
3160 Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
3161 the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
3162 to always return false for the RenderView's layer (the root).
3164 Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
3165 properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
3166 LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
3169 Test: compositing/visibility/root-visibility-toggle.html
3172 * platform/graphics/GraphicsLayer.cpp:
3173 (WebCore::GraphicsLayer::dumpProperties const):
3174 * platform/graphics/GraphicsLayerClient.h:
3175 (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
3176 * rendering/RenderLayerBacking.cpp:
3177 (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
3178 (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
3179 * rendering/RenderLayerBacking.h:
3180 * rendering/RenderLayerCompositor.cpp:
3181 (WebCore::RenderLayerCompositor::layerTreeAsText):
3182 * testing/Internals.cpp:
3183 (WebCore::toLayerTreeFlags):
3184 * testing/Internals.h:
3185 * testing/Internals.idl:
3187 2019-02-19 Ryosuke Niwa <rniwa@webkit.org>
3189 REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
3190 https://bugs.webkit.org/show_bug.cgi?id=194820
3192 Reviewed by Geoffrey Garen.
3194 This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
3195 doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
3196 continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
3197 and we don't rely on PolicyChecker's load type until then.
3199 Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
3201 This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
3202 invoking checkNewWindowPolicy which is not the right assumption.
3204 Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
3206 * loader/FrameLoader.cpp:
3207 (WebCore::FrameLoader::loadURL):
3208 (WebCore::FrameLoader::load):
3209 (WebCore::FrameLoader::loadPostRequest):
3211 2019-02-19 Zalan Bujtas <zalan@apple.com>
3213 Fix post-commit feedback.
3217 * layout/floats/FloatingContext.cpp:
3218 (WebCore::Layout::FloatingPair::intersects const):
3220 2019-02-19 Zalan Bujtas <zalan@apple.com>
3222 [LFC][Floats] Remove redundant intersecting logic
3223 https://bugs.webkit.org/show_bug.cgi?id=194804
3225 Reviewed by Antti Koivisto.
3227 floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
3229 * layout/floats/FloatingContext.cpp:
3230 (WebCore::Layout::FloatingContext::floatingPosition const):
3231 (WebCore::Layout::FloatingPair::intersects const):
3233 2019-02-19 Commit Queue <commit-queue@webkit.org>
3235 Unreviewed, rolling out r241722.
3236 https://bugs.webkit.org/show_bug.cgi?id=194801
3238 Causing time outs and EWS failures after expectation file was
3239 added. (Requested by ShawnRoberts on #webkit).
3243 "IndexedDB: leak IDBDatabase and IDBTransacstion in layout
3245 https://bugs.webkit.org/show_bug.cgi?id=194709
3246 https://trac.webkit.org/changeset/241722
3248 2019-02-16 Darin Adler <darin@apple.com>
3250 Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
3251 https://bugs.webkit.org/show_bug.cgi?id=194752
3253 Reviewed by Daniel Bates.
3255 * Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
3256 got included because of Logger.h, but that no longer pulls in HexNumber.h.
3258 * css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
3259 * css/CSSPrimitiveValue.cpp: Ditto.
3261 * css/CSSUnicodeRangeValue.cpp:
3262 (WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
3263 of String::format and "%x".
3265 * html/HTMLMediaElement.h:
3266 (WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
3267 TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
3269 * html/canvas/WebGLRenderingContextBase.cpp:
3270 (GetErrorString): Use makeString and hex instead of String::format and "%04x".
3272 * html/track/TextTrackCue.cpp:
3273 (WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
3274 from HTMLMediaElement.h and use makeString instead of String::format. Also use
3275 the word "debug" to make it clear that it's not OK to use this string, with a
3276 pointer value serialized into it, outside of debugging.
3277 * html/track/TextTrackCue.h: Added TextTrackCue::debugString.
3279 * page/linux/ResourceUsageOverlayLinux.cpp:
3280 (WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
3281 instead of String::format and "%.1f" etc.
3283 * platform/cocoa/KeyEventCocoa.mm:
3284 (WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
3285 the old code that did each of the four characters explicitly.
3287 * platform/gamepad/mac/HIDGamepad.cpp:
3288 (WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
3290 * platform/graphics/Color.cpp:
3291 (WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
3294 * platform/graphics/FloatPolygon.cpp:
3295 (WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
3296 from the header and use makeString instead of String::format. Also use
3297 the word "debug" to make it clear that it's not OK to use this string, with a
3298 pointer value serialized into it, outside of debugging.
3299 * platform/graphics/FloatPolygon.h: Updated for the above.
3301 * platform/graphics/ca/GraphicsLayerCA.cpp:
3302 (WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
3303 (WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
3304 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3305 (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
3306 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
3307 * platform/gtk/PlatformKeyboardEventGtk.cpp:
3308 (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
3309 * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
3310 (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
3311 * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3312 (WebCore::GStreamerVideoEncoder::makeElement): Ditto.
3313 (WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
3315 * platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
3316 and "using namespace WTF".
3318 * platform/win/GDIObjectCounter.cpp:
3319 (WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
3320 * platform/win/KeyEventWin.cpp:
3321 (WebCore::keyIdentifierForWindowsKeyCode): Ditto.
3323 * rendering/FloatingObjects.cpp:
3324 (WebCore::FloatingObject::debugString const): Added. Moved string conversion here
3325 from the header and use makeString instead of String::format. Also use
3326 the word "debug" to make it clear that it's not OK to use this string, with a
3327 pointer value serialized into it, outside of debugging.
3328 * rendering/FloatingObjects.h: Updated for the above.
3330 * rendering/RenderFragmentContainer.cpp:
3331 (WebCore::RenderFragmentContainer::debugString const): Added. Moved string
3332 conversion here from the header and use makeString instead of String::format.
3333 Also use the word "debug" to make it clear that it's not OK to use this string,
3334 with a pointer value serialized into it, outside of debugging.
3335 * rendering/RenderFragmentContainer.h: Updated for the above.
3336 * rendering/RenderFragmentedFlow.h: Ditto.
3338 * testing/Internals.cpp:
3339 (WebCore::Internals::address): Use makeString instead of String::format.
3341 2019-02-18 Wenson Hsieh <wenson_hsieh@apple.com>
3343 [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
3344 https://bugs.webkit.org/show_bug.cgi?id=194670
3345 <rdar://problem/39066529>
3347 Reviewed by Tim Horton.
3349 Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
3350 switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
3351 special codepath in WebContentReader::readImage.
3353 This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
3354 attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
3355 contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
3356 attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
3357 conforms to "public.content", we take this codepath instead of first attempting the web content reading types
3358 supported by default in WebKit.
3360 See below for more detail.
3362 Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
3364 * editing/Editor.cpp:
3365 (WebCore::Editor::clientReplacementURLForResource): Deleted.
3367 * editing/WebContentReader.h:
3368 * editing/cocoa/WebContentReaderCocoa.mm:
3369 (WebCore::mimeTypeFromContentType):
3370 (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
3371 (WebCore::createFragmentAndAddResources):
3372 (WebCore::sanitizeMarkupWithArchive):
3374 Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
3376 (WebCore::WebContentReader::readImage):
3377 (WebCore::attachmentForFilePath):
3378 (WebCore::attachmentForData):
3380 Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
3381 quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
3382 of their similarities into helper functions.
3384 (WebCore::WebContentReader::readDataBuffer):
3385 (WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.