Closed
Bug 298581
Opened 20 years ago
Closed 19 years ago
font-family property for an Element node's computed style is inconsistent
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: vnagarjuna, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
I have noticed that the font-family property returned from an element's style
object using document.defaultView.getComputedStyle(node, '') is inconsistent in
the following two cases.
1. If a text node is enclosed using font tags like this <font
face="some_font">some_text</font>, the following code returns some_font.
var style = document.defaultView.getComputedStyle(node, '') where node is the
font element node.
var face = style.getPropertyValue("font-family").
The above is true even if some_font is not installed on the local machine.
2. If font is specified using CSS and @font-face, the same code for the parent
node of the text node returns serif instead of some_font. This seems incorrect
because if some_font is available on the machine, the text is rendered correctly.
For an example of 1, please take a look at http://www.andhrajyothy.com/.
For an example of 2, please take a look at
http://www.andhrajyothy.com/editshow.asp?qry=/2005/jun/20vividha1. The JS that
is setting the font is at http://www.andhrajyothy.com/fonts/PFR_EOT.js.
It would be convinient if some_font is returned from 2 because it will help in
scripts (ex: greasemonkey lauched ones) to automatically transform the page to
Unicode.
Reproducible: Always
Steps to Reproduce:
1. I'm not sure if there are tools to inspect the DOM tree, but I wrote some
Javascript to verify this. I can post this if needed.
Actual Results:
font-family is set different in the above two cases.
Expected Results:
I expected them to be the same.| Reporter | ||
Comment 1•19 years ago
|
||
Can some one confirm if this is a valid bug? I can look into working on a patch if it is a bug.
Comment 2•19 years ago
|
||
> 1. If a text node is enclosed using font tags like this <font That's the correct behavior. > 2. If font is specified using CSS and @font-face, We don't support @font-face. I can't tell whether the bug is valid because there is no testcase -- just huge pages where I don't even know where to start looking for the code you're talking about. Please attach a testcase.
| Reporter | ||
Comment 3•19 years ago
|
||
This is not a valid bug. It was a mistake in my understanding.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Component: DOM: Views and Formatting → DOM: CSS Object Model
QA Contact: ian → general
You need to log in
before you can comment on or make changes to this bug.
Description
•