mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Don't EnsureUniqueInner from the cssRules getter
Instead, fix up the various content data structures when the stylesheet is mutated. This makes reading a stylesheet not disable style sharing. Differential Revision: https://phabricator.services.mozilla.com/D115203
This commit is contained in:
parent
c0a2b99c4f
commit
8f4d782952
2 changed files with 15 additions and 2 deletions
|
@ -56,10 +56,17 @@ impl GeckoStyleSheet {
|
|||
/// already holds a strong reference.
|
||||
#[inline]
|
||||
pub unsafe fn from_addrefed(s: *const DomStyleSheet) -> Self {
|
||||
debug_assert!(!s.is_null());
|
||||
assert!(!s.is_null());
|
||||
GeckoStyleSheet(s)
|
||||
}
|
||||
|
||||
/// HACK(emilio): This is so that we can avoid crashing release due to
|
||||
/// bug 1719963 and can hopefully get a useful report from fuzzers.
|
||||
#[inline]
|
||||
pub fn hack_is_null(&self) -> bool {
|
||||
self.0.is_null()
|
||||
}
|
||||
|
||||
/// Get the raw `StyleSheet` that we're wrapping.
|
||||
pub fn raw(&self) -> &DomStyleSheet {
|
||||
unsafe { &*self.0 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue