Skip to content

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

Closed
@mganss

Description

@mganss
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions