WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
26541
CSS property value serialization order is out of whack
https://bugs.webkit.org/show_bug.cgi?id=26541
Summary
CSS property value serialization order is out of whack
Dimitri Glazkov (Google)
Reported
2009-06-19 09:00:27 PDT
It appears that color is not in the right order (at the end, instead of in front) when reading node.style.background. Haven't checked other attributes to see if this applies to other things. It looks like CSSOM draft suggests that we follow the same order in which the components are listed in CSS spec. The bug originated here:
http://crbug.com/8658
Attachments
Test case (almost layout test).
(1.07 KB, text/html)
2009-06-19 09:01 PDT
,
Dimitri Glazkov (Google)
no flags
Details
Simple fix (which causes test regression)
(1.06 KB, patch)
2009-07-07 23:01 PDT
,
Yuta Kitamura
no flags
Details
Formatted Diff
Diff
A Fix
(3.83 KB, patch)
2009-08-24 10:27 PDT
,
Yaar Schnitman
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Dimitri Glazkov (Google)
Comment 1
2009-06-19 09:01:06 PDT
Created
attachment 31545
[details]
Test case (almost layout test).
Yuta Kitamura
Comment 2
2009-07-07 23:01:31 PDT
Created
attachment 32429
[details]
Simple fix (which causes test regression) I tried to fix this bug, but I'm facing some difficulties on it. I've got a simple fix (attached) but this causes a test regression that is difficult to handle. LayoutTests/fast/dom/background-shorthand-csstext.html fails, becuase div1's background property value is serialized to "repeat-x, white repeat-y". Apparently this should be "white repeat-x, repeat-y". However, WebKit CSS parser does NOT accept "background: white repeat-x, repeat-y;" as a valid style sheet declaration, so we can't do this. For now, I can't find any resolution that satisfies both CSSOM spec and WebKit parser. It seems too difficult for me to hack the CSS parser (at least for now). By the way, according to CSS2, the value "repeat-x, repeat-y" for background-repeat property is invalid (you can use "repeat" for this purpose). I assume that this is a WebKit extension, but I'm not sure it really is.
Dimitri Glazkov (Google)
Comment 3
2009-07-08 10:15:27 PDT
Perhaps you could bring up this issue on #webkit and see if there are ideas that come out of that?
Yaar Schnitman
Comment 4
2009-08-24 10:27:08 PDT
Created
attachment 38486
[details]
A Fix Yuta's fix is correct and the layout test is wrong. WebKit implements CSS3's layered backgrounds, as described here:
http://www.w3.org/TR/2008/WD-css3-background-20080910/#layering
With layers, repeat-x, repeat-y isn't equivalent to repeat. Rather, it means layer 1 should repeat-x and layer 2 should repeat-y. Also, background-image is by default applied to the last layer. Therefore, the style "background-color:white; background-repeat: repeat-x,repeat-y" should inded serialize into: "repeat-x, white repeat-y". The change list includes Yuta's fix as well as the changes to the layout test that broke. p.s. This is my first submission to WebKit. I hope I adhered to all guidelines.
Eric Seidel (no email)
Comment 5
2009-08-24 13:38:54 PDT
In general this looks fine. Could you please point me to the line of the spec where this is required? Ideally your ChangeLog would also include a reference to said line.
Eric Seidel (no email)
Comment 6
2009-08-25 10:47:02 PDT
Comment on
attachment 38486
[details]
A Fix I reviewed another conflicting change to this one yesterday. I believe also from you. Need a spec reference still. r- because this won't apply anymore.
Yaar Schnitman
Comment 7
2009-08-26 11:28:34 PDT
See:
http://dev.w3.org/csswg/cssom/
Quote: 4.1. Parsing and Serializing CSS Constructs ... 4.1.1. CSS Value Rules ... 8. Where multiple values may appear in any order without changing the meaning of the value (typically represented by a double bar || in the value syntax), user agents are to use the canonical order as given in the syntax (e.g. <border-width> <border-style> <color> for the border short-hand property).
Yuta Kitamura
Comment 8
2009-09-01 02:24:24 PDT
Thanks for your follow up, Yaar. I didn't know about layers. I think the patch should be fine if the reference to the CSSOM spec is added. Could you kindly revise the patch? I can do it for you if you don't have enough time. Thanks,
Yaar Schnitman
Comment 9
2009-09-01 09:52:46 PDT
Would gladly fix the patch, but where should the reference be placed?
Yuta Kitamura
Comment 10
2009-09-01 19:02:13 PDT
In Changelog. Moreover, adding a layout test would be better.
Yaar Schnitman
Comment 11
2009-09-03 13:54:02 PDT
As patches that fixes this bug as well as 25489 has been attached to 25489. Once 25489 is closed, this bug can be closed as well.
Dave Hyatt
Comment 12
2009-09-03 18:17:34 PDT
Comment on
attachment 38486
[details]
A Fix r=me, totally looks fine.
Adam Barth
Comment 13
2009-09-06 21:54:17 PDT
Comment on
attachment 38486
[details]
A Fix Clearing review flag on obsolete patch
Yaar Schnitman
Comment 14
2009-09-09 10:03:36 PDT
Patch to 25489 should have fixed this one as well.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug