mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -65,6 +65,10 @@ impl Attr {
|
|||
util::swap(&mut self.value, &mut value);
|
||||
value
|
||||
}
|
||||
|
||||
pub fn value_ref<'a>(&'a self) -> &'a str {
|
||||
self.value.as_slice()
|
||||
}
|
||||
}
|
||||
|
||||
impl Attr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue