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

Don't prefetch images when they exist within <noscript> tags #84

Closed
burg opened this issue Sep 22, 2012 · 6 comments
Closed

Don't prefetch images when they exist within <noscript> tags #84

burg opened this issue Sep 22, 2012 · 6 comments

Comments

@burg
Copy link

@burg burg commented Sep 22, 2012

The hubbub-based parser will eagerly tell the ImageCacheTask to prefetch images for any tags of the form <img src="...">. That shouldn't happen if the element is a descendant of a <noscript> tag, since Servo does not have a noscript option.

@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Sep 22, 2012

Specifically, we need to watch out for cases like https://bugzilla.mozilla.org/show_bug.cgi?id=642908

@jdm jdm added the E-easy label Oct 21, 2014
@jdm
Copy link
Member

@jdm jdm commented Oct 21, 2014

This should be pretty easy to accomplish using the ancestors() iterator on Node.

@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Oct 21, 2014

At the point when the prefetch runs you don't have a Node, right? You just have the parser's tokenization state.

@jdm
Copy link
Member

@jdm jdm commented Oct 21, 2014

No, right now prefetching is controlled by HTMLImageElement::AfterSetAttr.

@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Oct 21, 2014

That's not prefetching, then. That's just loading the image....

@guillaumebort
Copy link
Contributor

@guillaumebort guillaumebort commented Nov 7, 2014

I wanted to give a try to this one, but it seems that it is already not an issue anymore.

The pull request is here #3934

I have added a test cases to document.images, but I'm not totally sure it tests the underlying image cache. Let me know if there is another better way to test that.

(note: I've also manually tested that no Prefetch messages are sent in case of an <img> tag included in <noscript>)

glennw added a commit to glennw/servo that referenced this issue Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.