mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Fix debug assertion failure https://bugzilla.mozilla.org/show_bug.cgi?id=1345483
This commit is contained in:
parent
83c820e5b1
commit
765be69780
4 changed files with 10 additions and 9 deletions
|
@ -288,10 +288,15 @@ impl PropertyDeclarationBlock {
|
|||
}
|
||||
let important_count = &mut self.important_count;
|
||||
let mut removed_at_least_one = false;
|
||||
let longhands = &mut self.longhands;
|
||||
self.declarations.retain(|&(ref declaration, importance)| {
|
||||
let remove = declaration.id().is_or_is_longhand_of(property);
|
||||
let id = declaration.id();
|
||||
let remove = id.is_or_is_longhand_of(property);
|
||||
if remove {
|
||||
removed_at_least_one = true;
|
||||
if let PropertyDeclarationId::Longhand(id) = id {
|
||||
longhands.remove(id)
|
||||
}
|
||||
if importance.important() {
|
||||
*important_count -= 1
|
||||
}
|
||||
|
@ -299,9 +304,8 @@ impl PropertyDeclarationBlock {
|
|||
!remove
|
||||
});
|
||||
|
||||
if let PropertyId::Longhand(id) = *property {
|
||||
if let PropertyId::Longhand(_) = *property {
|
||||
debug_assert!(removed_at_least_one);
|
||||
self.longhands.remove(id);
|
||||
}
|
||||
removed_at_least_one
|
||||
}
|
||||
|
|
|
@ -20620,7 +20620,7 @@
|
|||
"support"
|
||||
],
|
||||
"css/bug_1345483.html": [
|
||||
"d5e1649c88102f27da5fe1ac16715cfee7f70f84",
|
||||
"41b55af9d5c95910b1af74c0fbffb24e20bbe869",
|
||||
"testharness"
|
||||
],
|
||||
"css/button_css_width.html": [
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[bug_1345483.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
|
@ -8,8 +8,8 @@ test(function() {
|
|||
var style = document.documentElement.style;
|
||||
style.marginTop = "0";
|
||||
assert_equals(style.marginTop, "0px");
|
||||
style.margin = null; // This fails to unset a bit in a LonghandIdSet
|
||||
style.margin = null; // This used to fail to unset a bit in a LonghandIdSet
|
||||
assert_equals(style.marginTop, "");
|
||||
style.marginTop = null; // This finds the bit and expect to find a corresponding declarations.
|
||||
style.marginTop = null; // This would find the bit and expect to find a corresponding declarations.
|
||||
}, "regression for bug 1345483")
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue