servo: Merge #15691 - Stylo: add `content: -moz-alt-content` (from servo:moz-alt-content); r=bzbarsky
authorSimon Sapin <simon.sapin@exyr.org>
Fri, 24 Feb 2017 05:00:24 -0800
changeset 373749 5a96f6bcfe5b3a432d8a8a6c1640f62579e9d90f
parent 373748 e2bd855c3e5dc64850b2e31d6902ce64f33abff5
child 373750 fc38f7129d38da56b54a82fd87a97611346322c0
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs15691, 1341642
milestone54.0a1
servo: Merge #15691 - Stylo: add `content: -moz-alt-content` (from servo:moz-alt-content); r=bzbarsky <!-- Please describe your changes on the following line: --> Part of https://bugzilla.mozilla.org/show_bug.cgi?id=1341642 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #_ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: cd803afd1ecce7feccf0ae0193f0b848e458fa9b
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhand/counters.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3115,16 +3115,18 @@ clip-path
                         ContentItem::OpenQuote
                             => self.gecko.mContents[i].mType = eStyleContentType_OpenQuote,
                         ContentItem::CloseQuote
                             => self.gecko.mContents[i].mType = eStyleContentType_CloseQuote,
                         ContentItem::NoOpenQuote
                             => 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(..) |
                         ContentItem::Counters(..)
                             => self.gecko.mContents[i].mType = eStyleContentType_Uninitialized,
                     }
                 }
             }
         }
     }
--- a/servo/components/style/properties/longhand/counters.mako.rs
+++ b/servo/components/style/properties/longhand/counters.mako.rs
@@ -39,16 +39,21 @@
             /// `open-quote`.
             OpenQuote,
             /// `close-quote`.
             CloseQuote,
             /// `no-open-quote`.
             NoOpenQuote,
             /// `no-close-quote`.
             NoCloseQuote,
+
+            % if product == "gecko":
+                /// `-moz-alt-content`
+                MozAltContent,
+            % endif
         }
 
         impl ToCss for ContentItem {
             fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
                 match *self {
                     ContentItem::String(ref s) => {
                         cssparser::serialize_string(&**s, dest)
                     }
@@ -67,16 +72,20 @@
                         try!(dest.write_str(", "));
                         try!(list_style_type.to_css(dest));
                         dest.write_str(")")
                     }
                     ContentItem::OpenQuote => dest.write_str("open-quote"),
                     ContentItem::CloseQuote => dest.write_str("close-quote"),
                     ContentItem::NoOpenQuote => dest.write_str("no-open-quote"),
                     ContentItem::NoCloseQuote => dest.write_str("no-close-quote"),
+
+                    % if product == "gecko":
+                        ContentItem::MozAltContent => dest.write_str("-moz-alt-content"),
+                    % endif
                 }
             }
         }
 
         #[allow(non_camel_case_types)]
         #[derive(Debug, PartialEq, Eq, Clone)]
         #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
         pub enum T {
@@ -154,16 +163,21 @@
                     }));
                 }
                 Ok(Token::Ident(ident)) => {
                     match_ignore_ascii_case! { ident,
                         "open-quote" => content.push(ContentItem::OpenQuote),
                         "close-quote" => content.push(ContentItem::CloseQuote),
                         "no-open-quote" => content.push(ContentItem::NoOpenQuote),
                         "no-close-quote" => content.push(ContentItem::NoCloseQuote),
+
+                        % if product == "gecko":
+                            "-moz-alt-content" => content.push(ContentItem::MozAltContent),
+                        % endif
+
                         _ => return Err(())
                     }
                 }
                 Err(_) => break,
                 _ => return Err(())
             }
         }
         if !content.is_empty() {