Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-webkit-border-radius isn't alias in WebKit #133

Open
gsnedders opened this issue Oct 10, 2020 · 4 comments
Open

-webkit-border-radius isn't alias in WebKit #133

gsnedders opened this issue Oct 10, 2020 · 4 comments

Comments

@gsnedders
Copy link
Contributor

Differs from border-radius only in the interpretation of a value consisting of two lengths: '-webkit-border-radius: l1 l2;' is equivalent to 'border-radius: l1 / l2;'.

This implies one, three, and four length values are identical? Needs investigation, though.

@Loirooriol
Copy link

It's not a pure alias in Blink either:

var {style} = document.createElement("div");
style.cssText = "-webkit-border-radius: 1px 2px";
style.cssText; // 'border-radius: 1px / 2px;'

This implies one, three, and four length values are identical?

Yes, the grammar of -webkit-border-radius is identical to border-radius except when exactly two space-separated values are provided. See parser code for Blink and WebKit.

BTW, this implies that serializing -webkit-border-radius for border-radius: 1px 2px should not be 1px 2px in Blink/WebKit. Most reasonable candidates are 1px 2px 1px, 1px 2px 1px 2px and 1px 2px / 1px 2px, probably it should be the 1st one which is the shortest one. But Blink uses the wrong 1px 2px, and WebKit never serializes -webkit-border-radius.

@karlcow
Copy link
Member

karlcow commented Nov 28, 2022

So results for this code (yes with -webkit- prefix):

var {style} = document.createElement("div");
style.cssText = "-webkit-border-radius: 1px 2px";
style.cssText;
  • WebKit: border-radius: 1px 2px;
  • Gecko: border-radius: 1px 2px;
  • Blink: border-radius: 1px / 2px;

@Loirooriol
Copy link

The serialization for border-radius was completely broken in WebKit, unrelated to -webkit-border-radius.
I just fixed it, now it produces 1px / 2px.
Gecko says 1px 2px since it treats -webkit-border-alias as a pure alias.

@karlcow
Copy link
Member

karlcow commented Nov 28, 2022

To link dots in this discussion (paper trail and context)
WebKit/WebKit@fd9594c
WebKit/WebKit#6820
https://bugs.webkit.org/show_bug.cgi?id=183994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants