Skip to content

feat: add placeholderValue to page source tree #1016

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ikharebashviliGD
Copy link

Summary
This PR adds support for the placeholderValue attribute to be included in the response from the /source (getPageSource) endpoint.

Motivation
Previously, placeholderValue was only available when requesting attributes for a specific element. However, this attribute is also valuable when analyzing the full accessibility tree returned by /source, particularly for identifying input fields and verifying placeholder text during automated accessibility testing.

By including placeholderValue in the full snapshot, we enable better support for end-to-end validations and tools that rely on the complete accessibility hierarchy.

Copy link

linux-foundation-easycla bot commented May 15, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Moved the logic for constructing attribute blocks into a separate method
for clarity and future extensibility. Also replaced direct type checks
with a reusable fb_supportsPlaceholder helper on FBXCElementSnapshotWrapper.
… comment

- Replaced custom placeholder support check with FBDoesElementSupportInnerText, as introduced in upstream PR
- Updated comment for fb_attributeBlockMapForSnapshot to clarify usage context and avoid confusion about method placement
@ikharebashviliGD ikharebashviliGD force-pushed the feat/add_placeholderValue_to_page_source branch from 3281454 to 7e9dbb4 Compare May 19, 2025 13:36
@@ -248,6 +238,43 @@ + (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot
return info;
}

// Helper used by `dictionaryForElement:` to assemble attribute value blocks,
// including both common attributes and conditionally included ones like placeholderValue.
+ (NSDictionary<NSString *, NSString *(^)(void)> *)fb_attributeBlockMapForSnapshot:(id<FBXCElementSnapshot>)snapshot
Copy link

@mykola-mokhnach mykola-mokhnach May 19, 2025

Choose a reason for hiding this comment

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

we do not use the snapshot instance in this method. Also wrappedSnapshot anyway contains it

Copy link
Author

@ikharebashviliGD ikharebashviliGD May 20, 2025

Choose a reason for hiding this comment

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

@mykola-mokhnach Totally agree, removed the unused snapshot parameter and renamed the method. Also noticed some tests are failing — should I do something on my side or can someone help with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants