#8367 closed defect (fixed)
dojo._isBodyLtr does not work with dojo.withGlobal
Reported by: | Douglas Hays | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | Internationalization | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When I call dojo.withGlobal to switch to a different document context, the value of dojo._bodyLtr is cached and can report the wrong value. The value should be cached somewhere related to the context like dojo.global._bodyLtr. I need this fixed for some doctype/rtl switching tests that I'm developing.
Attachments (2)
Change History (11)
Changed 12 years ago by
Attachment: | bodyltr.patch added |
---|
comment:1 Changed 12 years ago by
I don't think we want to add any globals. It violates our namespace policy. Would it be okay to attach it to the document (dojo.doc) instead? This would be hostenv_browser specific, but I suppose the bidi concept generally is?
comment:2 Changed 12 years ago by
That sounds good to me; we already much with <body> by setting classes like dj_ieIE, so it's not unprecedented.
However, it also sounds slower since it requires an access to the DOM node on every call.
comment:3 Changed 12 years ago by
What if you just save off the value in the dojo.withGlobal, set the value to null (so it gets calculated in the new doc) and restore it after the withGlobal finishes? Looks like withDoc might also need to be adjusted. Might need to watch the amount of code it takes, but since this is a low level thing called for lots of positioning/coordinate stuff it may be worth it.
comment:4 Changed 12 years ago by
Some extra clarification on the motivation for my previous comment:
Operating on other frames is a less frequent operation, so it can be recalculated for every dojo.withGlobal call. Within that withGlobal call it will be cached, but then reset to previous value. I don't feel like we have to go out of our way to support multi doc scenarios since they are fragile and generally we do not try for robust support.
comment:5 Changed 12 years ago by
Owner: | changed from Adam Peller to Douglas Hays |
---|---|
Status: | new → assigned |
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Changed 12 years ago by
Attachment: | window-reduction.patch added |
---|
forgot to attach this one... needs review
possible patch