Bug 228965 - Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set
Summary: Meta HTTP refresh should not navigate if document has sandboxed automatic fea...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-10 12:21 PDT by Chris Dumez
Modified: 2021-08-10 16:20 PDT (History)
14 users (show)

See Also:


Attachments
Patch (17.63 KB, patch)
2021-08-10 12:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (17.60 KB, patch)
2021-08-10 15:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-08-10 12:21:56 PDT
Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set:
- https://html.spec.whatwg.org/multipage/semantics.html#shared-declarative-refresh-steps (Step 13)

Firefox and Chrome already behave this way.
Comment 1 Chris Dumez 2021-08-10 12:26:39 PDT
Created attachment 435281 [details]
Patch
Comment 2 Darin Adler 2021-08-10 15:05:20 PDT
Comment on attachment 435281 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=435281&action=review

> Source/WebCore/loader/NavigationScheduler.cpp:186
> +            if (auto* document = frame.document()) {
> +                if (document->isSandboxed(SandboxAutomaticFeatures)) {

Rather than nesting, I like this style:

    if (auto document = frame.document(); document && document->isSandboxed(SandboxAutomaticFeatures) {
Comment 3 Darin Adler 2021-08-10 15:05:45 PDT
Comment on attachment 435281 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=435281&action=review

>> Source/WebCore/loader/NavigationScheduler.cpp:186
>> +                if (document->isSandboxed(SandboxAutomaticFeatures)) {
> 
> Rather than nesting, I like this style:
> 
>     if (auto document = frame.document(); document && document->isSandboxed(SandboxAutomaticFeatures) {

Not saying you must change this, just telling you the style I prefer.
Comment 4 Chris Dumez 2021-08-10 15:06:41 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 435281 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=435281&action=review
> 
> >> Source/WebCore/loader/NavigationScheduler.cpp:186
> >> +                if (document->isSandboxed(SandboxAutomaticFeatures)) {
> > 
> > Rather than nesting, I like this style:
> > 
> >     if (auto document = frame.document(); document && document->isSandboxed(SandboxAutomaticFeatures) {
> 
> Not saying you must change this, just telling you the style I prefer.

Oh, indeed. It is nicer and will make the update. My brain just hasn't adjusted to the new C++ syntax yet :)
Comment 5 Chris Dumez 2021-08-10 15:14:34 PDT
Created attachment 435302 [details]
Patch
Comment 6 EWS 2021-08-10 16:19:11 PDT
Committed r280870 (240409@main): <https://commits.webkit.org/240409@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435302 [details].
Comment 7 Radar WebKit Bug Importer 2021-08-10 16:20:23 PDT
<rdar://problem/81766558>