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

CSS and SharedArrayBuffer: don't make support conditional #17689

Merged
merged 1 commit into from
Aug 7, 2019

Conversation

annevk
Copy link
Member

@annevk annevk commented Jul 9, 2019

No description provided.

}
childFragment = yield child.layoutNextFragment({
data: { sab: new SharedArrayBuffer(4) }
});
} catch(e) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This also seems kinda wrong as the specific error is not checked. Why is this not using assert_throws?

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently the test passes if SAB isn't supported (but the API otherwise works). I assume that's intentional. If so, then it can't just use assert_throws, as that method can only check for one type of error at a time.

But I agree that restructuring it to use assert_throws (rather than a catch and then implicit success) would be better.

Copy link
Member Author

Choose a reason for hiding this comment

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

SAB shouldn't be optional.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry, your response is too terse for me to understand. Are you saying that it's okay for the test to fail if SAB isn't supported? This isn't intended to be a test for SAB support.

Copy link
Member Author

Choose a reason for hiding this comment

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

The test is only relevant if SharedArrayBuffer is supported. Having a test always succeed when a feature it's testing isn't supported is a not a pattern we generally follow and I'd rather we don't, ever.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's reasonable.

@yutakahirano
Copy link
Contributor

Don't we need COOP & COEP?

Also can you provide a change description?

@annevk
Copy link
Member Author

annevk commented Aug 7, 2019

They're both testing that passing SAB somewhere throws. However, they only test this if SAB is in fact present. All this does is remove that conditional. This doesn't require COOP/COEP, as SAB should be available by default, it's just that postMessage() is guarded by COOP/COEP, but that's not an API involved here.

@annevk annevk merged commit 738b3a2 into master Aug 7, 2019
@annevk annevk deleted the annevk/css-sab branch August 7, 2019 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants