Closed Bug 499071 Opened 13 years ago Closed 12 years ago

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

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: philor, Assigned: philor)

References

()

Details

Attachments

(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]
http://hg.mozilla.org/mozilla-central/rev/aa3a30f3f1e8
Status: ASSIGNED → RESOLVED
Closed: 12 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.