mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Use Cell/RefCell for interior mutability of Attr, AttrList, Blob,
BrowserContext, ClientRect, and ClientRectList.
This commit is contained in:
parent
5ae7c4cbb1
commit
46ead90515
3 changed files with 11 additions and 8 deletions
|
@ -39,11 +39,11 @@ pub trait AttrListMethods {
|
|||
|
||||
impl<'a> AttrListMethods for JSRef<'a, AttrList> {
|
||||
fn Length(&self) -> u32 {
|
||||
self.owner.root().attrs.len() as u32
|
||||
self.owner.root().attrs.borrow().len() as u32
|
||||
}
|
||||
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Attr>> {
|
||||
self.owner.root().attrs.as_slice().get(index as uint).map(|x| Temporary::new(x.clone()))
|
||||
self.owner.root().attrs.borrow().as_slice().get(index as uint).map(|x| Temporary::new(x.clone()))
|
||||
}
|
||||
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Attr>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue