Open Bug 1408300 Opened 7 years ago Updated 2 years ago

make nsComputedDOMStyle use Servo code for property serialization

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- ?

People

(Reporter: heycam, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

There is a lot of serialization code in nsComputedDOMStyle and it would be nice if we could use Servo's code for this.

One complication is that the current code is all written in terms of the old DOM Level 2 Style OM, i.e. each serialization method returns a CSSValue object, in case it needs to be returned from getPropertyCSSValue.
Depends on: 1408301
Priority: -- → P3
It seems to me that nsComputedDOMStyle is pretty much decoupled from other parts of style system. It has its own serialization code from style structs. It may call into nsCSSValue somewhere, but we cannot remove nsCSSValue anyway. So I guess it probably isn't really a blocker for removing the old style system.
Maybe the dependency should be the other way around.  But still, since there is a lot of code in there, I wonder if we will need to recover that space for the Android apk file.
There is lots of code, but that's lots of code in Servo side which we may not be using at the moment as well (assuming linkers correctly strips those ToCss for computed value which we don't call, but that may not be true).
We hope to ship Stylo for Android in Firefox 59, so it would be nice to know whether sharing this code would reduce the Android APK file size.
As an approximation, the total size of all of the nsComputedDOMStyle::DoGetXXX functions is about 86 KiB.
Ah, that was a non-opt build.  In an opt build, it's around 53 KiB.
Blocks: 1457178
Assignee: nobody → emilio
Here's the current state of it. Some of the failures look bogus tests that rely on calc() order not as in the spec. There are a few special-cases like flex min-* which I haven't accounted for.

Then there's URLs and colors, which we need to really resolve, which is kind of annoying...

https://treeherder.mozilla.org/#/jobs?repo=try&revision=a2e860a31f7f209da06ade2be0bde61176bb5ff0
Depends on: 1461288
Depends on: 1461296
All the dependencies are fixed, is there anything left to do here?
Flags: needinfo?(emilio)
Yes, most of the work actually :).

I have a patch locally, but I'm not sure what's the best way to land it, so I punted on it for a bit, probably should spend some time to enable it property by property and fixing some tests while at it.
Flags: needinfo?(emilio)
Depends on: 1467536
Depends on: 1471114
Depends on: 1472443
Depends on: 1472497
Depends on: 1472551
Depends on: 1473225
Depends on: 1507305
Depends on: 1530247
Depends on: 1530826
Depends on: 1542178
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.