aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/gecko/values.rs4
-rw-r--r--components/style/gecko_string_cache/mod.rs4
-rw-r--r--components/style/properties/gecko.mako.rs10
-rw-r--r--components/style/stylesheets/document_rule.rs4
4 files changed, 10 insertions, 12 deletions
diff --git a/components/style/gecko/values.rs b/components/style/gecko/values.rs
index ac9a37d4395..09a796c5980 100644
--- a/components/style/gecko/values.rs
+++ b/components/style/gecko/values.rs
@@ -14,7 +14,7 @@ use gecko_bindings::structs::{CounterStylePtr, nsStyleCoord};
use gecko_bindings::structs::{StyleGridTrackBreadth, StyleShapeRadius};
use gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
use media_queries::Device;
-use nsstring::{nsACString, nsCString};
+use nsstring::{nsACString, nsCStr};
use std::cmp::max;
use values::{Auto, Either, ExtremumLength, None_, Normal};
use values::computed::{Angle, Length, LengthOrPercentage, LengthOrPercentageOrAuto};
@@ -465,7 +465,7 @@ impl CounterStyleOrNone {
},
CounterStyleOrNone::Symbols(symbols_type, symbols) => {
let symbols: Vec<_> = symbols.0.iter().map(|symbol| match *symbol {
- Symbol::String(ref s) => nsCString::from(s),
+ Symbol::String(ref s) => nsCStr::from(s),
Symbol::Ident(_) => unreachable!("Should not have identifier in symbols()"),
}).collect();
let symbols: Vec<_> = symbols.iter()
diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs
index 0c75e0c43ca..20121d5f548 100644
--- a/components/style/gecko_string_cache/mod.rs
+++ b/components/style/gecko_string_cache/mod.rs
@@ -11,7 +11,7 @@ use gecko_bindings::bindings::Gecko_Atomize;
use gecko_bindings::bindings::Gecko_Atomize16;
use gecko_bindings::bindings::Gecko_ReleaseAtom;
use gecko_bindings::structs::{nsIAtom, nsIAtom_AtomKind};
-use nsstring::{nsAString, nsString};
+use nsstring::{nsAString, nsStr};
use precomputed_hash::PrecomputedHash;
use std::ascii::AsciiExt;
use std::borrow::{Cow, Borrow};
@@ -346,7 +346,7 @@ impl<'a> From<&'a str> for Atom {
impl<'a> From<&'a [u16]> for Atom {
#[inline]
fn from(slice: &[u16]) -> Atom {
- Atom::from(&*nsString::from(slice))
+ Atom::from(&*nsStr::from(slice))
}
}
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index c8116a975ec..fece19bb10e 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -4086,13 +4086,13 @@ fn static_assert() {
pub fn set_list_style_type(&mut self, v: longhands::list_style_type::computed_value::T, device: &Device) {
use gecko_bindings::bindings::Gecko_SetCounterStyleToString;
- use nsstring::{nsACString, nsCString};
+ use nsstring::{nsACString, nsCStr};
use self::longhands::list_style_type::computed_value::T;
match v {
T::CounterStyle(s) => s.to_gecko_value(&mut self.gecko.mCounterStyle, device),
T::String(s) => unsafe {
Gecko_SetCounterStyleToString(&mut self.gecko.mCounterStyle,
- &nsCString::from(s) as &nsACString)
+ &nsCStr::from(&s) as &nsACString)
}
}
}
@@ -4679,9 +4679,8 @@ fn static_assert() {
<%call expr="impl_coord_copy('word_spacing', 'mWordSpacing')"></%call>
fn clear_text_emphasis_style_if_string(&mut self) {
- use nsstring::nsString;
if self.gecko.mTextEmphasisStyle == structs::NS_STYLE_TEXT_EMPHASIS_STYLE_STRING as u8 {
- self.gecko.mTextEmphasisStyleString.assign(&nsString::new());
+ self.gecko.mTextEmphasisStyleString.truncate();
self.gecko.mTextEmphasisStyle = structs::NS_STYLE_TEXT_EMPHASIS_STYLE_NONE as u8;
}
}
@@ -4797,10 +4796,9 @@ fn static_assert() {
fn clear_overflow_sides_if_string(&mut self) {
use gecko_bindings::structs::nsStyleTextOverflowSide;
- use nsstring::nsString;
fn clear_if_string(side: &mut nsStyleTextOverflowSide) {
if side.mType == structs::NS_STYLE_TEXT_OVERFLOW_STRING as u8 {
- side.mString.assign(&nsString::new());
+ side.mString.truncate();
side.mType = structs::NS_STYLE_TEXT_OVERFLOW_CLIP as u8;
}
}
diff --git a/components/style/stylesheets/document_rule.rs b/components/style/stylesheets/document_rule.rs
index b0e36d52c73..e85d0c31496 100644
--- a/components/style/stylesheets/document_rule.rs
+++ b/components/style/stylesheets/document_rule.rs
@@ -138,7 +138,7 @@ impl UrlMatchingFunction {
pub fn evaluate(&self, device: &Device) -> bool {
use gecko_bindings::bindings::Gecko_DocumentRule_UseForPresentation;
use gecko_bindings::structs::URLMatchingFunction as GeckoUrlMatchingFunction;
- use nsstring::nsCString;
+ use nsstring::nsCStr;
let func = match *self {
UrlMatchingFunction::Url(_) => GeckoUrlMatchingFunction::eURL,
@@ -147,7 +147,7 @@ impl UrlMatchingFunction {
UrlMatchingFunction::RegExp(_) => GeckoUrlMatchingFunction::eRegExp,
};
- let pattern = nsCString::from(match *self {
+ let pattern = nsCStr::from(match *self {
UrlMatchingFunction::Url(ref url) => url.as_str(),
UrlMatchingFunction::UrlPrefix(ref pat) |
UrlMatchingFunction::Domain(ref pat) |