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

Editorial: change style of preload integrity metadata test #10924

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

domenic
Copy link
Member

@domenic domenic commented Jan 17, 2025

  • It previously had a misplaced "; or" and an extra ";"
  • Move from !(A || B) to !A && !B for clarity

/links.html ( diff )

* It previously had a misplaced "; or" and an extra ";"
* Move from !(A || B) to !A && !B for clarity

<ul>
<li><p><var>consumerIntegrityMetadata</var> is <code data-x="">no metadata</code>;</p></li>
<li><p><var>consumerIntegrityMetadata</var> is not <code data-x="">no metadata</code>;
Copy link
Member

Choose a reason for hiding this comment

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

This should probably have quotes?

Though then I looked at https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata and I no longer understand how this even works. I guess SRI changed underneath us or am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch. I think it's straightforward to fix, so I pushed something. I'll be sure to update the commit message when merging.

Copy link
Member

Choose a reason for hiding this comment

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

Presumably this should use "map is empty"?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, an integrity metadata is now a set of maps, so it's comparing the sets.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, why don't they store it as algorithm -> value? Weird.


<ul>
<li><p><var>consumerIntegrityMetadata</var> is <code data-x="">no metadata</code>;</p></li>
<li><p><var>consumerIntegrityMetadata</var> is not <code data-x="">no metadata</code>;
Copy link
Member

Choose a reason for hiding this comment

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

Presumably this should use "map is empty"?

<p><var>consumerIntegrityMetadata</var> is equal to <var>preloadIntegrityMetadata</var>;
or</p>
<p><var>consumerIntegrityMetadata</var> is not equal to
<var>preloadIntegrityMetadata</var></p>
Copy link
Member

Choose a reason for hiding this comment

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

So this compares the maps? Feels a little sketchy to do that this way, but note that with this new style of parsing the XXX below is resolved as we do now ignore unknown integrity options. Not sure that is tested however and I would also be surprised if it matches implementations.

cc @noamr

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah fair, this should probably use "not deeply equal" (without linking to anything, since we haven't defined that).

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

Successfully merging this pull request may close these issues.

2 participants