Bug 143055 - Apply ContentExtension actions after redirects
Summary: Apply ContentExtension actions after redirects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-25 12:12 PDT by Brady Eidson
Modified: 2015-03-26 11:00 PDT (History)
6 users (show)

See Also:


Attachments
WIP for posterity (16.12 KB, patch)
2015-03-25 12:17 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v1 (24.79 KB, patch)
2015-03-25 14:14 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v2 (25.88 KB, patch)
2015-03-25 14:52 PDT, Brady Eidson
achristensen: review+
achristensen: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-mavericks-wk2 (992.84 KB, application/zip)
2015-03-25 15:38 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews101 for mac-mavericks (720.33 KB, application/zip)
2015-03-25 16:01 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2015-03-25 12:12:22 PDT
Apply ContentExtension actions after redirects

rdar://problem/20062613
Comment 1 Brady Eidson 2015-03-25 12:17:59 PDT
Created attachment 249422 [details]
WIP for posterity

This is probably a pretty final-ish patch, but I'm working on layout tests to cover both main resources and subresources.
Comment 2 Brady Eidson 2015-03-25 14:14:52 PDT
Created attachment 249425 [details]
Patch v1
Comment 3 WebKit Commit Bot 2015-03-25 14:17:32 PDT
Attachment 249425 [details] did not pass style-queue:


ERROR: Tools/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
ERROR: Source/WebCore/contentextensions/ContentExtensionsBackend.h:68:  The parameter name "request" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Alex Christensen 2015-03-25 14:39:46 PDT
Comment on attachment 249425 [details]
Patch v1

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

> LayoutTests/http/tests/contentextensions/subresource-redirect-blocked.html:1
> +This page has an image.<br>

Don't you need subresource-redirect-blocked-expected.txt?

> Source/WebCore/contentextensions/ContentExtensionsBackend.h:68
> +    void processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType, DocumentLoader& initiatingDocumentLoader);

request

> Source/WebCore/loader/NetscapePlugInStreamLoader.cpp:48
> +    m_resourceType = ResourceType::PlugInStream;

This should be m_resourceType(ResourceType::PlugInStream)

> Tools/ChangeLog:4
> +        Need a short description (OOPS!).
> +        Need the bug URL (OOPS!).

forgot
Comment 5 Brady Eidson 2015-03-25 14:51:56 PDT
(In reply to comment #4)
> Comment on attachment 249425 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=249425&action=review
> 
> > LayoutTests/http/tests/contentextensions/subresource-redirect-blocked.html:1
> > +This page has an image.<br>
> 
> Don't you need subresource-redirect-blocked-expected.txt?

Yup, forgot to git-add it

> 
> > Source/WebCore/contentextensions/ContentExtensionsBackend.h:68
> > +    void processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType, DocumentLoader& initiatingDocumentLoader);
> 
> request

Yup, gone.

> 
> > Source/WebCore/loader/NetscapePlugInStreamLoader.cpp:48
> > +    m_resourceType = ResourceType::PlugInStream;
> 
> This should be m_resourceType(ResourceType::PlugInStream)

Can't be - m_resourceType belongs to the base class, can't be included in subclass initialized lists

> 
> > Tools/ChangeLog:4
> > +        Need a short description (OOPS!).
> > +        Need the bug URL (OOPS!).
> 
> forgot

I sure did!
Comment 6 Brady Eidson 2015-03-25 14:52:32 PDT
Created attachment 249431 [details]
Patch v2
Comment 7 Alex Christensen 2015-03-25 15:27:27 PDT
Comment on attachment 249431 [details]
Patch v2

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

Looks good except these small things:

> Source/WebCore/loader/NetscapePlugInStreamLoader.cpp:48
> +    m_resourceType = ResourceType::PlugInStream;

m_resourceType(ResourceType::PlugInStream)

> Source/WebCore/loader/ResourceLoadInfo.h:44
> +    PlugInStream = 0x0100,

You also need to change LoadType::FirstParty LoadType::ThirdParty so this doesn't overlap.  Maybe these should be made one enum so that is more obvious.
Comment 8 Build Bot 2015-03-25 15:38:15 PDT
Comment on attachment 249431 [details]
Patch v2

Attachment 249431 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5576653375799296

New failing tests:
svg/as-image/svg-image-with-svg-data-uri.html
svg/as-image/svg-image-with-data-uri-from-canvas.html
svg/as-image/svg-image-with-data-uri-reloading.html
svg/as-image/svg-image-with-data-uri-background.html
svg/as-image/svg-image-with-data-uri-use-data-uri.svg
svg/as-image/img-zoom-svg-stylesheet.html
svg/as-image/svg-image-with-data-uri-images-disabled.html
Comment 9 Build Bot 2015-03-25 15:38:19 PDT
Created attachment 249434 [details]
Archive of layout-test-results from ews106 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 10 Alex Christensen 2015-03-25 15:43:30 PDT
(In reply to comment #8)
> Comment on attachment 249431 [details]
> Patch v2
> 
> Attachment 249431 [details] did not pass mac-wk2-ews (mac-wk2):
> Output: http://webkit-queues.appspot.com/results/5576653375799296
> 
> New failing tests:
> svg/as-image/svg-image-with-svg-data-uri.html
> svg/as-image/svg-image-with-data-uri-from-canvas.html
> svg/as-image/svg-image-with-data-uri-reloading.html
> svg/as-image/svg-image-with-data-uri-background.html
> svg/as-image/svg-image-with-data-uri-use-data-uri.svg
> svg/as-image/img-zoom-svg-stylesheet.html
> svg/as-image/svg-image-with-data-uri-images-disabled.html

I knew you didn't run all tests on all platforms!  Please check these before landing.
Comment 11 Build Bot 2015-03-25 16:01:03 PDT
Comment on attachment 249431 [details]
Patch v2

Attachment 249431 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5283148732563456

New failing tests:
svg/as-image/svg-image-with-svg-data-uri.html
svg/as-image/svg-image-with-data-uri-from-canvas.html
svg/as-image/svg-image-with-data-uri-reloading.html
svg/as-image/svg-image-with-data-uri-background.html
svg/as-image/svg-image-with-data-uri-use-data-uri.svg
svg/as-image/img-zoom-svg-stylesheet.html
svg/as-image/svg-image-with-data-uri-images-disabled.html
Comment 12 Build Bot 2015-03-25 16:01:08 PDT
Created attachment 249436 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 13 Brady Eidson 2015-03-25 16:50:48 PDT
Will definitely look at tests before landing.
Comment 14 Brady Eidson 2015-03-25 16:52:40 PDT
(In reply to comment #7)
> Comment on attachment 249431 [details]
> Patch v2
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=249431&action=review
> 
> Looks good except these small things:
> 
> > Source/WebCore/loader/NetscapePlugInStreamLoader.cpp:48
> > +    m_resourceType = ResourceType::PlugInStream;
> 
> m_resourceType(ResourceType::PlugInStream)

As mentioned above - That's initializer syntax, but this can't be an initializer, as the variable belongs to the super class.

> 
> > Source/WebCore/loader/ResourceLoadInfo.h:44
> > +    PlugInStream = 0x0100,
> 
> You also need to change LoadType::FirstParty LoadType::ThirdParty so this
> doesn't overlap.  Maybe these should be made one enum so that is more
> obvious.

That was *not* obvious. Will change.
Comment 15 Brady Eidson 2015-03-26 10:57:08 PDT
http://trac.webkit.org/changeset/182016
Comment 16 Brady Eidson 2015-03-26 11:00:36 PDT
The layout test failures were a missing null check on UserContentController that has now been added.