The default bug view has changed. See this FAQ.

Minimum font size not exposed

NEW
Unassigned

Status

()

Core
DOM: CSS Object Model
7 years ago
3 years ago

People

(Reporter: Sebastian Zartner, Unassigned)

Tracking

({student-project})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [firebug-p2], URL)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4

Currently the minimum font size defined via the options can't be retrieved via the API.
Firebug displays the CSS styles assigned to an HTML node in it's Style Side Panel.

Reproducible: Always

Steps to Reproduce:
See the test case URL.
Actual Results:  
The minimum font size is not shown inside the Style Side Panel. Same problem appears when using the DOM Inspector. Also the computed styles are giving the wrong value.

Expected Results:  
The minimum font size should be exposed via the API like all other styles.
Trying to set proper target component to get attention.
Honza
Component: General → DOM: CSS Object Model
QA Contact: general → general
Whiteboard: [firebug-p2]
Can't be retrieved by which API? You can retrieve the minimum font size through preferences:

e.g., font.minimum-size.x-western

replace x-western for the locale you're interested in.

Reopen if you have some other API you need.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
I typed too soon. Sorry Sebastian, I understand what you're asking for now. You think the minimumFontSize should be on the DOM node's style object.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
We can't do what comment 3 proposes, since that would pollute the namespace.  Furthermore, the minimum font size isn't actually a CSS property at all, so it makes no sense to expose it as one.

So what _is_ this bug asking for?
I believe he's asking for what I said in c#3, but hopefully he'll correct me if I'm wrong.
Well, c#3 as written is wontfix due to likelihood of breaking the web.
(Reporter)

Comment 7

7 years ago
Sorry for not writing earlier, needed to see Germany winning against Ghana. ;-)
Well, I just joined the Firebug team lately, maybe Honza or John can tell more here. But Rob is right. What I mean is to be able to access it via the style object. See therefore http://code.google.com/p/fbug/source/browse/branches/firebug1.6/content/firebug/css.js#455 and its callers. Boris, if that polluted the namespace, then there should be another solution for that, because this is not just missing in Firebug, but (as already mentioned) in DOM Inspector, too.
And for the computed styles the minimum font size is also not taken into account. Should this be put into a second issue or is that related?
presumably the browser's just overriding the font size if it sees something smaller than minimum. After Boris' comment and thinking about it a bit more, I'm not sure this belongs in the style object. It's a browser property.

Maybe Firebug could check the minimum font size preference and notify the user that they're using a smaller than minimum setting? Maybe throw it out as a CSS error in the Console?
(Reporter)

Comment 9

7 years ago
It's just a user preference, so actually it's not an error when the minimum size is used instead of the one defined in the CSS.
Boris is right saying, that the minimum font size is not a CSS property, though it's influencing how the content of a page is displayed.
I think it would be applicable to check the preference. Honza, what do you say?
What about the computed styles?
The min font size pref affects the used style.  It does not affect computed style.  If it did, it would screw up cases like this:

  <span style="font-size: smaller">
    <span style="font-size: larger">text</span>
  </span>

if the normal font size is above the cutoff but the smaller size is below it.

I have no problem adding a Moz* getter of some sort on the computed style object to get the result of applying the min-font-size pref.  

Checking the pref in firebug seems like a bad approach, since you don't know _which_ pref to check, necessarily.
QA Contact: general → style-system
(Reporter)

Comment 11

7 years ago
What we are talking about here is what the W3C calls "Actual value" (http://www.w3.org/TR/CSS2/cascade.html#value-stages).
So the Moz* getter you're discribing should return this value.

Though I wonder why the W3C specified the function getComputedStyle() for returning computed values, but no API for returning used and actual values, when they are already having seperate definitions for these values. I think it would be very useful to have additional functions getUsedStyle() and getActualStyle(). Maybe somebody they are listening to should tell them...
> Though I wonder why the W3C specified the function getComputedStyle() for
> returning computed values, but no API for returning used and actual values,
> when they are already having seperate definitions for these values.

Because they did not have used or actual values back when getComputedStyle was specified.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: student-project
If someone wants to implement this, here's the current getter for font-size in computed style:


1241 nsresult
1242 nsComputedDOMStyle::DoGetFontSize(nsIDOMCSSValue** aValue)
1243 {
1244   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
1245   NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
1246 
1247   // Note: GetStyleFont()->mSize is the 'computed size';
1248   // GetStyleFont()->mFont.size is the 'actual size'
1249   val->SetAppUnits(GetStyleFont()->mSize);
1250 
1251   NS_ADDREF(*aValue = val);
1252   return NS_OK;
1253 }

The quantity you want would be gotten the same way but using mFont.size instead of mSize.
Could this also be marked as [good first bug]?

Sebastian
You need to log in before you can comment on or make changes to this bug.