Change get_attr() to get_attr_val_for_layout().

The old code was used by both layout and script, but was erroneously
borrowing for the layout case (which causes parallelism
problems). script now uses only `value_ref()` or `get_attribute()`, and
layout now has its own unsafe version that dances around the borrows of
`@mut Attr`.
This commit is contained in:
Jack Moffitt 2014-01-22 17:02:21 -07:00
parent 539cf58f73
commit c443bcbfff
9 changed files with 50 additions and 34 deletions

View file

@ -15,7 +15,6 @@ use layout_interface::{ContentBoxQuery, ContentBoxResponse};
use servo_net::image_cache_task;
use servo_net::image_cache_task::ImageCacheTask;
use servo_util::url::make_url;
use style::TElement;
pub struct HTMLImageElement {
htmlelement: HTMLElement,
@ -41,7 +40,7 @@ impl HTMLImageElement {
/// prefetching the image. This method must be called after `src` is changed.
pub fn update_image(&mut self, image_cache: ImageCacheTask, url: Option<Url>) {
let elem = &mut self.htmlelement.element;
let src_opt = elem.get_attr(Null, "src").map(|x| x.to_str());
let src_opt = elem.get_attribute(Null, "src").map(|x| x.Value());
match src_opt {
None => {}
Some(src) => {