Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate serialization of NSShadow #24079

Conversation

ddkilzer
Copy link
Contributor

@ddkilzer ddkilzer commented Feb 8, 2024

c7ecac1

Generate serialization of NSShadow
https://bugs.webkit.org/show_bug.cgi?id=268963
<rdar://107553244>

Reviewed by Brady Eidson.

* Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm:
- Export PAL::getNSShadowClass() for use in WebKit.

* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
- Add CoreIPCNSShadow.serialization.in.
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h:
- Add predeclaration for NSShadow class.
- Add NSShadow to enum class NSType.
(IPC::getClass<PlatformColor>): Add.
(IPC::getClass<NSShadow>): Add.
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::getClass<PlatformColor>): Add.
- Provide method to get UIColor.class since it's soft-linked on
  non-AppKit platforms.
(IPC::getClass<NSShadow>): Add.
- Provide method to get NSShadow.class since it's soft-linked on
  non-AppKit platforms.
(IPC::typeFromObject):
- Switch from WebCore::CocoaColor to PlatformColorClass.
- Update to handle NSShadow.
(IPC::shouldEnableStrictMode):
- Remove reference to NSShadow.
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h:
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm:
(WebKit::valueFromID):
- Add CoreIPCNSShadow.
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.h: Copied from Source/WebKit/Shared/Cocoa/CoreIPCTypes.h.
(WebKit::CoreIPCNSShadow::CoreIPCNSShadow):
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.mm: Copied from Source/WebKit/Shared/Cocoa/CoreIPCTypes.h.
(WebKit::CoreIPCNSShadow::CoreIPCNSShadow):
(WebKit::CoreIPCNSShadow::toID const):
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCTypes.h:
- Include CoreIPCNSShadow.h.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
- Add CoreIPCNSShadow.* files to the project.

* Tools/TestWebKitAPI/Tests/IPC/IPCSerialization.mm:
(ObjCHolderForTesting::encode const):
- Add RetainPtr<NSShadow> to variant for testing.
(runTestNS):
(runTestCFWithExpectedResult):
(runTestCF):
- Change lambdas to static functions so we could start to break apart
  the IPC.Serialization.Basic test, which is way too big.
(TEST(IPCSerialization, Basic)):
- Move lambdas out of of this test function.
(TEST(IPCSerialization, NSShadow)): Add.
- Test serialization of NSShadow.
(TEST(IPCSerialization, SecureCoding)):
- Remove duplicate runTestNS lambda.

Canonical link: https://commits.webkit.org/274870@main

9cf09a2

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac   πŸ§ͺ api-wpe
  πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2   πŸ§ͺ gtk-wk2
  πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim
  πŸ›  watch
βœ… πŸ›  πŸ§ͺ unsafe-merge   πŸ›  watch-sim

@ddkilzer ddkilzer self-assigned this Feb 8, 2024
@ddkilzer ddkilzer added the WebKit2 Bugs relating to the WebKit2 API layer label Feb 8, 2024
@ddkilzer ddkilzer marked this pull request as draft February 8, 2024 17:32
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 8, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 213e84b to 3493fda Compare February 9, 2024 03:08
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 3493fda to d2d4175 Compare February 9, 2024 03:19
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from d2d4175 to fce2df9 Compare February 9, 2024 04:42
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from fce2df9 to 9d69f7f Compare February 9, 2024 05:08
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for 9d69f7f. Live statuses available at the PR page, #24079

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 9d69f7f to 36b2aba Compare February 9, 2024 05:41
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 9, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 10, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 23980a5 to d6d0cc8 Compare February 10, 2024 00:01
@ddkilzer ddkilzer marked this pull request as ready for review February 10, 2024 00:51
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from d6d0cc8 to 7133fe4 Compare February 10, 2024 01:50
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 10, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 10, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 7133fe4 to 12a3f25 Compare February 10, 2024 01:58
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 10, 2024
@ddkilzer ddkilzer removed the merging-blocked Applied to prevent a change from being merged label Feb 10, 2024
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 12a3f25 to 7082b84 Compare February 10, 2024 02:18
@ddkilzer
Copy link
Contributor Author

This is interesting. The test passes on macOS with NSColor, but fails on iOS with UIColor:

{
    "Skipped": [],
    "Failed": [
        {
            "name": "TestIPC.IPCSerialization.NSShadow",
            "output": "/Volumes/Data/worker/iOS-17-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/IPC/IPCSerialization.mm:760Value of: holder == result  Actual: falseExpected: true\n"
        }
    ],
    "Crashed": [],
    "Timedout": []
}

@ddkilzer ddkilzer marked this pull request as draft February 10, 2024 17:31
@ddkilzer ddkilzer force-pushed the eng/Generate-serialization-of-NSShadow branch from 7082b84 to 9cf09a2 Compare February 16, 2024 18:02
@ddkilzer ddkilzer marked this pull request as ready for review February 16, 2024 18:06
@@ -31,6 +31,7 @@
#if PLATFORM(COCOA)

#import "WKKeyedCoder.h"
#import <WebCore/AttributedString.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot to include just for the definition of PlatformColor

@ddkilzer ddkilzer added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 16, 2024
https://bugs.webkit.org/show_bug.cgi?id=268963
<rdar://107553244>

Reviewed by Brady Eidson.

* Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm:
- Export PAL::getNSShadowClass() for use in WebKit.

* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
- Add CoreIPCNSShadow.serialization.in.
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h:
- Add predeclaration for NSShadow class.
- Add NSShadow to enum class NSType.
(IPC::getClass<PlatformColor>): Add.
(IPC::getClass<NSShadow>): Add.
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::getClass<PlatformColor>): Add.
- Provide method to get UIColor.class since it's soft-linked on
  non-AppKit platforms.
(IPC::getClass<NSShadow>): Add.
- Provide method to get NSShadow.class since it's soft-linked on
  non-AppKit platforms.
(IPC::typeFromObject):
- Switch from WebCore::CocoaColor to PlatformColorClass.
- Update to handle NSShadow.
(IPC::shouldEnableStrictMode):
- Remove reference to NSShadow.
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h:
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm:
(WebKit::valueFromID):
- Add CoreIPCNSShadow.
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.h: Copied from Source/WebKit/Shared/Cocoa/CoreIPCTypes.h.
(WebKit::CoreIPCNSShadow::CoreIPCNSShadow):
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.mm: Copied from Source/WebKit/Shared/Cocoa/CoreIPCTypes.h.
(WebKit::CoreIPCNSShadow::CoreIPCNSShadow):
(WebKit::CoreIPCNSShadow::toID const):
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.serialization.in: Added.
* Source/WebKit/Shared/Cocoa/CoreIPCTypes.h:
- Include CoreIPCNSShadow.h.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
- Add CoreIPCNSShadow.* files to the project.

* Tools/TestWebKitAPI/Tests/IPC/IPCSerialization.mm:
(ObjCHolderForTesting::encode const):
- Add RetainPtr<NSShadow> to variant for testing.
(runTestNS):
(runTestCFWithExpectedResult):
(runTestCF):
- Change lambdas to static functions so we could start to break apart
  the IPC.Serialization.Basic test, which is way too big.
(TEST(IPCSerialization, Basic)):
- Move lambdas out of of this test function.
(TEST(IPCSerialization, NSShadow)): Add.
- Test serialization of NSShadow.
(TEST(IPCSerialization, SecureCoding)):
- Remove duplicate runTestNS lambda.

Canonical link: https://commits.webkit.org/274870@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Generate-serialization-of-NSShadow branch from 9cf09a2 to c7ecac1 Compare February 16, 2024 20:32
@webkit-commit-queue
Copy link
Collaborator

Committed 274870@main (c7ecac1): https://commits.webkit.org/274870@main

Reviewed commits have been landed. Closing PR #24079 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit c7ecac1 into WebKit:main Feb 16, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 16, 2024
@ddkilzer ddkilzer deleted the eng/Generate-serialization-of-NSShadow branch February 16, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit2 Bugs relating to the WebKit2 API layer
Projects
None yet
6 participants