mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Fix some rebase messups from the rule tree refactoring.
This code was all long gone already from Gecko :)
This commit is contained in:
parent
83ea321096
commit
b80d79863c
2 changed files with 1 additions and 219 deletions
|
@ -2,8 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// FIXME: Make that forbid once the two unsafe gecko-specific methods are removed.
|
||||
#![deny(unsafe_code)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
use crate::properties::PropertyDeclarationBlock;
|
||||
use crate::shared_lock::{Locked, SharedRwLockReadGuard};
|
||||
|
@ -53,31 +52,6 @@ impl StyleSource {
|
|||
let _ = write!(writer, " -> {:?}", self.read(guard).declarations());
|
||||
}
|
||||
|
||||
// This is totally unsafe, should be removed when we figure out the cause of
|
||||
// bug 1607553.
|
||||
#[allow(unsafe_code)]
|
||||
#[cfg(feature = "gecko")]
|
||||
pub(super) unsafe fn dump_unchecked<W: Write>(&self, writer: &mut W) {
|
||||
if let Some(ref rule) = self.0.as_first() {
|
||||
let rule = rule.read_unchecked();
|
||||
let _ = write!(writer, "{:?}", rule.selectors);
|
||||
}
|
||||
let _ = write!(writer, " -> {:?}", self.read_unchecked().declarations());
|
||||
}
|
||||
|
||||
// This is totally unsafe, should be removed when we figure out the cause of
|
||||
// bug 1607553.
|
||||
#[inline]
|
||||
#[allow(unsafe_code)]
|
||||
#[cfg(feature = "gecko")]
|
||||
pub(super) unsafe fn read_unchecked(&self) -> &PropertyDeclarationBlock {
|
||||
let block: &Locked<PropertyDeclarationBlock> = match self.0.borrow() {
|
||||
ArcUnionBorrow::First(ref rule) => &rule.get().read_unchecked().block,
|
||||
ArcUnionBorrow::Second(ref block) => block.get(),
|
||||
};
|
||||
block.read_unchecked()
|
||||
}
|
||||
|
||||
/// Read the style source guard, and obtain thus read access to the
|
||||
/// underlying property declaration block.
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue