Closed
Bug 474655
Opened 16 years ago
Closed 7 years ago
warn when nsIDOMCSSStyleDeclaration::GetPropertyCSSValue is called
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Keywords: site-compat)
Attachments
(2 files)
8.27 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
59 bytes,
text/x-review-board-request
|
bholley
:
review+
|
Details |
I think we should have a console warning when any of the implemementations of nsIDOMCSSStyleDeclaration::GetPropertyCSSValue are called, since this is an API that we're considering eliminating (I think we're the only implementor, and we implement it only for computed style, at considerable cost in code size).
So, for a start, I think we should add a warning to the error console that a deprecated API is being used, and then see if anybody complains...
Does that seem reasonable?
Assignee | ||
Updated•16 years ago
|
OS: Linux → All
Priority: -- → P3
Hardware: x86 → All
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → dbaron
Target Milestone: --- → mozilla1.9.2a1
Assignee | ||
Comment 1•16 years ago
|
||
I checked that the warning shows up for the computed style and style attribute cases, and that it doesn't in those cases for getPropertyValue.
Attachment #358015 -
Flags: superreview?(bzbarsky)
Attachment #358015 -
Flags: review?(bzbarsky)
Comment 2•16 years ago
|
||
I wonder how we might write a test for this. I know in xpcshell land, we can easily register a JS test component (see do_load_module in tools/test-harness/xpcshell-simple/head.js ), and that console listener components can register themselves with the console service. But getComputedStyle requires a window (nsIDOMViewCSS), and I'm not sure if the style property of elements does.
So it might require a mochitest to test this, and I don't know if mochitests can register new components.
Comment 3•16 years ago
|
||
> I wonder how we might write a test for this.
Mochitest. You don't need a "js component" to register a console listener. Heck, there are existing mochitests that do it that you should be able to crib from.
Comment 4•16 years ago
|
||
Comment on attachment 358015 [details] [diff] [review]
patch
This looks ok. Some people actually use this API to get things like sizes in em, but ideally we'd implement a better CSSOM API they could use before this goes away completely.
Attachment #358015 -
Flags: superreview?(bzbarsky)
Attachment #358015 -
Flags: superreview+
Attachment #358015 -
Flags: review?(bzbarsky)
Attachment #358015 -
Flags: review+
Comment 5•16 years ago
|
||
Does the patch cause lots of warnings on some pages? Perhaps one warning per
document? (Similar to getBoxObjectFor warning)
Assignee | ||
Comment 6•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/eec3076f3bab
Where does the getBoxObjectFor warning store the state that it's given the warning already? In the property table or something?
(My understanding is that we're the only browser implementing this API, so I'm not expecting to see a lot of users in the real world.)
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 7•16 years ago
|
||
boxObjects are also gecko only.
For the boxObject warning there is a flag in nsDocument.
Assignee | ||
Comment 8•16 years ago
|
||
I backed this out because of bug 475311:
http://hg.mozilla.org/mozilla-central/rev/674246a64ed2
http://hg.mozilla.org/mozilla-central/rev/e2a26d16bf06
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla1.9.2a1 → ---
Assignee | ||
Updated•14 years ago
|
QA Contact: general → style-system
Assignee | ||
Comment 9•7 years ago
|
||
My current merged version of the patch (link stays current) is:
https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/tip/warn-for-get-property-css-value
and today's version is:
https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/b8570a918f8c/warn-for-get-property-css-value
https://searchfox.org/mozilla-central/search?q=getPropertyCSSValue&case=true&path= is uses that we could fix...
Comment 10•7 years ago
|
||
We should probably use a deprecated operation thing for this now that we have them. That will give us telemetry in addition to the deprecation warning.
Comment hidden (mozreview-request) |
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8958798 [details]
Bug 474655: Add a deprecation warning + use counter to GetPropertyCSSValue.
https://reviewboard.mozilla.org/r/227708/#review233570
Attachment #8958798 -
Flags: review?(bobbyholley) → review+
Comment 13•7 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/151e6dc2df8e
Add a deprecation warning + use counter to GetPropertyCSSValue. r=bholley
Comment 14•7 years ago
|
||
bugherder |
Status: REOPENED → RESOLVED
Closed: 16 years ago → 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Comment 15•7 years ago
|
||
Posted the site compatibility note: https://www.fxsitecompat.com/en-CA/docs/2018/cssstyledeclaration-getpropertycssvalue-has-been-deprecated/
Keywords: site-compat
You need to log in
before you can comment on or make changes to this bug.
Description
•