mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Store pristine element state rather than a set of changes.
This is the strategy we'll need to take for attributes, and so this change puts us in a position to handle attributes and state the same way. This does mean that we stop taking care to track the situations where our state has reverted to the original state, with no net change. I think that's probably of negligible value though.
This commit is contained in:
parent
d89816bb5f
commit
7dba4447f1
6 changed files with 23 additions and 35 deletions
|
@ -1814,14 +1814,13 @@ impl Element {
|
|||
if state.contains(which) == value {
|
||||
return
|
||||
}
|
||||
let node = self.upcast::<Node>();
|
||||
node.owner_doc().element_state_will_change(self);
|
||||
match value {
|
||||
true => state.insert(which),
|
||||
false => state.remove(which),
|
||||
};
|
||||
self.state.set(state);
|
||||
|
||||
let node = self.upcast::<Node>();
|
||||
node.owner_doc().record_element_state_change(self, which);
|
||||
}
|
||||
|
||||
pub fn get_active_state(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue