A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AngleSharp/AngleSharp.Css/issues/128 below:

Loading content from a string truncates decimal percentages values in keyframes. · Issue #128 · AngleSharp/AngleSharp.Css · GitHub

Bug Report Prerequisites

For more information, see the CONTRIBUTING guide.

Description

First of all hello, and thank you very much for your wonderful library :)
I am having an issue with serializing HTML+CSS Content, as described in the title:

If I load an html string into a document (BrowsingContext.New(Configuration.Default.WithCss()), context.OpenAsync...) with a style tag in the head, describing different animations thanks to the @Keyframes rule, using decimal component in percentages (0.14% { ... } for instance), the decimal part of my keyframe percentage is removed as soon as I serialize this document again (document.ToHtml()).

According to CSS Documentation, percentages are numbers (https://www.w3.org/TR/css3-values/#percentages), so I suppose this integer conversion should not happen, am I wrong here ?
So, I looked at several places, the FAQ, documentation and so on, and I couldn't find something to help me, but if I missed it, I apologize in advance :)

Steps to Reproduce
  1. Create an HTML document with style inside the head.
  2. Create a keyframes rule with decimal component in the percentage values {@Keyframes 27.32% { ... } }
  3. Take this HTML as a string
  4. Load this string into an AngleSharp document, creating the context with css.
  5. Serialize this document
  6. Look at the obtained string

Expected behavior:
The serialized string should contain the same rule as the source, with the decimal percentage.

Actual behavior:
The serialized string has the percentage value truncated, removing its decimal component (it becomes {@Keyframes 27% { ... } })

Environment details:

Possible Solution

I don't know, maybe the type used when parsing the value internally should be changed ?

Thank you very much :)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4