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

Close #84 #3934

Merged
merged 1 commit into from Nov 11, 2014
Merged

Close #84 #3934

Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Close #84

Actually <img> elements in <noscript> are not prefetched anymore.

Probably because html5ever already parses the <noscript> content as raw
text data if `scripting_enabled` is activated.

See
https://github.com/servo/html5ever/blob/servo/src/tree_builder/rules.rs#
L126

Also, added a test to the images cache.
  • Loading branch information
guillaumebort committed Nov 7, 2014
commit 8e2abb6ffc0521faf001043718110f9baeeb4f40
@@ -60,9 +60,6 @@ impl<'a> PrivateHTMLImageElementHelpers for JSRef<'a, HTMLImageElement> {

// inform the image cache to load this, but don't store a
// handle.
//
// TODO (Issue #84): don't prefetch if we are within a
// <noscript> tag.
image_cache.send(image_cache_task::Prefetch(img_url));
}
}
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<script src="harness.js"></script>
</head>
<body>

<img src="test.png">

<noscript>
<img src="test.jpg">
</noscript>

<script>
var images = document.images;
is(images, document.images);
is(images.length, 1);

var image = document.createElement("img");
image.setAttribute("src", "test.jpg");
document.body.appendChild(image);
is(images.length, 2);

document.body.removeChild(image);
is(images.length, 1);
</script>
</body>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.