Skip to content

Vendor specific pseudo elements not in object model after parsing #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mganss opened this issue Jan 4, 2022 · 2 comments
Closed

Vendor specific pseudo elements not in object model after parsing #98

mganss opened this issue Jan 4, 2022 · 2 comments
Labels

Comments

@mganss
Copy link
Contributor

mganss commented Jan 4, 2022

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;
// -> null

rule.Selector is null, too.

@FlorianRappl
Copy link
Contributor

Well, the Selector has to be null or something evaluating to false as this is not a known selector and therefore not "eval-able".

In any case the SelectorText should not be null. I'll have a look.

FlorianRappl added a commit that referenced this issue Jan 6, 2022
@FlorianRappl
Copy link
Contributor

Part of the preview and of 0.16.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants