mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Don't borrow CharacterData.data from layout.
This should fix the most frequent intermittent wpt failure.
This commit is contained in:
parent
fd70b366ae
commit
16e071168c
2 changed files with 9 additions and 2 deletions
|
@ -15,6 +15,7 @@ use dom::node::{CommentNodeTypeId, Node, NodeTypeId, TextNodeTypeId, ProcessingI
|
|||
use servo_util::str::DOMString;
|
||||
|
||||
use std::cell::{Ref, RefCell};
|
||||
use std::mem;
|
||||
|
||||
#[jstraceable]
|
||||
#[must_root]
|
||||
|
@ -57,6 +58,12 @@ impl CharacterData {
|
|||
pub fn set_data(&self, data: DOMString) {
|
||||
*self.data.borrow_mut() = data;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn data_for_layout<'a>(&'a self) -> &'a str {
|
||||
mem::transmute::<&RefCell<DOMString>, &DOMString>(&self.data).as_slice()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue