mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
feat(libSceNKWebKit): implement WKAXObject property getters
This commit is contained in:
1 parent
9ab6a281ea
commit
5bc9e26569
7 files changed
+86
-24
No files matched your search
@@ -12604,21 +12604,6 @@ int APS5_VABI WKAXObjectButtonState() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
}
|
||||
|
||||
int APS5_VABI WKAXObjectCopyDescription() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
}
|
||||
|
||||
int APS5_VABI WKAXObjectCopyHelpText() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
}
|
||||
|
||||
int APS5_VABI WKAXObjectCopyTitle() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
}
|
||||
|
||||
int APS5_VABI WKAXObjectCopyURL() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
}
|
||||
|
||||
int APS5_VABI WKAXObjectFrame() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
|
||||
@@ -32,10 +32,6 @@ int APS5_VABI JSRemoteInspectorStart();
|
||||
int APS5_VABI JSRunLoop();
|
||||
int APS5_VABI JSSetOptions();
|
||||
int APS5_VABI WKAXObjectButtonState();
|
||||
int APS5_VABI WKAXObjectCopyDescription();
|
||||
int APS5_VABI WKAXObjectCopyHelpText();
|
||||
int APS5_VABI WKAXObjectCopyTitle();
|
||||
int APS5_VABI WKAXObjectCopyURL();
|
||||
int APS5_VABI WKAXObjectFrame();
|
||||
int APS5_VABI WKAXObjectPage();
|
||||
int APS5_VABI WKAXObjectRole();
|
||||
|
||||
@@ -14,6 +14,10 @@ struct RectValue;
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t APS5_VABI WKAXObjectGetTypeID();
|
||||
const void* APS5_VABI WKAXObjectCopyTitle(const void* objectRef);
|
||||
const void* APS5_VABI WKAXObjectCopyDescription(const void* objectRef);
|
||||
const void* APS5_VABI WKAXObjectCopyHelpText(const void* objectRef);
|
||||
const void* APS5_VABI WKAXObjectCopyURL(const void* objectRef);
|
||||
std::uint32_t APS5_VABI WKApplicationCacheManagerGetTypeID();
|
||||
void APS5_VABI WKArrayAppendItem(void* arrayRef, const void* itemRef);
|
||||
const void* APS5_VABI WKArrayCreate(const void** values, std::size_t numberOfValues);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "prx/libSceNKWebKit/include/WebKitValueExports.hpp"
|
||||
#include "prx/libSceNKWebKit/src/Types.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
const void* APS5_VABI WKAXObjectCopyTitle(const void* objectRef) {
|
||||
const auto* object = NKWebKit::Cast<NKWebKit::AccessibilityObject>(objectRef, __func__);
|
||||
return object->title ? NKWebKit::ToRef(object->title) : nullptr;
|
||||
}
|
||||
|
||||
const void* APS5_VABI WKAXObjectCopyDescription(const void* objectRef) {
|
||||
const auto* object = NKWebKit::Cast<NKWebKit::AccessibilityObject>(objectRef, __func__);
|
||||
return object->description ? NKWebKit::ToRef(object->description) : nullptr;
|
||||
}
|
||||
|
||||
const void* APS5_VABI WKAXObjectCopyHelpText(const void* objectRef) {
|
||||
const auto* object = NKWebKit::Cast<NKWebKit::AccessibilityObject>(objectRef, __func__);
|
||||
return object->helpText ? NKWebKit::ToRef(object->helpText) : nullptr;
|
||||
}
|
||||
|
||||
const void* APS5_VABI WKAXObjectCopyURL(const void* objectRef) {
|
||||
const auto* object = NKWebKit::Cast<NKWebKit::AccessibilityObject>(objectRef, __func__);
|
||||
return object->url ? NKWebKit::ToRef(object->url) : nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,4 +101,12 @@ public:
|
||||
bool valid = false;
|
||||
};
|
||||
|
||||
class AccessibilityObject final : public ObjectOf<ObjectType::AccessibilityObject> {
|
||||
public:
|
||||
Retained<String> title;
|
||||
Retained<String> description;
|
||||
Retained<String> helpText;
|
||||
Retained<String> url;
|
||||
};
|
||||
|
||||
} // namespace NKWebKit
|
||||
@@ -397,6 +397,51 @@ static void TestError() {
|
||||
WKRelease(domain);
|
||||
}
|
||||
|
||||
static void TestAXObject() {
|
||||
Require(WKAXObjectGetTypeID() == 132);
|
||||
auto ax = NKWebKit::Make<NKWebKit::AccessibilityObject>();
|
||||
const void* ref = ax.Get();
|
||||
|
||||
Require(WKAXObjectCopyTitle(ref) == nullptr);
|
||||
Require(WKAXObjectCopyDescription(ref) == nullptr);
|
||||
Require(WKAXObjectCopyHelpText(ref) == nullptr);
|
||||
Require(WKAXObjectCopyURL(ref) == nullptr);
|
||||
|
||||
ax->title = NKWebKit::String::FromUtf8("Submit Button");
|
||||
ax->description = NKWebKit::String::FromUtf8("Submits the form");
|
||||
ax->helpText = NKWebKit::String::FromUtf8("Click to send your input");
|
||||
ax->url = NKWebKit::String::FromUtf8("https://example.com/action");
|
||||
|
||||
auto* title = WKAXObjectCopyTitle(ref);
|
||||
Require(title != nullptr);
|
||||
Require(WKStringIsEqualToUTF8CString(title, "Submit Button"));
|
||||
WKRelease(title);
|
||||
|
||||
auto* desc = WKAXObjectCopyDescription(ref);
|
||||
Require(desc != nullptr);
|
||||
Require(WKStringIsEqualToUTF8CString(desc, "Submits the form"));
|
||||
WKRelease(desc);
|
||||
|
||||
auto* help = WKAXObjectCopyHelpText(ref);
|
||||
Require(help != nullptr);
|
||||
Require(WKStringIsEqualToUTF8CString(help, "Click to send your input"));
|
||||
WKRelease(help);
|
||||
|
||||
auto* url = WKAXObjectCopyURL(ref);
|
||||
Require(url != nullptr);
|
||||
Require(WKGetTypeID(url) == WKStringGetTypeID());
|
||||
Require(WKStringIsEqualToUTF8CString(url, "https://example.com/action"));
|
||||
WKRelease(url);
|
||||
|
||||
bool threw = false;
|
||||
try {
|
||||
WKAXObjectCopyTitle(nullptr);
|
||||
} catch (const std::invalid_argument&) {
|
||||
threw = true;
|
||||
}
|
||||
Require(threw);
|
||||
}
|
||||
|
||||
static void TestCertificateInfo() {
|
||||
Require(WKCertificateInfoGetTypeID() == 0);
|
||||
Require(WKCertificateInfoCreateWithCertficateChain(nullptr) == nullptr);
|
||||
@@ -420,6 +465,7 @@ int main() {
|
||||
TestUserContentURLPattern();
|
||||
TestURLRequestResponse();
|
||||
TestError();
|
||||
TestAXObject();
|
||||
TestCertificateInfo();
|
||||
std::printf("All libSceNKWebKit Base tests passed!\n");
|
||||
return 0;
|
||||
|
||||
@@ -33,7 +33,7 @@ Inventory prose retains historical counts; use the [generated progress report](h
|
||||
|
||||
- The [revision-pinned identity inventory](https://gist.github.com/kyon-eth/d44995f181e1818977bd38f0e6fc0f34/8afcb14b0707a09b6274ff7f7bcf33ef46cfe2e7) records the module, library, symbol type and NIDs for the declarations in [Export.cpp](../../../core/libs/prx/libSceNKWebKit/Export.cpp); it is a metadata summary rather than independent verification. For the 255 absent from the public catalogue, [per-image ELF records](https://gist.github.com/kyon-eth/147be8dd556e9cced2577ccbed548972/1a659ecfe819e724675991a574a1aebb5fbb48e5) include the raw qualified names, module and library identities, symbol type, values and sizes; the record file SHA-256 is `44bdc4d6073192a8f41b7be359b75364b3d41dbbd11ce649924b8cebdd4ffe51`. Image labels are not authenticated.
|
||||
|
||||
- [Additional callable exports](../../../core/libs/prx/libSceNKWebKit/Export.cpp) - 7429 of the 8703 inventory declarations listed below throw through `NotImplemented_nid_no_patch`; signatures and behavior are unverified. The later 13.60-labelled image contains all 8703; 8448 match the public 3.20 catalogue, while 255 are absent and their presence in retail 3.20 is unverified. Per-image records show the latter in a separate 3.20-labelled image, but neither image label is authenticated. Identified names match NIDs in the [public symbol database](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv) or [supplemental catalog](https://github.com/claimore22/ps5rs/blob/2304be5131221bae0dac24b9767cabffda33f747/data/nids.csv). Data exports need separate analysis.
|
||||
- [Additional callable exports](../../../core/libs/prx/libSceNKWebKit/Export.cpp) - 7425 of the 8703 inventory declarations listed below throw through `NotImplemented_nid_no_patch`; signatures and behavior are unverified. The later 13.60-labelled image contains all 8703; 8448 match the public 3.20 catalogue, while 255 are absent and their presence in retail 3.20 is unverified. Per-image records show the latter in a separate 3.20-labelled image, but neither image label is authenticated. Identified names match NIDs in the [public symbol database](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv) or [supplemental catalog](https://github.com/claimore22/ps5rs/blob/2304be5131221bae0dac24b9767cabffda33f747/data/nids.csv). Data exports need separate analysis.
|
||||
|
||||
| Name | NID |
|
||||
| --- | --- |
|
||||
@@ -46,10 +46,6 @@ Inventory prose retains historical counts; use the [generated progress report](h
|
||||
| `JSRunLoop` | `Olb6L5-YCBE` |
|
||||
| `JSSetOptions` | `vE61ounVJEI` |
|
||||
| `WKAXObjectButtonState` | `Dp64o6lCLkM` |
|
||||
| `WKAXObjectCopyDescription` | `YHG4TtOxLmw` |
|
||||
| `WKAXObjectCopyHelpText` | `XEncuQcKGeQ` |
|
||||
| `WKAXObjectCopyTitle` | `KYRL0uRR90o` |
|
||||
| `WKAXObjectCopyURL` | `Np-E0FZrqkQ` |
|
||||
| `WKAXObjectFrame` | `huPnixU5dNc` |
|
||||
| `WKAXObjectPage` | `KrVXrd3WyfM` |
|
||||
| `WKAXObjectRole` | `pt0Eyg26hqw` |
|
||||
@@ -7466,3 +7462,4 @@ Inventory prose retains historical counts; use the [generated progress report](h
|
||||
- [parseDateFromNullTerminatedCharacters(const char*, bool&)](../../../core/libs/prx/libSceNKWebKit/DateParsing.cpp) (libSceNKWebKit) - is not measured on a device, and throws where pinned [DateMath.cpp](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/DateMath.cpp#L684-L988) overflows a signed integer, which is undefined there (the `YYYY/MM/DD` day count, the `GMT+hh:mm` minute total and comment nesting), and for a null argument, where WebKit faults.
|
||||
- [WTF decimal parsing](../../../core/libs/prx/libSceNKWebKit/CharactersToNumber.cpp) - the device's WebKit revision is unverified; `charactersToDouble`, `charactersToFloat` and `StringToDoubleConverter` follow pinned WebKit [toDoubleType](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/text/WTFString.cpp#L1040-L1098) and [StringToIeee](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/dtoa/double-conversion.cc#L459-L664). Under a rounding mode other than round-to-nearest, WebKit's [exact-power fast path](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/dtoa/strtod.cc#L219-L254) and the double-to-float cast in [Strtof](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/dtoa/strtod.cc#L485-L588) round in the current mode and the host conversion may round differently.
|
||||
- [WTF decimal parsing limits](../../../core/libs/prx/libSceNKWebKit/CharactersToNumber.cpp) - inputs of about 1 GiB or more whose decimal exponent leaves the range of WebKit's [`int` exponent](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/dtoa/double-conversion.cc#L488-L490) throw, where WebKit overflows. A UTF-16 `charactersTo*` length above `UINT32_MAX` after leading spaces throws where WebKit's [conversion Vector](https://github.com/WebKit/WebKit/blob/c55364d53f97/Source/WTF/wtf/Vector.h#L291-L293) crashes.
|
||||
- [WKAXObject property getters](../../../core/libs/prx/libSceNKWebKit/src/AccessibilityObject.cpp) (libSceNKWebKit) - accessibility objects are test-driven until accessibility tree queries produce them.
|
||||
Reference in new issue
Block a user