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

WIP: WG fallbacks for missing Size/Posn and missing per-component WG code #345

Open
wants to merge 7 commits into
base: devt
Choose a base branch
from

Conversation

cursork
Copy link
Contributor

@cursork cursork commented Jan 11, 2025

Attempts two issues:

Fallback # 1: At least partially, issues such as #303 . There may be more to #303 , but this essentially allows every component to support a default implementation of Size and Posn. This is found by querying the bounding box on the rendered HTML. If you request Size and Posn on something that is not rendered, you get {'Size': [0, 0], 'Posn': [0, 0]}. This won't happen if there's custom code providing a Size and Posn already.

Fallback # 2: WG calls with no implementation would silently fail, even though the WC succeeded and the data exists in the client-side representation of the tree. A default implementation simply now tries to fetch the requested data directly from the tree, returning whatever it can find.

Add a generic WG handler when no custom one is found - simply
queries what data we have in refData.

Universal Size and Posn checks if they were requested and not set
in the response to be returned. If not found, will query the DOM
to find the size and position.
Add a generic WG handler when no custom one is found - simply
queries what data we have in refData.

Universal Size and Posn checks if they were requested and not set
in the response to be returned. If not found, will query the DOM
to find the size and position.
@cursork cursork changed the base branch from main to devt January 12, 2025 06:27
The many if statements formed a quasi switch statement, and as
there was no default, it worked fine. I know need a default
and it's easier to avoid mistakes if we use else if statements.

Don't crash on invalid IDs for size and pos, return [0, 0] as
sentinel values.
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.

1 participant