Implement parsing of all gradients

This commit is contained in:
Nazım Can Altınova 2016-10-05 23:20:54 +03:00
parent 522734de22
commit 26c98edd68
8 changed files with 962 additions and 393 deletions

View file

@ -173,8 +173,10 @@
use parser::{ParserContext, ParserContextExtraData};
use properties::{CSSWideKeyword, DeclaredValue, Shorthand};
% endif
#[allow(unused_imports)]
use cascade_info::CascadeInfo;
use error_reporting::ParseErrorReporter;
use parser::Parse;
use properties::longhands;
use properties::property_bit_field::PropertyBitField;
use properties::{ComputedValues, PropertyDeclaration};
@ -565,6 +567,8 @@
<%self:shorthand name="${name}" sub_properties="${
' '.join(sub_property_pattern % side
for side in ['top', 'right', 'bottom', 'left'])}">
#[allow(unused_imports)]
use parser::Parse;
use super::parse_four_sides;
use values::specified;

View file

@ -15,6 +15,7 @@ ${helpers.predefined_type("opacity",
<%helpers:vector_longhand name="box-shadow" allow_empty="True" animatable="True">
use cssparser::{self, ToCss};
use std::fmt;
use parser::Parse;
use values::LocalToCss;
use values::HasViewportPercentage;
@ -355,6 +356,7 @@ ${helpers.predefined_type("opacity",
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
use app_units::Au;
use parser::Parse;
use std::ascii::AsciiExt;
use values::specified::Length;
@ -1199,6 +1201,7 @@ pub struct OriginParseResult {
}
pub fn parse_origin(_: &ParserContext, input: &mut Parser) -> Result<OriginParseResult,()> {
use parser::Parse;
use values::specified::{LengthOrPercentage, Percentage};
let (mut horizontal, mut vertical, mut depth) = (None, None, None);
loop {