Opened 16 years ago
Closed 15 years ago
#2151 closed defect (fixed)
getComputedStyle doesn't use defaultView from Node
Reported by: | Owned by: | liucougar | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Style | Version: | 0.4.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo.html.getComputedStyle should use the defaultView of the node's owning document instead of the defaultView which dojo is loaded from. This allows getComputedStyle to work on nodes from other documents (e.g., inside iframes).
i.e., dojo uses: document.defaultView.getComputedStyle(node, "").getPropertyValue(cssSelector);
but it should use: node.ownerDocument.defaultView.getComputedStyle(node, "").getPropertyValue(cssSelector);
Attachments (1)
Change History (6)
Changed 16 years ago by
comment:1 Changed 15 years ago by
Milestone: | → 0.9 |
---|---|
Owner: | changed from anonymous to dylan |
Status: | new → assigned |
comment:2 Changed 15 years ago by
I posted a question to the dojo-interest list that seems related to this (thanks to Robert Coup for pointing me here). My original post is at:
http://dojotoolkit.org/pipermail/dojo-interest/2006-December/022393.html
Basically my problem involves nested iframes and the accessibility function "testAccessible" (a11y.js). There is a call to getComputedStyle(div,"") which actually returns null and therefore causes the script to then fail on the next line.
Hopefully the fix made for this ticket will also fix that problem.
comment:3 Changed 15 years ago by
I just ran into the same problem
A quick fix would be to change line 32 to the following:
if (cStyle) bkImg = cStyle.getPropertyValue("background-image");
Keep in mind this is a temporary solution.
comment:4 Changed 15 years ago by
Owner: | changed from dylan to liucougar |
---|---|
Status: | assigned → new |
testcase (Firefox only)