Closed Bug 499071 Opened 15 years ago Closed 14 years ago

nsIEditorStyleSheets.idl's comments have a tenuous grasp on the concept of truth


(Core :: DOM: Editor, defect)

Not set





(Reporter: philor, Assigned: philor)





(1 file)

The docs for nsIEditorStyleSheets carefully detail which things are sync and async. The problem is that they are only rarely actually correct: addStyleSheet and replaceStyleSheet are always async, despite the claim that replace "can involve async" and that add (which is just replace(nothing) in the impl) is always sync; addOverrideStyleSheet and replaceOverrideStyleSheet are always sync, though the docs say "always" and whatever "assumed to be" was supposed to mean.

Unfortunately, they go on to talk about whether the remove and enable methods are sync or async (claiming sync for all), so fixing this is going to require that I stop getting lost trying to trace whether or not that's true.

(Note to self: go for extra credit by fixing the pasteo of "@param aURL  The style sheet to be removed" for enableStyleSheet.)
Blocks: 321783
Attached patch Fix v.1Splinter Review
Adds at least some truthiness.
Attachment #385611 - Flags: superreview?(bzbarsky)
Attachment #385611 - Flags: review?(neil)
Attachment #385611 - Flags: review?(neil) → review+
Comment on attachment 385611 [details] [diff] [review]
Fix v.1

Looks ok, except the "no @import" thing is out of date.  Nowadays if you're doing a sync load of a stylesheet the CSSLoader will also sync-load the things it imports.  So you just have to make sure all the things involved (toplevel sheet and imports) are local files of some sort.
Attachment #385611 - Flags: superreview?(bzbarsky) → superreview+
Yeah, I didn't put that very well, what I meant was "without any @imports that aren't also of local files."
Whiteboard: [needs a tweaked patch]
Closed: 14 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [needs a tweaked patch]
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.