Skip to content

CSS shorthand property **text-decoration** is not properly expanded #35

Closed
@atlastodor

Description

@atlastodor

Bug Report

Prerequisites

  • [ Yes ] Can you reproduce the problem in a [MWE]
  • [ Yes 0.12.1 ] Are you running the latest version of AngleSharp?
  • [ Yes ] Did you check the FAQs to see if that helps you?
  • [ Yes ] Are you reporting to the correct repository? (if its an issue with the core library, please report to AngleSharp directly)
  • [ Yes ] Did you perform a search in the issues?

For more information, see the CONTRIBUTING guide.

Description

CSS shorthand property text-decoration is not properly expanded.

Steps to Reproduce

  1. Configure AngleSharp WithCss.
  2. Using a new BrowsingContext, parse this HTML:
<!DOCTYPE html>
<html>
<head><title></title></head>
<body style="text-decoration: underline dotted;"></body>
</html>
  1. Get the style for the Body element.
    var styleDeclaration = document.Body.ComputeCurrentStyle();

Expected behavior:
As per CSS text-decoration

<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'>.

"text-decoration-style: dotted"
"text-decoration-line: underline"

Actual behavior:

"text-decoration-style: underline"
"text-decoration-line: dotted"

Environment details:
Windows 10, .Net 4.7

Possible Solution

Swap so text-decoration-style is expanded into text-decoration-line and vice-versa.

PS: When you are changing CSS properties behavior, could you please override the ToString() method to return the CssText. This will make working in the debugger much easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions