mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #20339 - emilio:atom-from-dead-beef, r=nox
style: Remove unsound Atom From implementations. Fixes #20158 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20339) <!-- Reviewable:end -->
This commit is contained in:
commit
b47224dbcc
7 changed files with 85 additions and 100 deletions
|
@ -413,7 +413,7 @@ impl nsStyleImage {
|
|||
nsStyleImageType::eStyleImageType_Element => {
|
||||
use gecko_string_cache::Atom;
|
||||
let atom = Gecko_GetImageElement(self);
|
||||
Some(GenericImage::Element(Atom::from(atom)))
|
||||
Some(GenericImage::Element(Atom::from_raw(atom)))
|
||||
},
|
||||
_ => panic!("Unexpected image type")
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ impl Device {
|
|||
context.mMedium
|
||||
};
|
||||
|
||||
MediaType(CustomIdent(Atom::from(medium_to_use)))
|
||||
MediaType(CustomIdent(unsafe { Atom::from_raw(medium_to_use) }))
|
||||
}
|
||||
|
||||
/// Returns the current viewport size in app units.
|
||||
|
@ -262,7 +262,7 @@ impl ToCss for Expression {
|
|||
}
|
||||
|
||||
// NB: CssStringWriter not needed, feature names are under control.
|
||||
write!(dest, "{}", Atom::from(unsafe { *self.feature.mName }))?;
|
||||
write!(dest, "{}", unsafe { Atom::from_static(*self.feature.mName) })?;
|
||||
|
||||
if let Some(ref val) = self.value {
|
||||
dest.write_str(": ")?;
|
||||
|
@ -394,9 +394,9 @@ impl MediaExpressionValue {
|
|||
}
|
||||
nsMediaFeature_ValueType::eIdent => {
|
||||
debug_assert_eq!(css_value.mUnit, nsCSSUnit::eCSSUnit_AtomIdent);
|
||||
Some(MediaExpressionValue::Ident(Atom::from(unsafe {
|
||||
*css_value.mValue.mAtom.as_ref()
|
||||
})))
|
||||
Some(MediaExpressionValue::Ident(unsafe {
|
||||
Atom::from_raw(*css_value.mValue.mAtom.as_ref())
|
||||
}))
|
||||
}
|
||||
nsMediaFeature_ValueType::eIntRatio => {
|
||||
let array = unsafe { css_value.array_unchecked() };
|
||||
|
|
|
@ -507,7 +507,7 @@ impl CounterStyleOrNone {
|
|||
|
||||
let name = unsafe { bindings::Gecko_CounterStyle_GetName(gecko_value) };
|
||||
if !name.is_null() {
|
||||
let name = Atom::from(name);
|
||||
let name = unsafe { Atom::from_raw(name) };
|
||||
if name == atom!("none") {
|
||||
Either::First(CounterStyleOrNone::None)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue