MozillaZine

font-weight issue

Discussion about official Mozilla Firefox builds
Siemova

User avatar
 
Posts: 31
Joined: October 18th, 2003, 8:00 pm
Location: Madisonville, TX

Post Posted August 11th, 2010, 11:07 am

I'm running 4.0b3 under Windows 7, and have stumbled across a bug. After the latest update to Gmail, for some reason the "Archive" button now consists of a b tag nested inside a div that has the css property font-weight: bold. Ordinarily this redundancy wouldn't cause a problem, but in this case the text is being bolded twice. I played around in Firebug (on this and other pages) and discovered the following:

  • The issue applies to both strong and b tags.
  • Of the "web fonts," it only seems to affect Arial.
  • Bolding doesn't stack if the style is on the element itself -- only if it's on an ancestor element.
  • Doctype doesn't appear to matter.
According to several coworkers, this does not happen in 3.x.
"What you embrace is what you become." - Six Feet Deep

LIMPET235
Moderator

User avatar
 
Posts: 38454
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted August 11th, 2010, 12:19 pm

Moving to Builds...
Ancient Amateur Astronomer
Win-7-HP/IntelĀ® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-57.0-61.0-62.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
RadioYachting. (Always choose the "Custom" Install.)

Bluefang

User avatar
 
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 11th, 2010, 12:25 pm

Personally, I think that's the way it should work. What other reason would you want to put a bold style in the middle of another bold style.

If you think it's a bug, feel free to file one
https://bugzilla.mozilla.org
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted August 11th, 2010, 12:49 pm

Is there a font-size increase somewhere? Some fonts appear to go bold in larger sizes. Maybe I am missing something here, but I didn't think there was such a thing as a double-bold font.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

Bluefang

User avatar
 
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 11th, 2010, 12:54 pm

There are varying levels of boldness (wight), though AFAIK it has to be supported by the font or synthetically computed
http://www.w3.org/TR/CSS21/fonts.html#font-boldness

So, to me, it makes sense that stacking weighting elements would relatively adjust the font weight.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted August 11th, 2010, 1:20 pm

Yes, there are the different numerical weights, but "bold" is a specific font-weight, typically weight 700. If you want something relatively more bold, you should use "bolder". The same is true for the difference between font-size "large" and "larger", one is specific and one is relative:

http://www.w3.org/TR/CSS2/fonts.html#font-boldness
https://developer.mozilla.org/en/CSS/font-weight

Redundancy is pretty common in style sheets. That looks like a bug to me.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

Siemova

User avatar
 
Posts: 31
Joined: October 18th, 2003, 8:00 pm
Location: Madisonville, TX

Post Posted August 11th, 2010, 2:06 pm

Yes, I'm afraid it's clearly a font-weight issue (unrelated to font-size), out of keeping with normal style behavior, and would make the lives of web developers like myself more frustrating if left unfixed. I will indeed file a bug if nobody else has yet.
"What you embrace is what you become." - Six Feet Deep

supernova_00
 
Posts: 4832
Joined: June 24th, 2004, 8:03 pm
Location: Maryland, USA

Post Posted August 12th, 2010, 2:24 pm

This is an issue with d2d/dw that won't be fixed. I tried very hard but the sites need to change their code to be correct.

https://bugzilla.mozilla.org/show_bug.cgi?id=548975
https://bugzilla.mozilla.org/show_bug.cgi?id=550128

Read both bugs from start to finish.

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted August 12th, 2010, 3:20 pm

From bug 548975:

John Daggett wrote:
This correct rendering, it's caused by the markup which is requesting a font
that's bolder than the bold face of Arial. The testcase is equivalent to the
markup below:

Code: Select all
<div class="style: font-family: Arial; font-weight: bold;">
  <b>Bug 548975 - This is very bold with Direct2D enabled</b>
</div>


The <b> tag is has 'font-weight: bolder'. ..


Aha, so it's caused by the B markup being equivalent to "bolder". Interestingly, that breaks HTML 4.1 which considers B to be "bold":

http://www.w3.org/TR/html401/present/gr ... l#h-15.2.1


HTML 5 may represent a change in that, (although this document does not specify it):

http://www.w3.org/TR/html5-diff/#changed-elements
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

Siemova

User avatar
 
Posts: 31
Joined: October 18th, 2003, 8:00 pm
Location: Madisonville, TX

Post Posted August 12th, 2010, 4:35 pm

patrickjdempsey wrote:Interestingly, that breaks HTML 4.1 which considers B to be "bold"

Interesting indeed. The same assumption is even more apparent in the 3.2 reference spec:
http://www.w3.org/TR/REC-html32-19970114#font-style

In consideration of this -- not to mention the common understanding of <b> as shorthand for "bold" (which I know the W3C is trying to get away from with HTML5, but is nevertheless etymologically accurate) -- I wonder why Firefox devs decided to make it equivalent to "bolder" in the first place.

IE appears to default font-weight to "bold" for those elements, but I see that Chrome also uses "bolder." Hrm.
"What you embrace is what you become." - Six Feet Deep

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted August 12th, 2010, 5:06 pm

It could be up to interpretation of the HTML 5 spec, that B should be used to *always* offset the specified text from the surrounding text, and not just to be shorthand for BOLD. So if you markup a section of a header with B, that section will stand out even if the entire header is already in BOLD. It makes sense, but it's definitely a redefinition of what B means.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

Bluefang

User avatar
 
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont

Post Posted August 12th, 2010, 5:07 pm

If the behavior of elements goes against the W3C spec, you can probably build a better case for having the behavior changed. And I don't recall that argument being used in either of those bugs.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...

Return to Firefox Builds


Who is online

Users browsing this forum: No registered users and 2 guests