[webkit-changes] [287348] trunk

2021-12-21 Thread bfulgham
Title: [287348] trunk








Revision 287348
Author bfulg...@apple.com
Date 2021-12-21 22:36:13 -0800 (Tue, 21 Dec 2021)


Log Message
Propagate app-initiated state to new ResourceRequests
https://bugs.webkit.org/show_bug.cgi?id=234015


Reviewed by Kate Cheney.

Source/WebCore:

While reviewing logging we have found that some ResourceRequest objects
are missing the correct state for app-initiated loads. Typically, these
are cases where a new ResourceRequest is created from a URL string, losing
the context that came with the original load (or the context of the page
triggering the load).

This patch corrects a number of such cases.

Tests: http/tests/app-privacy-report/app-attribution-beacon-isappinitiated.html
   http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated.html
   http/tests/app-privacy-report/new-window-isappinitiated.html
   http/tests/app-privacy-report/new-window-isnotappinitiated.html

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::WebSocketHandshake):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
* Modules/websockets/WebSocketHandshake.h:
* loader/CrossOriginAccessControl.cpp:
(WebCore::createPotentialAccessControlRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willLoadMediaElementURL):
(WebCore::FrameLoader::commitProvisionalLoad):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):

Source/WebKit:

While reviewing logging we have found that some ResourceRequest objects
are missing the correct state for app-initiated loads. Typically, these
are cases where a new ResourceRequest is created from a URL string, losing
the context that came with the original load (or the context of the page
triggering the load).

This patch corrects a number of such cases.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage): Propagate app-initiated state to newly created page.
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode const): Correct missing serialization for
app-initiated state.
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):

LayoutTests:

* http/tests/app-privacy-report/app-attribution-beacon-isappinitiated-expected.txt: Added.
* http/tests/app-privacy-report/app-attribution-beacon-isappinitiated.html: Added.
* http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated-expected.txt: Added.
* http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated.html: Added.
* http/tests/app-privacy-report/new-window-isappinitiated.html: Added.
* http/tests/app-privacy-report/new-window-isappinitiated-expected.txt: Added.
* http/tests/app-privacy-report/new-window-isnotappinitiated.html: Added.
* http/tests/app-privacy-report/new-window-isnotappinitiated-expected.txt: Added.
* http/tests/app-privacy-report/resources/new-window-isappinitiated-win.html: Added.
* http/tests/app-privacy-report/resources/new-window-isnotappinitiated-win.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp
trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.h
trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp
trunk/Source/WebCore/loader/FrameLoader.cpp
trunk/Source/WebCore/page/DOMWindow.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp


Added Paths

trunk/LayoutTests/http/tests/app-privacy-report/app-attribution-beacon-isappinitiated-expected.txt
trunk/LayoutTests/http/tests/app-privacy-report/app-attribution-beacon-isappinitiated.html
trunk/LayoutTests/http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated-expected.txt
trunk/LayoutTests/http/tests/app-privacy-report/app-attribution-beacon-isnotappinitiated.html
trunk/LayoutTests/http/tests/app-privacy-report/new-window-isappinitiated-expected.txt
trunk/LayoutTests/http/tests/app-privacy-report/new-window-isappinitiated.html
trunk/LayoutTests/http/tests/app-privacy-report/new-window-isnotappinitiated-expected.txt
trunk/LayoutTests/http/tests/app-privacy-report/new-window-isnotappinitiated.html
trunk/LayoutTests/http/tests/app-privacy-report/resources/new-window-isappinitiated-win.html
trunk/LayoutTests/http/tests/app-privacy-report/resources/new-window-isnotappinitiated-win.html




Diff

Modified: trunk/LayoutTests/ChangeLog (287347 => 287348)

--- trunk/LayoutTests/ChangeLog	2021-12-22 06:28:01 UTC (rev 287347)
+++ trunk/LayoutTests/ChangeLog	2021-12-22 06:36:13 UTC (rev 287348)
@@ -1,3 +1,22 @@
+2021-12-21  Brent Fulgham  
+
+

[webkit-changes] [287347] trunk

2021-12-21 Thread achristensen
Title: [287347] trunk








Revision 287347
Author achristen...@apple.com
Date 2021-12-21 22:28:01 -0800 (Tue, 21 Dec 2021)


Log Message
Fix some API tests after r287341
https://bugs.webkit.org/show_bug.cgi?id=232857

Source/WebKit:

I found the cause of the strange failures and verified my "fix" on an Intel Mac and an Apple Silicon Mac.

* webpushd/PushClientConnection.mm:
(WebPushD::ClientConnection::hostAppCodeSigningIdentifier):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/webpushd/PushClientConnection.mm
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (287346 => 287347)

--- trunk/Source/WebKit/ChangeLog	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Source/WebKit/ChangeLog	2021-12-22 06:28:01 UTC (rev 287347)
@@ -1,3 +1,13 @@
+2021-12-21  Alex Christensen  
+
+Fix some API tests after r287341
+https://bugs.webkit.org/show_bug.cgi?id=232857
+
+I found the cause of the strange failures and verified my "fix" on an Intel Mac and an Apple Silicon Mac.
+
+* webpushd/PushClientConnection.mm:
+(WebPushD::ClientConnection::hostAppCodeSigningIdentifier):
+
 2021-12-21  Sihui Liu  
 
 Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup


Modified: trunk/Source/WebKit/webpushd/PushClientConnection.mm (287346 => 287347)

--- trunk/Source/WebKit/webpushd/PushClientConnection.mm	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Source/WebKit/webpushd/PushClientConnection.mm	2021-12-22 06:28:01 UTC (rev 287347)
@@ -79,10 +79,15 @@
 const String& ClientConnection::hostAppCodeSigningIdentifier()
 {
 if (!m_hostAppCodeSigningIdentifier) {
+#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)
+// This isn't great, but currently the only user of webpushd in open source builds is TestWebKitAPI and codeSigningIdentifier returns the null String.
+m_hostAppCodeSigningIdentifier = "TestWebKitAPI";
+#else
 if (!m_hostAppAuditToken)
 m_hostAppCodeSigningIdentifier = String();
 else
 m_hostAppCodeSigningIdentifier = WebKit::codeSigningIdentifier(*m_hostAppAuditToken);
+#endif
 }
 
 return *m_hostAppCodeSigningIdentifier;


Modified: trunk/Tools/ChangeLog (287346 => 287347)

--- trunk/Tools/ChangeLog	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Tools/ChangeLog	2021-12-22 06:28:01 UTC (rev 287347)
@@ -1,3 +1,11 @@
+2021-12-21  Alex Christensen  
+
+Fix some API tests after r287341
+https://bugs.webkit.org/show_bug.cgi?id=232857
+
+* TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
+(TestWebKitAPI::TEST):
+
 2021-12-21  Simon Fraser  
 
 Fuzzy pixel data need to be computed in terms of CSS pixels


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm (287346 => 287347)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-22 06:28:01 UTC (rev 287347)
@@ -236,13 +236,6 @@
 
 bool stringMatches = [nsMessage hasPrefix:@"[com.apple.WebKit.TestWebKitAPI"] || [nsMessage hasPrefix:@"[TestWebKitAPI"];
 stringMatches = stringMatches && [nsMessage hasSuffix:@" Turned Debug Mode on"];
-
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && CPU(x86_64)
-// ClientConnection::hostAppCodeSigningIdentifier returns an empty string,
-// so the string is more like "[(0x7f8f4bd083f0) (1 )] Turned Debug Mode on".
-// This is of no consequence, so just make the test pass.
-stringMatches = true;
-#endif
 
 EXPECT_TRUE(stringMatches);
 if (!stringMatches)
@@ -334,14 +327,7 @@
 static bool originOperationDone = false;
 static RetainPtr origin;
 [dataStore _getOriginsWithPushAndNotificationPermissions:^(NSSet *origins) {
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && CPU(x86_64)
-// ClientConnection::hostAppCodeSigningIdentifier returns an empty string,
-// so Daemon::canRegisterForNotifications returns false.
-// This is of no consequence, so just make the test pass.
-EXPECT_EQ([origins count], 0u);
-#else
 EXPECT_EQ([origins count], 1u);
-#endif
 origin = [origins anyObject];
 originOperationDone = true;
 }];
@@ -348,10 +334,8 @@
 
 TestWebKitAPI::Util::run();
 
-#if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK) || !CPU(x86_64)
 EXPECT_WK_STREQ(origin.get().protocol, "testing");
 EXPECT_WK_STREQ(origin.get().host, "main");
-#endif
 
 // If we failed to retrieve an expected origin, we will have failed the above checks
 if (!origin) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org

[webkit-changes] [287346] trunk/Source/WebInspectorUI

2021-12-21 Thread pangle
Title: [287346] trunk/Source/WebInspectorUI








Revision 287346
Author pan...@apple.com
Date 2021-12-21 21:17:13 -0800 (Tue, 21 Dec 2021)


Log Message
Web Inspector: Assertion Failed removing subview in ContentViewContainer.prototype._disassociateFromContentView
https://bugs.webkit.org/show_bug.cgi?id=234572

Reviewed by Devin Rousso.

r283859 accidentally removed the checks that a content view is attached before attempting to remove it, leading
to an assertion.

* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype._disassociateFromContentView):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287345 => 287346)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 05:15:33 UTC (rev 287345)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 05:17:13 UTC (rev 287346)
@@ -1,5 +1,18 @@
 2021-12-21  Patrick Angle  
 
+Web Inspector: Assertion Failed removing subview in ContentViewContainer.prototype._disassociateFromContentView
+https://bugs.webkit.org/show_bug.cgi?id=234572
+
+Reviewed by Devin Rousso.
+
+r283859 accidentally removed the checks that a content view is attached before attempting to remove it, leading
+to an assertion.
+
+* UserInterface/Views/ContentViewContainer.js:
+(WI.ContentViewContainer.prototype._disassociateFromContentView):
+
+2021-12-21  Patrick Angle  
+
 Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
 https://bugs.webkit.org/show_bug.cgi?id=234570
 


Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js (287345 => 287346)

--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2021-12-22 05:15:33 UTC (rev 287345)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2021-12-22 05:17:13 UTC (rev 287346)
@@ -421,11 +421,14 @@
 return;
 }
 
-// Hidden/non-visible extension tabs must remain attached to the DOM to avoid reloading.
-if (contentView.constructor.shouldNotRemoveFromDOMWhenHidden() && !contentView.visible)
-return;
+if (contentView.constructor.shouldNotRemoveFromDOMWhenHidden()) {
+// Hidden/non-visible extension tabs must remain attached to the DOM to avoid reloading.
+if (!contentView.visible)
+return;
 
-this.removeSubview(contentView);
+if (contentView.isAttached)
+this.removeSubview(contentView);
+}
 
 console.assert(!contentView.isAttached);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287345] trunk

2021-12-21 Thread simon . fraser
Title: [287345] trunk








Revision 287345
Author simon.fra...@apple.com
Date 2021-12-21 21:15:33 -0800 (Tue, 21 Dec 2021)


Log Message
Fuzzy pixel data need to be computed in terms of CSS pixels
https://bugs.webkit.org/show_bug.cgi?id=232525

Reviewed by Tim Horton.

Tools:

Pixel tolerance is computed in CSS pixels, so have ImageDiff divide the total number of
differing pixels by the square of the scale factor (a single different pixel at 1x becomes 4
different pixels at 2x).

* ImageDiff/ImageDiff.cpp:
(processImages):
* ImageDiff/PlatformImage.cpp:
(ImageDiff::PlatformImage::isCompatible const):
(ImageDiff::PlatformImage::difference):

LayoutTests:

Add a hidpi pixel tolerance test.

* fast/harness/image-diff/hidpi-pixel-tolerance-expected.html: Added.
* fast/harness/image-diff/hidpi-pixel-tolerance.html: Added.
* platform/ios-wk2/TestExpectations: Remove fast/harness/image-diff/fuzz-2-25.html.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios-wk2/TestExpectations
trunk/Tools/ChangeLog
trunk/Tools/ImageDiff/ImageDiff.cpp
trunk/Tools/ImageDiff/PlatformImage.cpp


Added Paths

trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance-expected.html
trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance.html




Diff

Modified: trunk/LayoutTests/ChangeLog (287344 => 287345)

--- trunk/LayoutTests/ChangeLog	2021-12-22 04:52:39 UTC (rev 287344)
+++ trunk/LayoutTests/ChangeLog	2021-12-22 05:15:33 UTC (rev 287345)
@@ -1,3 +1,16 @@
+2021-12-21  Simon Fraser  
+
+Fuzzy pixel data need to be computed in terms of CSS pixels
+https://bugs.webkit.org/show_bug.cgi?id=232525
+
+Reviewed by Tim Horton.
+
+Add a hidpi pixel tolerance test.
+
+* fast/harness/image-diff/hidpi-pixel-tolerance-expected.html: Added.
+* fast/harness/image-diff/hidpi-pixel-tolerance.html: Added.
+* platform/ios-wk2/TestExpectations: Remove fast/harness/image-diff/fuzz-2-25.html.
+
 2021-12-21  Alan Bujtas  
 
 [LFC][IFC] Compute visual geometry for InlineDisplay::Line


Added: trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance-expected.html (0 => 287345)

--- trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance-expected.html	2021-12-22 05:15:33 UTC (rev 287345)
@@ -0,0 +1,16 @@
+
+
+
+
+.box {
+position: relative;
+width: 100px;
+height: 100px;
+background-color: rgb(0, 128, 0);
+}
+
+
+
+
+
+


Added: trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance.html (0 => 287345)

--- trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance.html	(rev 0)
+++ trunk/LayoutTests/fast/harness/image-diff/hidpi-pixel-tolerance.html	2021-12-22 05:15:33 UTC (rev 287345)
@@ -0,0 +1,27 @@
+
+
+
+
+
+.box {
+position: relative;
+width: 100px;
+height: 100px;
+background-color: rgb(0, 128, 0);
+}
+
+.mismatch-box {
+position: absolute;
+margin: 10px;
+width: 5px;
+height: 5px;
+background-color: rgb(0, 126, 0);
+}
+
+
+
+
+
+
+
+


Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (287344 => 287345)

--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2021-12-22 04:52:39 UTC (rev 287344)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2021-12-22 05:15:33 UTC (rev 287345)
@@ -1112,8 +1112,6 @@
 
 webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ]
 
-webkit.org/b/232525 fast/harness/image-diff/fuzz-2-25.html [ ImageOnlyFailure ]
-
 # started to fail after new snapshotting in r202532
 webkit.org/b/150942 animations/multiple-backgrounds.html [ Pass ImageOnlyFailure ]
 compositing/overlap-blending/reflection-opacity-huge.html [ ImageOnlyFailure ]


Modified: trunk/Tools/ChangeLog (287344 => 287345)

--- trunk/Tools/ChangeLog	2021-12-22 04:52:39 UTC (rev 287344)
+++ trunk/Tools/ChangeLog	2021-12-22 05:15:33 UTC (rev 287345)
@@ -1,3 +1,20 @@
+2021-12-21  Simon Fraser  
+
+Fuzzy pixel data need to be computed in terms of CSS pixels
+https://bugs.webkit.org/show_bug.cgi?id=232525
+
+Reviewed by Tim Horton.
+
+Pixel tolerance is computed in CSS pixels, so have ImageDiff divide the total number of
+differing pixels by the square of the scale factor (a single different pixel at 1x becomes 4
+different pixels at 2x).
+
+* ImageDiff/ImageDiff.cpp:
+(processImages):
+* ImageDiff/PlatformImage.cpp:
+(ImageDiff::PlatformImage::isCompatible const):
+(ImageDiff::PlatformImage::difference):
+
 2021-12-21  Alex Christensen  
 
 Re-enable ContextMenu API tests


Modified: 

[webkit-changes] [287344] trunk/Source/WebKit

2021-12-21 Thread sihui_liu
Title: [287344] trunk/Source/WebKit








Revision 287344
Author sihui_...@apple.com
Date 2021-12-21 20:52:39 -0800 (Tue, 21 Dec 2021)


Log Message
Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup
https://bugs.webkit.org/show_bug.cgi?id=234582
rdar://86787798

Reviewed by Simon Fraser.

URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly.

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::excludeDirectoryFromBackup):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (287343 => 287344)

--- trunk/Source/WebKit/ChangeLog	2021-12-22 04:18:57 UTC (rev 287343)
+++ trunk/Source/WebKit/ChangeLog	2021-12-22 04:52:39 UTC (rev 287344)
@@ -1,3 +1,16 @@
+2021-12-21  Sihui Liu  
+
+Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup
+https://bugs.webkit.org/show_bug.cgi?id=234582
+rdar://86787798
+
+Reviewed by Simon Fraser.
+
+URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly.
+
+* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+(WebKit::WebsiteDataStore::excludeDirectoryFromBackup):
+
 2021-12-21  Alex Christensen  
 
 Re-enable ContextMenu API tests


Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (287343 => 287344)

--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2021-12-22 04:18:57 UTC (rev 287343)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2021-12-22 04:52:39 UTC (rev 287344)
@@ -644,9 +644,9 @@
 
 void WebsiteDataStore::excludeDirectoryFromBackup(const String& directory)
 {
-NSURL *url = "" URLWithString:(NSString *)directory];
+NSURL *url = "" fileURLWithPath:(NSString *)directory isDirectory:YES];
 if ([[NSFileManager defaultManager] createDirectoryAtURL:url withIntermediateDirectories:YES attributes:nil error:nullptr])
-[[NSURL fileURLWithPath:(NSString *)directory isDirectory:YES] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
+[url setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
 }
 
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287343] trunk

2021-12-21 Thread achristensen
Title: [287343] trunk








Revision 287343
Author achristen...@apple.com
Date 2021-12-21 20:18:57 -0800 (Tue, 21 Dec 2021)


Log Message
Re-enable ContextMenu API tests
https://bugs.webkit.org/show_bug.cgi?id=234585
Source/WebKit:



Reviewed by Tim Horton.

UIKit changed the internal driver interface to simulate events to show context menus for our tests.
This follows the change and makes our tests work again.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _registerPreview]):

Tools:


Reviewed by Tim Horton.

* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
(TEST):
* TestWebKitAPI/cocoa/TestContextMenuDriver.h:
* TestWebKitAPI/cocoa/TestContextMenuDriver.mm:
(+[TestContextMenuDriver prefersCancelsTouchesInView]):
(-[TestContextMenuDriver cancelsTouchesInView]):
(-[TestContextMenuDriver setCancelsTouchesInView:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm
trunk/Tools/TestWebKitAPI/cocoa/TestContextMenuDriver.h
trunk/Tools/TestWebKitAPI/cocoa/TestContextMenuDriver.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (287342 => 287343)

--- trunk/Source/WebKit/ChangeLog	2021-12-22 04:17:09 UTC (rev 287342)
+++ trunk/Source/WebKit/ChangeLog	2021-12-22 04:18:57 UTC (rev 287343)
@@ -1,3 +1,18 @@
+2021-12-21  Alex Christensen  
+
+Re-enable ContextMenu API tests
+https://bugs.webkit.org/show_bug.cgi?id=234585
+
+
+Reviewed by Tim Horton.
+
+UIKit changed the internal driver interface to simulate events to show context menus for our tests.
+This follows the change and makes our tests work again.
+
+* Platform/spi/ios/UIKitSPI.h:
+* UIProcess/ios/WKContentViewInteraction.mm:
+(-[WKContentView _registerPreview]):
+
 2021-12-21  Brady Eidson  
 
 Make Notification identifiers be a UUID string instead of a uint64_t


Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (287342 => 287343)

--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2021-12-22 04:17:09 UTC (rev 287342)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2021-12-22 04:18:57 UTC (rev 287343)
@@ -1388,13 +1388,9 @@
 @end
 
 @interface _UIClickPresentationInteraction (IPI)
-@property (nonatomic, strong) _UIClickInteraction *previewClickInteraction;
+@property (nonatomic, strong /*, nullable */) NSArray> *overrideDrivers;
 @end
 
-@interface _UIClickInteraction (IPI)
-@property (nonatomic, strong) id<_UIClickInteractionDriving> driver;
-@end
-
 @interface UIContextMenuInteraction (IPI)
 @property (nonatomic, strong) _UIClickPresentationInteraction *presentationInteraction;
 @end


Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (287342 => 287343)

--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-12-22 04:17:09 UTC (rev 287342)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-12-22 04:18:57 UTC (rev 287343)
@@ -10786,11 +10786,8 @@
 _contextMenuHasRequestedLegacyData = NO;
 [self addInteraction:_contextMenuInteraction.get()];
 
-if (id<_UIClickInteractionDriving> driver = self.webView.configuration._clickInteractionDriverForTesting) {
-_UIClickInteraction *previewClickInteraction = [[_contextMenuInteraction presentationInteraction] previewClickInteraction];
-[previewClickInteraction setDriver:driver];
-[driver setDelegate:(id<_UIClickInteractionDriverDelegate>)previewClickInteraction];
-}
+if (id<_UIClickInteractionDriving> driver = self.webView.configuration._clickInteractionDriverForTesting)
+[_contextMenuInteraction presentationInteraction].overrideDrivers = @[driver];
 return;
 }
 #endif


Modified: trunk/Tools/ChangeLog (287342 => 287343)

--- trunk/Tools/ChangeLog	2021-12-22 04:17:09 UTC (rev 287342)
+++ trunk/Tools/ChangeLog	2021-12-22 04:18:57 UTC (rev 287343)
@@ -1,5 +1,20 @@
 2021-12-21  Alex Christensen  
 
+Re-enable ContextMenu API tests
+https://bugs.webkit.org/show_bug.cgi?id=234585
+
+Reviewed by Tim Horton.
+
+* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
+(TEST):
+* TestWebKitAPI/cocoa/TestContextMenuDriver.h:
+* TestWebKitAPI/cocoa/TestContextMenuDriver.mm:
+(+[TestContextMenuDriver prefersCancelsTouchesInView]):
+(-[TestContextMenuDriver cancelsTouchesInView]):
+(-[TestContextMenuDriver setCancelsTouchesInView:]):
+
+2021-12-21  Alex Christensen  
+
 Enable Fullscreen.LayoutConstraints API test
 https://bugs.webkit.org/show_bug.cgi?id=234576
 


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm (287342 => 287343)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm	2021-12-22 04:17:09 UTC (rev 287342)
+++ 

[webkit-changes] [287342] trunk/Tools

2021-12-21 Thread achristensen
Title: [287342] trunk/Tools








Revision 287342
Author achristen...@apple.com
Date 2021-12-21 20:17:09 -0800 (Tue, 21 Dec 2021)


Log Message
Enable Fullscreen.LayoutConstraints API test
https://bugs.webkit.org/show_bug.cgi?id=234576

Reviewed by Tim Horton.

Added in bug 159900 and not compiled until bug 232768, now it's giving us some useful test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm




Diff

Modified: trunk/Tools/ChangeLog (287341 => 287342)

--- trunk/Tools/ChangeLog	2021-12-22 04:09:39 UTC (rev 287341)
+++ trunk/Tools/ChangeLog	2021-12-22 04:17:09 UTC (rev 287342)
@@ -1,5 +1,17 @@
 2021-12-21  Alex Christensen  
 
+Enable Fullscreen.LayoutConstraints API test
+https://bugs.webkit.org/show_bug.cgi?id=234576
+
+Reviewed by Tim Horton.
+
+Added in bug 159900 and not compiled until bug 232768, now it's giving us some useful test coverage.
+
+* TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:
+(TestWebKitAPI::TEST):
+
+2021-12-21  Alex Christensen  
+
 Fix some API tests after r287316
 https://bugs.webkit.org/show_bug.cgi?id=232857
 


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm (287341 => 287342)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm	2021-12-22 04:09:39 UTC (rev 287341)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm	2021-12-22 04:17:09 UTC (rev 287342)
@@ -29,6 +29,7 @@
 
 #import "DeprecatedGlobalValues.h"
 #import "PlatformUtilities.h"
+#import "TestWKWebView.h"
 #import 
 #import 
 #import 
@@ -50,16 +51,15 @@
 
 namespace TestWebKitAPI {
 
-// FIXME: Fix and enable this test.
-TEST(Fullscreen, DISABLED_LayoutConstraints)
+TEST(Fullscreen, LayoutConstraints)
 {
 RetainPtr configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
 [configuration preferences]._fullScreenEnabled = YES;
-RetainPtr webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]);
+auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]);
 RetainPtr handler = adoptNS([[FullscreenStateChangeMessageHandler alloc] init]);
 [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenStateChangeHandler"];
 
-RetainPtr window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
+RetainPtr window { webView.get().hostWindow };
 webView.get().translatesAutoresizingMaskIntoConstraints = NO;
 [[window contentView] addSubview:webView.get()];
 
@@ -86,7 +86,9 @@
 TestWebKitAPI::Util::run();
 
 NSArray* finalConstraints = [[window contentView] constraints];
-ASSERT_TRUE([originalConstraints isEqual:finalConstraints]);
+EXPECT_EQ(originalConstraints.count, 4u);
+EXPECT_EQ(finalConstraints.count, 8u);
+ASSERT_TRUE([originalConstraints isEqual:[finalConstraints subarrayWithRange:NSMakeRange(0, 4)]]);
 }
 
 } // namespace TestWebKitAPI






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287341] trunk/Tools

2021-12-21 Thread achristensen
Title: [287341] trunk/Tools








Revision 287341
Author achristen...@apple.com
Date 2021-12-21 20:09:39 -0800 (Tue, 21 Dec 2021)


Log Message
Fix some API tests after r287316
https://bugs.webkit.org/show_bug.cgi?id=232857

I saw the test behavior difference on my Monterey arm64 Mac and assumed it was because it was Monterey,
but actually it's because it's an arm64 Mac.  Fix the test expectations.

* TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm




Diff

Modified: trunk/Tools/ChangeLog (287340 => 287341)

--- trunk/Tools/ChangeLog	2021-12-22 03:25:57 UTC (rev 287340)
+++ trunk/Tools/ChangeLog	2021-12-22 04:09:39 UTC (rev 287341)
@@ -1,3 +1,14 @@
+2021-12-21  Alex Christensen  
+
+Fix some API tests after r287316
+https://bugs.webkit.org/show_bug.cgi?id=232857
+
+I saw the test behavior difference on my Monterey arm64 Mac and assumed it was because it was Monterey,
+but actually it's because it's an arm64 Mac.  Fix the test expectations.
+
+* TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
+(TestWebKitAPI::TEST):
+
 2021-12-21  Wenson Hsieh  
 
 REGRESSION (12/21/2021): [iOS] TestWebKitAPI.WebKit.AddAndRemoveDataDetectors is consistently failing


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm (287340 => 287341)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-22 03:25:57 UTC (rev 287340)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-22 04:09:39 UTC (rev 287341)
@@ -237,7 +237,7 @@
 bool stringMatches = [nsMessage hasPrefix:@"[com.apple.WebKit.TestWebKitAPI"] || [nsMessage hasPrefix:@"[TestWebKitAPI"];
 stringMatches = stringMatches && [nsMessage hasSuffix:@" Turned Debug Mode on"];
 
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && __MAC_OS_X_VERSION_MIN_REQUIRED < 12
+#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && CPU(x86_64)
 // ClientConnection::hostAppCodeSigningIdentifier returns an empty string,
 // so the string is more like "[(0x7f8f4bd083f0) (1 )] Turned Debug Mode on".
 // This is of no consequence, so just make the test pass.
@@ -334,7 +334,7 @@
 static bool originOperationDone = false;
 static RetainPtr origin;
 [dataStore _getOriginsWithPushAndNotificationPermissions:^(NSSet *origins) {
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && __MAC_OS_X_VERSION_MIN_REQUIRED < 12
+#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && CPU(x86_64)
 // ClientConnection::hostAppCodeSigningIdentifier returns an empty string,
 // so Daemon::canRegisterForNotifications returns false.
 // This is of no consequence, so just make the test pass.
@@ -348,7 +348,7 @@
 
 TestWebKitAPI::Util::run();
 
-#if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 12
+#if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK) || !CPU(x86_64)
 EXPECT_WK_STREQ(origin.get().protocol, "testing");
 EXPECT_WK_STREQ(origin.get().host, "main");
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287340] trunk/Tools

2021-12-21 Thread wenson_hsieh
Title: [287340] trunk/Tools








Revision 287340
Author wenson_hs...@apple.com
Date 2021-12-21 19:25:57 -0800 (Tue, 21 Dec 2021)


Log Message
REGRESSION (12/21/2021): [iOS] TestWebKitAPI.WebKit.AddAndRemoveDataDetectors is consistently failing
https://bugs.webkit.org/show_bug.cgi?id=234574
rdar://86782559

Reviewed by Tim Horton.

This test began failing today due to DataDetectors no longer recognizing "December 21, 2021" as a valid date in
the future. Avoid this problem (at least, until the next century) by adjusting this date to be much later.

* TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html:

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html




Diff

Modified: trunk/Tools/ChangeLog (287339 => 287340)

--- trunk/Tools/ChangeLog	2021-12-22 02:31:40 UTC (rev 287339)
+++ trunk/Tools/ChangeLog	2021-12-22 03:25:57 UTC (rev 287340)
@@ -1,3 +1,18 @@
+2021-12-21  Wenson Hsieh  
+
+REGRESSION (12/21/2021): [iOS] TestWebKitAPI.WebKit.AddAndRemoveDataDetectors is consistently failing
+https://bugs.webkit.org/show_bug.cgi?id=234574
+rdar://86782559
+
+Reviewed by Tim Horton.
+
+This test began failing today due to DataDetectors no longer recognizing "December 21, 2021" as a valid date in
+the future. Avoid this problem (at least, until the next century) by adjusting this date to be much later.
+
+* TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
+(TEST):
+* TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html:
+
 2021-12-21  Brady Eidson  
 
 Make Notification identifiers be a UUID string instead of a uint64_t


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm (287339 => 287340)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm	2021-12-22 02:31:40 UTC (rev 287339)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm	2021-12-22 03:25:57 UTC (rev 287340)
@@ -142,7 +142,7 @@
 EXPECT_TRUE([results[0].value containsString:@"2 Apple Park Way, Cupertino 95014"]);
 EXPECT_WK_STREQ("SignatureBlock", results[0].type);
 EXPECT_WK_STREQ("Date", results[1].type);
-EXPECT_WK_STREQ("December 21, 2021", results[1].value);
+EXPECT_WK_STREQ("December 21, 2099", results[1].value);
 EXPECT_WK_STREQ("FlightInformation", results[2].type);
 EXPECT_WK_STREQ("AC780", results[2].value);
 


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html (287339 => 287340)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html	2021-12-22 02:31:40 UTC (rev 287339)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html	2021-12-22 03:25:57 UTC (rev 287340)
@@ -18,7 +18,7 @@
 
 
 Calendar event
-December 21, 2021
+December 21, 2099
 
 
 Flight number






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287339] trunk

2021-12-21 Thread beidson
Title: [287339] trunk








Revision 287339
Author beid...@apple.com
Date 2021-12-21 18:31:40 -0800 (Tue, 21 Dec 2021)


Log Message
Make Notification identifiers be a UUID string instead of a uint64_t
https://bugs.webkit.org/show_bug.cgi?id=234534

Reviewed by Alex Christensen.
Source/WebCore:

No new tests (Refactor, covered by existing tests)

Before this patch, Notifications were tagged with an in-WebContent-process-unique identifier
and also tagged with a UIProcess-unique identifier.

There were maps between these two identifiers in WebKit, and both of them were exposed via API/SPI
(e.g. through the injected bundle), necessitating maps between them in WKTR as well.

This simplifies things by making a UUID identifier in the WebContent process that can be treated
as the One True Identifier within WebKit.

There's existing SPI clients that rely on the UIProcess-unique uin64_t identifier, so we sadly
couldn't get rid of that entirely. But this patch still puts us in a much better place.

* Modules/notifications/Notification.cpp:
(WebCore::Notification::show):
(WebCore::Notification::close):
(WebCore::Notification::stop):
(WebCore::Notification::data const):
(WebCore::Notification::dataWithoutNotificationID const): Deleted.
* Modules/notifications/Notification.h:

* Modules/notifications/NotificationClient.h:
(WebCore::NotificationClient::clearNotifications): Deleted.
* Modules/notifications/NotificationData.h:
(WebCore::NotificationData::decode):

Source/WebKit:

This is mostly changing a whole bunch of uint64_ts to Strings, but also gets rid of lots of weird
and fragile maps.

* NetworkProcess/Notifications/NetworkNotificationManager.cpp:
(WebKit::NetworkNotificationManager::cancelNotification):
(WebKit::NetworkNotificationManager::clearNotifications):
(WebKit::NetworkNotificationManager::didDestroyNotification):
* NetworkProcess/Notifications/NetworkNotificationManager.h:
* Shared/Notifications/NotificationManagerMessageHandler.h:
* Shared/Notifications/NotificationManagerMessageHandler.messages.in:

* UIProcess/API/C/WKNotification.cpp:
(WKNotificationCopyCoreIDForTesting):
* UIProcess/API/C/WKNotification.h:

* UIProcess/API/C/WKNotificationManager.cpp:
(WKNotificationManagerProviderDidClickNotification_b):
(WKNotificationManagerProviderDidRemoveNotificationPolicies):
(WKNotificationManagerGetLocalIDForTesting): Deleted.
* UIProcess/API/C/WKNotificationManager.h:

* UIProcess/Notifications/WebNotification.cpp:
(WebKit::WebNotification::WebNotification):
* UIProcess/Notifications/WebNotification.h:
(WebKit::WebNotification::create):
(WebKit::WebNotification::notificationID const):
(WebKit::WebNotification::coreNotificationID const):
(WebKit::WebNotification::pageIdentifier const):

* UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp:
(WebKit::WebNotificationManagerMessageHandler::cancelNotification):
(WebKit::WebNotificationManagerMessageHandler::clearNotifications):
(WebKit::WebNotificationManagerMessageHandler::didDestroyNotification):
* UIProcess/Notifications/WebNotificationManagerMessageHandler.h:

* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
(WebKit::WebNotificationManagerProxy::cancel):
(WebKit::WebNotificationManagerProxy::didDestroyNotification):
(WebKit::pageIDsMatch):
(WebKit::pageAndNotificationIDsMatch):
(WebKit::WebNotificationManagerProxy::clearNotifications):
(WebKit::WebNotificationManagerProxy::providerDidShowNotification):
(WebKit::WebNotificationManagerProxy::providerDidClickNotification):
(WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
(WebKit::generateGlobalNotificationID): Deleted.
(WebKit::WebNotificationManagerProxy::notificationLocalIDForTesting): Deleted.
* UIProcess/Notifications/WebNotificationManagerProxy.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::cancelNotification):
(WebKit::WebPageProxy::clearNotifications):
(WebKit::WebPageProxy::didDestroyNotification):
* UIProcess/WebPageProxy.h:

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleCopyWebNotificationID):
(WKBundleGetWebNotificationID): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::webNotificationID):
* WebProcess/InjectedBundle/InjectedBundle.h:

* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show):
(WebKit::WebNotificationManager::cancel):
(WebKit::WebNotificationManager::didDestroyNotification):
(WebKit::WebNotificationManager::didShowNotification):
(WebKit::WebNotificationManager::didClickNotification):
(WebKit::WebNotificationManager::didCloseNotifications):
(WebKit::generateNotificationID): Deleted.
(WebKit::WebNotificationManager::notificationIDForTesting): Deleted.
(WebKit::WebNotificationManager::clearNotifications): Deleted.
(WebKit::WebNotificationManager::removeNotificationFromContextMap): Deleted.
* WebProcess/Notifications/WebNotificationManager.h:
* 

[webkit-changes] [287338] trunk/Source/WebInspectorUI

2021-12-21 Thread pangle
Title: [287338] trunk/Source/WebInspectorUI








Revision 287338
Author pan...@apple.com
Date 2021-12-21 17:39:27 -0800 (Tue, 21 Dec 2021)


Log Message
Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=234570

Reviewed by Devin Rousso.

Adding an event listener to listen for style changes every time we update the list of CSS variables isn't quite
correct because it means we may attempt to add the event listener multiple times. Instead, this should be done
in response to the InspectedNodeChanged event directly to avoid adding the event listener multiple time to the
same DOM node.

* UserInterface/Models/CSSPropertyNameCompletions.js:
(WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded):
(WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged):

Modified Paths

trunk/Source/WebInspectorUI/ChangeLog
trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js




Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (287337 => 287338)

--- trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 00:14:33 UTC (rev 287337)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-12-22 01:39:27 UTC (rev 287338)
@@ -1,3 +1,19 @@
+2021-12-21  Patrick Angle  
+
+Web Inspector: Assertion Failed adding event listener in CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded
+https://bugs.webkit.org/show_bug.cgi?id=234570
+
+Reviewed by Devin Rousso.
+
+Adding an event listener to listen for style changes every time we update the list of CSS variables isn't quite
+correct because it means we may attempt to add the event listener multiple times. Instead, this should be done
+in response to the InspectedNodeChanged event directly to avoid adding the event listener multiple time to the
+same DOM node.
+
+* UserInterface/Models/CSSPropertyNameCompletions.js:
+(WI.CSSPropertyNameCompletions.prototype._updateValuesWithLatestCSSVariablesIfNeeded):
+(WI.CSSPropertyNameCompletions.prototype._handleInspectedNodeChanged):
+
 2021-12-21  Michael Saboff  
 
 Fix symlinks for alternate root framework locations


Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js (287337 => 287338)

--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js	2021-12-22 00:14:33 UTC (rev 287337)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js	2021-12-22 01:39:27 UTC (rev 287338)
@@ -86,10 +86,7 @@
 return;
 }
 
-let nodeStyles = WI.cssManager.stylesForNode(WI.domManager.inspectedNode);
-nodeStyles.addEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
-
-let values = Array.from(nodeStyles.allCSSVariables);
+let values = Array.from(WI.cssManager.stylesForNode(WI.domManager.inspectedNode).allCSSVariables);
 values.pushAll(this._cachedSortedPropertyNames);
 this.replaceValues(values);
 
@@ -98,13 +95,12 @@
 
 _handleInspectedNodeChanged(event)
 {
-if (this._needsVariablesFromInspectedNode || !event.data.lastInspectedNode)
-return;
-
 this._needsVariablesFromInspectedNode = true;
 
-let nodeStyles = WI.cssManager.stylesForNode(event.data.lastInspectedNode);
-nodeStyles.removeEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
+if (event.data.lastInspectedNode)
+WI.cssManager.stylesForNode(event.data.lastInspectedNode).removeEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
+
+WI.cssManager.stylesForNode(WI.domManager.inspectedNode).addEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._handleNodesStylesNeedsRefresh, this);
 }
 
 _handleNodesStylesNeedsRefresh(event)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287337] branches/safari-612-branch/Source/WebCore

2021-12-21 Thread repstein
Title: [287337] branches/safari-612-branch/Source/WebCore








Revision 287337
Author repst...@apple.com
Date 2021-12-21 16:14:33 -0800 (Tue, 21 Dec 2021)


Log Message
Cherry-pick r287107. rdar://problem/85150486

Unreviewed build fix after r287077.

* platform/network/ProtectionSpaceHash.h:
(WebCore::ProtectionSpaceHash::hash):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287107 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

branches/safari-612-branch/Source/WebCore/ChangeLog
branches/safari-612-branch/Source/WebCore/platform/network/ProtectionSpaceHash.h




Diff

Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (287336 => 287337)

--- branches/safari-612-branch/Source/WebCore/ChangeLog	2021-12-22 00:14:30 UTC (rev 287336)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog	2021-12-22 00:14:33 UTC (rev 287337)
@@ -1,5 +1,23 @@
 2021-12-21  Alan Coon  
 
+Cherry-pick r287107. rdar://problem/85150486
+
+Unreviewed build fix after r287077.
+
+* platform/network/ProtectionSpaceHash.h:
+(WebCore::ProtectionSpaceHash::hash):
+
+git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+2021-12-15  Chris Dumez  
+
+Unreviewed build fix after r287077.
+
+* platform/network/ProtectionSpaceHash.h:
+(WebCore::ProtectionSpaceHash::hash):
+
+2021-12-21  Alan Coon  
+
 Cherry-pick r287077. rdar://problem/85150486
 
 http/tests/security/basic-auth-subresource.html and some other http auth tests are flaky


Modified: branches/safari-612-branch/Source/WebCore/platform/network/ProtectionSpaceHash.h (287336 => 287337)

--- branches/safari-612-branch/Source/WebCore/platform/network/ProtectionSpaceHash.h	2021-12-22 00:14:30 UTC (rev 287336)
+++ branches/safari-612-branch/Source/WebCore/platform/network/ProtectionSpaceHash.h	2021-12-22 00:14:33 UTC (rev 287337)
@@ -37,8 +37,8 @@
 Hasher hasher;
 add(hasher, protectionSpace.host());
 add(hasher, protectionSpace.port());
-add(hasher, protectionSpace.serverType());
-add(hasher, protectionSpace.authenticationScheme());
+add(hasher, static_cast(protectionSpace.serverType()));
+add(hasher, static_cast(protectionSpace.authenticationScheme()));
 if (!protectionSpace.isProxy())
 add(hasher, protectionSpace.realm());
 return hasher.hash();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [287335] branches/safari-612-branch

2021-12-21 Thread repstein
Title: [287335] branches/safari-612-branch








Revision 287335
Author repst...@apple.com
Date 2021-12-21 16:14:24 -0800 (Tue, 21 Dec 2021)


Log Message
Cherry-pick r287067. rdar://problem/86276497

Make sure to start a realtime outgoing source in case it is taken to another sender
https://bugs.webkit.org/show_bug.cgi?id=234296


Reviewed by Eric Carlson.

Source/WebCore:

We are asynchronously starting libwebrtc sources.
When a sender is created first and is assigned a source later, we take the source and assign it to the sender.
In that case, the source might not be started and we will not send any data.

Test: webrtc/addTransceiver-then-addTrack.html

* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:

LayoutTests:

* webrtc/addTransceiver-then-addTrack-expected.txt: Added.
* webrtc/addTransceiver-then-addTrack.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287067 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

branches/safari-612-branch/LayoutTests/ChangeLog
branches/safari-612-branch/Source/WebCore/ChangeLog
branches/safari-612-branch/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp


Added Paths

branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack-expected.txt
branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack.html




Diff

Modified: branches/safari-612-branch/LayoutTests/ChangeLog (287334 => 287335)

--- branches/safari-612-branch/LayoutTests/ChangeLog	2021-12-21 23:59:01 UTC (rev 287334)
+++ branches/safari-612-branch/LayoutTests/ChangeLog	2021-12-22 00:14:24 UTC (rev 287335)
@@ -1,3 +1,42 @@
+2021-12-21  Alan Coon  
+
+Cherry-pick r287067. rdar://problem/86276497
+
+Make sure to start a realtime outgoing source in case it is taken to another sender
+https://bugs.webkit.org/show_bug.cgi?id=234296
+
+
+Reviewed by Eric Carlson.
+
+Source/WebCore:
+
+We are asynchronously starting libwebrtc sources.
+When a sender is created first and is assigned a source later, we take the source and assign it to the sender.
+In that case, the source might not be started and we will not send any data.
+
+Test: webrtc/addTransceiver-then-addTrack.html
+
+* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
+
+LayoutTests:
+
+* webrtc/addTransceiver-then-addTrack-expected.txt: Added.
+* webrtc/addTransceiver-then-addTrack.html: Added.
+
+
+git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+2021-12-15  Youenn Fablet  
+
+Make sure to start a realtime outgoing source in case it is taken to another sender
+https://bugs.webkit.org/show_bug.cgi?id=234296
+
+
+Reviewed by Eric Carlson.
+
+* webrtc/addTransceiver-then-addTrack-expected.txt: Added.
+* webrtc/addTransceiver-then-addTrack.html: Added.
+
 2021-12-09  Robert Jenner  
 
 REGRESSION(r285452-r285595):[ Monterey Release ] 2 accessibility (layout-tests) are constant text failures


Added: branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack-expected.txt (0 => 287335)

--- branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack-expected.txt	(rev 0)
+++ branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack-expected.txt	2021-12-22 00:14:24 UTC (rev 287335)
@@ -0,0 +1,4 @@
+
+
+PASS Ensure addTrack reuses transceiver as expected
+


Added: branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack.html (0 => 287335)

--- branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack.html	(rev 0)
+++ branches/safari-612-branch/LayoutTests/webrtc/addTransceiver-then-addTrack.html	2021-12-22 00:14:24 UTC (rev 287335)
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+