forked from AngleSharp/AngleSharp.Css
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AngleSharp#92 from jogibear9988/fix90
add content visibility property - fixes AngleSharp#90
- Loading branch information
Showing
7 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/AngleSharp.Css.Tests/Declarations/CssContentVisibilityProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace AngleSharp.Css.Tests.Declarations | ||
{ | ||
using NUnit.Framework; | ||
using static CssConstructionFunctions; | ||
|
||
[TestFixture] | ||
public class CssContentVisibilityPropertyTests | ||
{ | ||
[Test] | ||
public void CssContentVisibilityIsHidden() | ||
{ | ||
var source = "a{content-visibility:hidden}"; | ||
var parsed = ParseStyle(source); | ||
Assert.AreEqual("content-visibility: hidden", parsed.Style.CssText); | ||
} | ||
|
||
[Test] | ||
public void CssContentVisibilityIsUnkown() | ||
{ | ||
var source = "a{content-visibility:aa}"; | ||
var parsed = ParseStyle(source); | ||
Assert.AreEqual("", parsed.Style.CssText); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/AngleSharp.Css/Declarations/ContentVisibilityDeclaration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace AngleSharp.Css.Declarations | ||
{ | ||
using AngleSharp.Css.Dom; | ||
using System; | ||
using static ValueConverters; | ||
|
||
static class ContentVisibilityDeclaration | ||
{ | ||
public static String Name = PropertyNames.ContentVisibility; | ||
|
||
public static IValueConverter Converter = VisibilityConverter; | ||
|
||
public static ICssValue InitialValue = InitialValues.ContentVisibilityDecl; | ||
|
||
public static PropertyFlags Flags = PropertyFlags.None; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters