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

Use 'InvalidStateError' for fully active check #245

Merged
merged 3 commits into from
Jul 26, 2024
Merged

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Jul 16, 2024

In order to make errors more distinguishable, it would be good if we could use "InvalidStateError" instead for fully active checks.

The following tasks have been completed:

Implementation commitment:


Preview | Diff

@marcoscaceres
Copy link
Member Author

We have a little bit of an over-reliance on NotAllowedError in the spec.

@nsatragno
Copy link
Member

Looks good. This is a breaking change, could you accompany it with a WPT so we don't forget to make the corresponding change in chromium?

index.bs Outdated
@@ -951,7 +951,7 @@ spec:css-syntax-3;
1. Assert: |settings| is a [=secure context=].

1. If |settings|'s [=relevant global object=]'s [=associated Document=] is not [=Document/fully active=],
then return [=a promise rejected with=] "{{NotAllowedError}}" {{DOMException}}.
Copy link
Member

Choose a reason for hiding this comment

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

Actually, we should also make the change for the other algorithms (request, store, prevent silent access, and create), no?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yes, totally... will make those changes too.

index.bs Outdated Show resolved Hide resolved
@marcoscaceres
Copy link
Member Author

Looks good. This is a breaking change, could you accompany it with a WPT so we don't forget to make the corresponding change in chromium?

Absolutely! Will update the tests now.

@marcoscaceres
Copy link
Member Author

marcoscaceres commented Jul 26, 2024

Sent web-platform-tests/wpt#47306

marcoscaceres added a commit to marcoscaceres/WebKit that referenced this pull request Jul 26, 2024
https://bugs.webkit.org/show_bug.cgi?id=277125
rdar://132552299

Reviewed by NOBODY (OOPS!).

Switched from NotAllowedError to InvalidStateError for non-fully active documents.
Spec change:
w3c/webappsec-credential-management#245

* LayoutTests/imported/w3c/web-platform-tests/credential-management/non-fully-active.https.html:
* Source/WebCore/Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::preventSilentAccess const):
(WebCore::CredentialsContainer::performCommonChecks):
Copy link
Member

@nsatragno nsatragno left a comment

Choose a reason for hiding this comment

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

Approved, thank you!

@nsatragno nsatragno merged commit 991c1ec into main Jul 26, 2024
2 checks passed
@nsatragno nsatragno deleted the invalid-state branch July 26, 2024 19:32
github-actions bot added a commit that referenced this pull request Jul 26, 2024
SHA: 991c1ec
Reason: push, by nsatragno

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@nsatragno
Copy link
Member

Chromium bug: https://crbug.com/355603420

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.

None yet

2 participants