Auto merge of #19956 - servo:derive-all-the-things, r=emilio

Generate some PropertyDeclaration methods by hand 🐉🐲

We rely on https://github.com/rust-lang/rfcs/pull/2195 to make some enums share the same discriminants by definition.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1428285.

<!-- 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/19956)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-02-06 08:12:33 -05:00 committed by GitHub
commit 9faf0cdce5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 347 additions and 156 deletions

View file

@ -18,9 +18,9 @@ use std::sync::atomic::AtomicBool;
use style::context::QuirksMode;
use style::error_reporting::{ParseErrorReporter, ContextualParseError};
use style::media_queries::MediaList;
use style::properties::Importance;
use style::properties::{CSSWideKeyword, DeclaredValueOwned, PropertyDeclaration, PropertyDeclarationBlock};
use style::properties::DeclarationSource;
use style::properties::{CSSWideKeyword, CustomDeclaration, DeclarationSource};
use style::properties::{DeclaredValueOwned, Importance};
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
use style::properties::longhands::{self, animation_timing_function};
use style::shared_lock::SharedRwLock;
use style::stylesheets::{Origin, Namespaces};
@ -108,11 +108,17 @@ fn test_parse_stylesheet() {
), (0 << 20) + (1 << 10) + (1 << 0))
)),
block: Arc::new(stylesheet.shared_lock.wrap(block_from(vec![
(PropertyDeclaration::Display(longhands::display::SpecifiedValue::None),
Importance::Important),
(PropertyDeclaration::Custom(Atom::from("a"),
DeclaredValueOwned::CSSWideKeyword(CSSWideKeyword::Inherit)),
Importance::Important),
(
PropertyDeclaration::Display(longhands::display::SpecifiedValue::None),
Importance::Important,
),
(
PropertyDeclaration::Custom(CustomDeclaration {
name: Atom::from("a"),
value: DeclaredValueOwned::CSSWideKeyword(CSSWideKeyword::Inherit),
}),
Importance::Important,
),
]))),
source_location: SourceLocation {
line: 3,