Skip to content

background "<bg-position> / <bg-size>" syntax unsupported #165

Open
@mganss

Description

@mganss

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version of AngleSharp.Css?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Xml for Xml support)
  • Did you perform a search in the issues?

Description

The syntax for background specifying both position and size separated by a slash is unsupported. #124 seems to be related.

This was initiallly reported as mganss/HtmlSanitizer#536

Steps to Reproduce

var html = @"<div style=""background: center / cover;""></div>";
var conf = Configuration.Default.WithCss(new CssParserOptions
{
    IsIncludingUnknownDeclarations = true,
    IsIncludingUnknownRules = true,
    IsToleratingInvalidSelectors = true,
});
var parser = new HtmlParser(new HtmlParserOptions { IsScripting = true }, BrowsingContext.New(conf));
var dom = parser.ParseDocument(html);
var elem = dom.QuerySelector("div");
var style = elem.GetStyle();
var styleCount = style.Count(); // -> 0

Expected Behavior

The number of styles is nonzero.

Actual Behavior

The number of styles is zero.

Possible Solution / Known Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions