Skip to content

Update handling of timer functions#481

Merged
lukewarlow merged 3 commits intow3c:mainfrom
lukewarlow:fix-timers
Mar 27, 2024
Merged

Update handling of timer functions#481
lukewarlow merged 3 commits intow3c:mainfrom
lukewarlow:fix-timers

Conversation

@lukewarlow
Copy link
Copy Markdown
Member

@lukewarlow lukewarlow commented Mar 14, 2024

Fixes #480

This effectively follows the Chromium implementation, we use the StringContext attribute to do the enforcement for setTimeout and setInterval and then update the HostEnsureCanCompileStrings call (which now actually calls the CSP function directly) accordingly.

We then update EnsureCSPDoesNotBlockStringCompilation to only do TT validation for eval and Function, not timers.


Preview | Diff

@lukewarlow lukewarlow requested a review from koto March 14, 2024 16:49
Comment thread spec/index.bs
* |sink| set to `Window setInterval` if <var ignore>repeat</var> is true, `Window setTimeout` otherwise.
* |sinkGroup| set to `'script'`.

Note: This matches the logic that the extended attribute would apply.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We use the string context here, so no need to do any of this block.

Comment thread spec/index.bs Outdated
@lukewarlow
Copy link
Copy Markdown
Member Author

@otherdaniel you implemented this functionality in Chromium iirc would you be able to take a quick look over this PR to sanity check it?

@lukewarlow lukewarlow requested a review from a user March 26, 2024 12:12
Comment thread spec/index.bs
Comment thread spec/index.bs Outdated
Copy link
Copy Markdown
Member

@otherdaniel otherdaniel left a comment

Choose a reason for hiding this comment

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

Thank you. Generally, this looks exactly right to me!

There's one editorial nitpick with the note.
The other issue is about the definition of |compilationType|, where I might well be overlooking something. Would be good to get that resolved.

Comment thread spec/index.bs
Comment thread spec/index.bs
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
@lukewarlow
Copy link
Copy Markdown
Member Author

Based on @otherdaniel review I'm going to go ahead and merge this

@lukewarlow lukewarlow merged commit 39cc82e into w3c:main Mar 27, 2024
github-actions Bot added a commit that referenced this pull request Mar 27, 2024
SHA: 39cc82e
Reason: push, by lukewarlow

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

HTML timers as specced won't work

2 participants