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.
Fixed invalid selector handling AngleSharp#98
- Loading branch information
1 parent
60b4a59
commit 8b8482a
Showing
6 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace AngleSharp.Css.Tests.Parsing | ||
{ | ||
using AngleSharp.Css.Dom; | ||
using AngleSharp.Css.Parser; | ||
using AngleSharp.Html.Parser; | ||
using NUnit.Framework; | ||
using System.Linq; | ||
|
||
[TestFixture] | ||
public class PseudoElements | ||
{ | ||
[Test] | ||
public void VendorPrefixedPseudoElementShouldBeAvailable_Issue98() | ||
{ | ||
var html = @"<html><head><style> | ||
p::-webkit-scrollbar-thumb { | ||
background: #888 | ||
} | ||
</style></head><body><p>test</p></body></html>"; | ||
var parser = new HtmlParser(new HtmlParserOptions(), BrowsingContext.New(new Configuration().WithCss(new CssParserOptions | ||
{ | ||
IsIncludingUnknownDeclarations = true, | ||
IsIncludingUnknownRules = true, | ||
IsToleratingInvalidSelectors = true, | ||
}))); | ||
var document = parser.ParseDocument(html); | ||
var stylesheet = document.StyleSheets.OfType<ICssStyleSheet>().First(); | ||
var rule = stylesheet.Rules.OfType<ICssStyleRule>().First(); | ||
var selectorText = rule.SelectorText; | ||
Assert.AreEqual("p::-webkit-scrollbar-thumb", selectorText); | ||
} | ||
} | ||
} |
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
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