Closed
Bug 361948
Opened 19 years ago
Closed 19 years ago
using getComputedStyle on elements of another frame returns inaccurate info
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: nrlz, Unassigned)
Details
Attachments
(2 files)
1.35 KB,
text/html
|
Details | |
1.22 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8
If I use window.getComputedStyle on elements of another frame, the styles are inaccurate. They seem to return either some default value or any value that is set with an inline style attribute. In other words, styles set by stylesheets are not returned.
e.g.,
window.getComputedStyle(frames[0].myElement).getPropertyValue(X) !=
frames[0].getComputedStyle(frames[0].myElement).getPropertyValue(X)
Also see testcase.
Reproducible: Always
Expected Results:
If this method of using getComputedStyle is not supported, I would expect that using it would throw an error instead of failing silently and realistically.
Assignee: dbaron → general
Component: Style System (CSS) → DOM: CSSOM
Comment 2•19 years ago
|
||
Comment 3•19 years ago
|
||
So something like this I guess, not sure what error to throw.
![]() |
||
Comment 4•19 years ago
|
||
This is just invalid. You're asking what the style of that element would be if it were in the view that you're talking to (that is, the window that getComputedStyle is being called on). So you get the answer you get.
There's nothing in the DOM style spec that restricts what views you can talk to regarding an element's style, so throwing here would be wrong.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•