New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 817471 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug



Sign in to add a comment

CSSStyleRule cssText does not preserve border radius shorthand

Reported by j...@netrivet.com, Feb 28 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36

Steps to reproduce the problem:
https://codepen.io/j-arens/pen/eVxpGz

What is the expected behavior?
Expected cssText to preserve border radius shorthand

What went wrong?
getting the cssText of an element with a shorthand border radius property does not preserve forward slashes.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 64.0.3282.140  Channel: n/a
OS Version: OS X 10.12.6
Flash Version:
 

Comment 1 by cnardi@chromium.org, Feb 28 2018

Owner: cnardi@chromium.org
Status: Assigned (was: Unconfirmed)
Confirmed, looking into this.
Cc: nainar@chromium.org alancutter@chromium.org
Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Windows
+nainar@, alancutter@ for some advice here. It looks like the incorrect serialization comes from StylePropertySerializer but ComputedStyleUtils::ValueForBorderRadiusShorthand() (called by BorderRadius::CSSValueFromComputedStyleInternal()) creates a CSSValueList which, if serialized, should generate the correct output.

It doesn't look like there's any interaction between StylePropertySerializer and calling CSSValueFromComputedStyle methods, but I haven't touched this part of the code yet. Is there any way we can re-use that value from CSSValueFromComputedStyleInternal() so that we don't duplicate the same code in StylePropertySerializer?
That's some pretty complicated logic in ValueForBorderRadiusShorthand(). It would be best to avoid duplicating it.
What you could do is create a wrapper class that abstracts the ComputedStyle/StylePropertySet data representation and rewrite ValueForBorderRadiusShorthand() to use the wrapper and perhaps rename it to SimplifiedBorderRadiusCSSValue().
WebKit also fails to preserve forward slash in border-radius inline style.
https://bugs.webkit.org/show_bug.cgi?id=183994

Cc: cnardi@chromium.org
Owner: ----
Status: Available (was: Assigned)
 Issue 917522  has been merged into this issue.

Sign in to add a comment