#15229 closed enhancement (fixed)
missing doc parameter to various DOM functions
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | HTML | Version: | 1.7.2 |
Keywords: | Cc: | Eugene Lazutkin | |
Blocked By: | Blocking: |
Description (last modified by )
Besides the domConstruct.create() issue I listed in #15226, there are a number of functions that should probably take an optional doc parameter in the same way that dom.byId(id, doc) and domConstruct.toDom(string, doc) do:
dojo/_base/window.js:
- body() (actually, I just fixed this in [28401])
dojo/window.js:
- getBox() (could arguably pass in a window instead of a document, but document is more convenient)
dojo/dom-geometry.js:
- isBodyLtr()
- docScroll()
- getIeDocumentElementOffset()
- fixIeBiDiScrollLeft()
Suggestions taken from Sudoh-san's spreadsheet
Change History (4)
comment:1 Changed 9 years ago by
Cc: | Eugene Lazutkin added |
---|---|
Description: | modified (diff) |
Milestone: | tbd → 1.8 |
Owner: | changed from Eugene Lazutkin to bill |
Status: | new → assigned |
comment:4 Changed 9 years ago by
Type: | defect → enhancement |
---|
It's possible to control the document used by these methods via withDoc() or withGlobal().
However, out of all the dom* and window methods, these were the only ones where using withDoc() was necessary. byId() and toDom() take a document parameter, so I followed that precedent. Many other methods infer the document from a DOMNode parameter, but that wasn't possible for the above methods.
Besides the consistency issue, passing a document parameter to these methods is faster and less code than using withDoc().
It looks like the missing doc parameters were just oversights, rather than design decisions, so I'll check in a fix. Let me know if the parameter was intentionally omitted.