mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
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:
parent
539cf58f73
commit
c443bcbfff
9 changed files with 50 additions and 34 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue