本文整理汇总了C#中StylesheetParser类的典型用法代码示例。如果您正苦于以下问题:C# StylesheetParser类的具体用法?C# StylesheetParser怎么用?C# StylesheetParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StylesheetParser类属于命名空间,在下文中一共展示了StylesheetParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Zero_Values_Before_Decimals_Are_Parsed
public void Zero_Values_Before_Decimals_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{ background-position: 0 1.1em; }");
Assert.AreEqual(1, style.RuleSets[0].Declarations.Count);
}
示例2: ExCSSFixture
public ExCSSFixture()
{
_parser = new StylesheetParser();
//new StylesheetParser().Parse(".big{color: red;}");
//new StylesheetParser().Parse("@import \"mystyle.css\";");
}
示例3: Empty_Terms_Are_Ignored
public void Empty_Terms_Are_Ignored()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{ font-size: 10px; ; }");
Assert.AreEqual(1, style.RuleSets[0].Declarations.Count);
}
示例4: Terms_With_Vendor_Functions_Are_Parsed
public void Terms_With_Vendor_Functions_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{background-image: -moz-linear-gradient(top,#CCC,#ddd) }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual("-moz-linear-gradient(top, #CCC, #DDD)", expression.Terms[0].ToString());
}
示例5: Terms_With_Size_And_Height_Shorthand_Are_Parsed
public void Terms_With_Size_And_Height_Shorthand_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{font-size: 12px/20px }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual("12px/20px", expression.Terms[0].ToString());
}
示例6: Content_With_Empty_Single_Quote_Strings_Is_Parsed
public void Content_With_Empty_Single_Quote_Strings_Is_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{content: ' ' }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual("' '", expression.Terms[0].ToString());
}
示例7: Terms_With_Functions_Are_Parsed
public void Terms_With_Functions_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{clip: rect(0px,60px,200px,0px) }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(1, expression.Terms.Count);
Assert.AreEqual("rect(0px, 60px, 200px, 0px)", expression.Terms[0].ToString());
}
示例8: azimuth_left_side
public void azimuth_left_side()
{
var termParts = new[]{"left-side"};
var parser = new StylesheetParser();
var style = parser.Parse("*{azimuth: left-side }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("left-side", expression.Terms[0].ToString());
}
示例9: background_attachment_scroll
public void background_attachment_scroll()
{
var termParts = new[]{"scroll"};
var parser = new StylesheetParser();
var style = parser.Parse("*{background-attachment: scroll }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("scroll", expression.Terms[0].ToString());
}
示例10: accelerator_true
public void accelerator_true()
{
var termParts = new[]{"true"};
var parser = new StylesheetParser();
var style = parser.Parse("*{accelerator: true }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("true", expression.Terms[0].ToString());
}
示例11: StylesheetParser
public void background_CCC_transparent_urlimagesimgpng_fixed_repeat_x_repeat_y_no_repeat_top_left_center_right_bottom_1px_2px()
{
var termParts = new[]{"#CCC","transparent","url(images/img.png)","fixed","repeat-x","repeat-y","no-repeat","top","left","center","right","bottom","1px","2px"};
var parser = new StylesheetParser();
var style = parser.Parse("*{background: #CCC transparent url(images/img.png) fixed repeat-x repeat-y no-repeat top left center right bottom 1px 2px }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("#CCC", expression.Terms[0].ToString());
Assert.AreEqual("transparent", expression.Terms[1].ToString());
Assert.AreEqual("url(images/img.png)", expression.Terms[2].ToString());
Assert.AreEqual("fixed", expression.Terms[3].ToString());
Assert.AreEqual("repeat-x", expression.Terms[4].ToString());
Assert.AreEqual("repeat-y", expression.Terms[5].ToString());
Assert.AreEqual("no-repeat", expression.Terms[6].ToString());
Assert.AreEqual("top", expression.Terms[7].ToString());
Assert.AreEqual("left", expression.Terms[8].ToString());
Assert.AreEqual("center", expression.Terms[9].ToString());
Assert.AreEqual("right", expression.Terms[10].ToString());
Assert.AreEqual("bottom", expression.Terms[11].ToString());
Assert.AreEqual("1px", expression.Terms[12].ToString());
Assert.AreEqual("2px", expression.Terms[13].ToString());
}
示例12: border_left_1px_none
public void border_left_1px_none()
{
var termParts = new[]{"1px","none"};
var parser = new StylesheetParser();
var style = parser.Parse("*{border-left: 1px none }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("1px", expression.Terms[0].ToString());
Assert.AreEqual("none", expression.Terms[1].ToString());
}
示例13: z_index__1
public void z_index__1()
{
var termParts = new[]{"-1"};
var parser = new StylesheetParser();
var style = parser.Parse("*{z-index: -1 }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("-1", expression.Terms[0].ToString());
}
示例14: border_bottom_solid
public void border_bottom_solid()
{
var termParts = new[]{"solid"};
var parser = new StylesheetParser();
var style = parser.Parse("*{border-bottom: solid }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("solid", expression.Terms[0].ToString());
}
示例15: text_transform_capitalize
public void text_transform_capitalize()
{
var termParts = new[]{"capitalize"};
var parser = new StylesheetParser();
var style = parser.Parse("*{text-transform: capitalize }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("capitalize", expression.Terms[0].ToString());
}