|
1 | 1 | namespace AngleSharp.Css.Tests.Library
|
2 | 2 | {
|
| 3 | + using AngleSharp.Css.Dom; |
3 | 4 | using AngleSharp.Css.Parser;
|
4 | 5 | using AngleSharp.Css.Values;
|
5 | 6 | using NUnit.Framework;
|
6 | 7 | using System.IO;
|
| 8 | + using static CssConstructionFunctions; |
7 | 9 |
|
8 | 10 | [TestFixture]
|
9 | 11 | public class StringRepresentationTests
|
@@ -41,5 +43,35 @@ public void TransparentColorDoesNotWorkWithHexOutput_Issue96()
|
41 | 43 | Color.UseHex = false;
|
42 | 44 | Assert.AreEqual("rgba(65, 12, 48, 0.04)", text);
|
43 | 45 | }
|
| 46 | + |
| 47 | + [Test] |
| 48 | + public void ShorthandPaddingInheritPropertiesShouldBeIncluded_Issue100() |
| 49 | + { |
| 50 | + var html = @"<style>#x div { padding: inherit }</style>"; |
| 51 | + var dom = ParseDocument(html); |
| 52 | + var styleSheet = dom.StyleSheets[0] as ICssStyleSheet; |
| 53 | + var css = styleSheet.ToCss(); |
| 54 | + Assert.AreEqual("#x div { padding: inherit }", css); |
| 55 | + } |
| 56 | + |
| 57 | + [Test] |
| 58 | + public void ShorthandMarginInheritPropertiesShouldBeIncluded_Issue100() |
| 59 | + { |
| 60 | + var html = @"<style>#x div { margin: inherit }</style>"; |
| 61 | + var dom = ParseDocument(html); |
| 62 | + var styleSheet = dom.StyleSheets[0] as ICssStyleSheet; |
| 63 | + var css = styleSheet.ToCss(); |
| 64 | + Assert.AreEqual("#x div { margin: inherit }", css); |
| 65 | + } |
| 66 | + |
| 67 | + [Test] |
| 68 | + public void ShorthandBorderInheritPropertiesShouldBeIncluded_Issue100() |
| 69 | + { |
| 70 | + var html = @"<style>#x div { border: inherit }</style>"; |
| 71 | + var dom = ParseDocument(html); |
| 72 | + var styleSheet = dom.StyleSheets[0] as ICssStyleSheet; |
| 73 | + var css = styleSheet.ToCss(); |
| 74 | + Assert.AreEqual("#x div { border: inherit }", css); |
| 75 | + } |
44 | 76 | }
|
45 | 77 | }
|
0 commit comments