mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Remove borrow_data and mutate_data from TNode.
The new restyle architecture doesn't store these things in consistent places, so we need a more abstract API.
This commit is contained in:
parent
ddbc016f51
commit
bfbbef6ecd
9 changed files with 115 additions and 84 deletions
|
@ -260,7 +260,7 @@ pub extern "C" fn Servo_StyleSheet_Release(sheet: RawServoStyleSheetBorrowed) ->
|
|||
pub extern "C" fn Servo_ComputedValues_Get(node: RawGeckoNodeBorrowed)
|
||||
-> ServoComputedValuesStrong {
|
||||
let node = GeckoNode(node);
|
||||
let arc_cv = match node.borrow_data().map_or(None, |data| data.style.clone()) {
|
||||
let arc_cv = match node.get_existing_style() {
|
||||
Some(style) => style,
|
||||
None => {
|
||||
// FIXME(bholley): This case subverts the intended semantics of this
|
||||
|
@ -322,10 +322,7 @@ pub extern "C" fn Servo_ComputedValues_GetForPseudoElement(parent_style: ServoCo
|
|||
match GeckoSelectorImpl::pseudo_element_cascade_type(&pseudo) {
|
||||
PseudoElementCascadeType::Eager => {
|
||||
let node = element.as_node();
|
||||
let maybe_computed = node.borrow_data()
|
||||
.and_then(|data| {
|
||||
data.per_pseudo.get(&pseudo).map(|c| c.clone())
|
||||
});
|
||||
let maybe_computed = node.get_pseudo_style(&pseudo);
|
||||
maybe_computed.map_or_else(parent_or_null, FFIArcHelpers::into_strong)
|
||||
}
|
||||
PseudoElementCascadeType::Lazy => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue