Auto merge of #16947 - nox:moz-alt-content, r=Wafflespeanut

Parse -moz-alt-content as a whole content value (fixes #15726)

<!-- 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/16947)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-22 16:46:30 -05:00 committed by GitHub
commit a03d0b8472
4 changed files with 37 additions and 31 deletions

View file

@ -4237,8 +4237,8 @@ clip-path
}
match v {
T::none |
T::normal => {
T::None |
T::Normal => {
// Ensure destructors run, otherwise we could leak.
if !self.gecko.mContents.is_empty() {
unsafe {
@ -4246,7 +4246,14 @@ clip-path
}
}
},
T::Content(items) => {
T::MozAltContent => {
unsafe {
Gecko_ClearAndResizeStyleContents(&mut self.gecko, 1);
*self.gecko.mContents[0].mContent.mString.as_mut() = ptr::null_mut();
}
self.gecko.mContents[0].mType = eStyleContentType_AltContent;
},
T::Items(items) => {
unsafe {
Gecko_ClearAndResizeStyleContents(&mut self.gecko,
items.len() as u32);
@ -4288,8 +4295,6 @@ clip-path
=> self.gecko.mContents[i].mType = eStyleContentType_NoOpenQuote,
ContentItem::NoCloseQuote
=> self.gecko.mContents[i].mType = eStyleContentType_NoCloseQuote,
ContentItem::MozAltContent
=> self.gecko.mContents[i].mType = eStyleContentType_AltContent,
ContentItem::Counter(name, style) => {
unsafe {
bindings::Gecko_SetContentDataArray(&mut self.gecko.mContents[i],