Open
Bug 137687
Opened 23 years ago
Updated 5 months ago
Computed CSSDeclarations need to implement GetCssText
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Core
DOM: CSS Object Model
Tracking
()
NEW
Webcompat Priority | P3 |
People
(Reporter: bzbarsky, Unassigned)
References
Details
(Whiteboard: [webcompat])
Attachments
(1 file)
1.44 KB,
patch
|
Details | Diff | Splinter Review |
nsComputedDOMStyle does not implement GetCssText....
![]() |
Reporter | |
Updated•23 years ago
|
Priority: -- → P5
Target Milestone: --- → Future
Comment 1•22 years ago
|
||
This was originally part of my fix to spin out the queryable properties into
the static map, but I left it out of that patch and I forgot about it until
now.
![]() |
Reporter | |
Comment 2•22 years ago
|
||
So... we need to canonicalize and do shorthands and the like if we do this,
imo.... (though we could land that as a start, I suppose).
![]() |
Reporter | |
Comment 3•21 years ago
|
||
No plans to work on this any time in the foreseeable future, so to default owner.
Assignee: bz-vacation → general
![]() |
Reporter | |
Updated•21 years ago
|
Priority: P5 → --
Target Milestone: Future → ---
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: ian → general
QA Contact: general → style-system
Comment 5•12 years ago
|
||
Updating title to make this bug slightly easier to find.
Summary: Computed CSSDeclarations need to implement GetCssText → Computed CSSDeclarations need to implement GetCssText / cssText
Comment 6•11 years ago
|
||
A fix for this would be very useful. In the meantime, here's how to work around it: https://gist.github.com/johnkpaul/1754808
Comment 7•11 years ago
|
||
The attached gist doesn't work, but this does:
function getComputedStyleCssText(element) {
var style = window.getComputedStyle(element), cssText;
if (style.cssText != "") {
return style.cssText;
}
cssText = "";
for (var i = 0; i < style.length; i++) {
cssText += style[i] + ": " + style.getPropertyValue(style[i]) + "; ";
}
return cssText;
}
![]() |
Reporter | |
Comment 8•8 years ago
|
||
This looks like it's causing web compat issues. See https://webcompat.com/issues/3822
Xidorn, do you want to try resurrecting the patch here? Looks to me like Blink doesn't do any interesting shorthand stuff, so maybe we can just get away with the simple and silly implementation...
Flags: needinfo?(xidorn+moz)
See Also: → https://webcompat.com/issues/3822
![]() |
Reporter | |
Updated•8 years ago
|
Summary: Computed CSSDeclarations need to implement GetCssText / cssText → Computed CSSDeclarations need to implement GetCssText
Comment 10•8 years ago
|
||
This is crazy... Why do they need that? Couldn't we contact google and ask them not to do that?
I can work on the patch... but how should the spec say? Edge returns empty string for computed style's cssText as well. Could we just make the spec do this and ask Blink to change their behavior?
Flags: needinfo?(xidorn+moz)
![]() |
Reporter | |
Comment 11•8 years ago
|
||
> Why do they need that?
They're trying to copy the computed style of one node to the inline style of another afaict.
> Couldn't we contact google and ask them not to do that?
Karl has. He asked them to do the getPropertyValue/setPropertyvalue thing.
> but how should the spec say?
Spec says to do https://drafts.csswg.org/cssom/#serialize-a-css-declaration-block but that's ... complicated and annoying.
> Could we just make the spec do this and ask Blink to change their behavior?
And Safari (they match Blink; presumably this is still WebKit code)? We could try, but in the meantime Google drive is slow. :(
Comment 12•8 years ago
|
||
Files a spec issue for this: https://github.com/w3c/csswg-drafts/issues/1033
> And Safari (they match Blink; presumably this is still WebKit code)? We
> could try, but in the meantime Google drive is slow. :(
The quickest way should be asking Google drive to fix I think....
![]() |
||
Comment 13•8 years ago
|
||
>(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #12)
> The quickest way should be asking Google drive to fix I think....
This has been done today. This doesn't guarantee it will be. Some issues are sometimes never fixed, sometimes fixed one year later or more (because of a redesign). Let's give them one week.
Updated•7 years ago
|
Priority: -- → P3
Comment 14•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Webcompat Priority: --- → ?
Comment 15•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•5 years ago
|
Webcompat Priority: ? → revisit
Updated•2 years ago
|
Webcompat Priority: revisit → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•