Bug 1466963: Fix a typo. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 05 Jun 2018 20:11:04 +0200
changeset 421683 dac3de03713653e515d3e44649dbc874c39e0459
parent 421682 0488c32bbcdf614429dc1fb49b87a5e01d2fb075
child 421684 43cf976e4f548fbdf3b8077aa7e9d134e3d1a813
push id104090
push userecoal95@gmail.com
push dateThu, 07 Jun 2018 09:23:02 +0000
treeherdermozilla-inbound@a1ddb11380aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1466963
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466963: Fix a typo. r=xidorn Nobody looks at the result from parsing, but this is the right thing to return. MozReview-Commit-ID: 9P5VARiPIAk
servo/components/style/properties/declaration_block.rs
--- a/servo/components/style/properties/declaration_block.rs
+++ b/servo/components/style/properties/declaration_block.rs
@@ -487,19 +487,19 @@ impl PropertyDeclarationBlock {
     /// Depending on the value of `source`, this has a different behavior in the
     /// presence of another declaration with the same ID in the declaration
     /// block.
     ///
     ///   * For `DeclarationSource::Parsing`, this will not override a
     ///     declaration with more importance, and will ensure that, if inserted,
     ///     it's inserted at the end of the declaration block.
     ///
-    ///   * For `DeclarationSource::CssOm`, this will override importance and
-    ///     will preserve the original position on the block.
+    ///   * For `DeclarationSource::CssOm`, this will override importance.
     ///
+    /// Returns whether the declaration has changed.
     pub fn push(
         &mut self,
         declaration: PropertyDeclaration,
         importance: Importance,
         source: DeclarationSource,
     ) -> bool {
         let longhand_id = match declaration.id() {
             PropertyDeclarationId::Longhand(id) => Some(id),
@@ -517,17 +517,17 @@ impl PropertyDeclarationBlock {
                     continue;
                 }
 
                 let important = self.declarations_importance[i];
                 // For declarations from parsing, non-important declarations
                 // shouldn't override existing important one.
                 if important && !importance.important() &&
                     matches!(source, DeclarationSource::Parsing) {
-                    return true;
+                    return false;
                 }
 
                 if matches!(source, DeclarationSource::Parsing) {
                     // As a compatibility hack, specially on Android,
                     // don't allow to override a prefixed webkit display
                     // value with an unprefixed version from parsing
                     // code.
                     //