font-weight issue

Discussion about official Mozilla Firefox builds
Locked
User avatar
Siemova
Posts: 31
Joined: October 18th, 2003, 8:00 pm
Location: Madisonville, TX
Contact:

font-weight issue

Post by Siemova »

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
User avatar
LIMPET235
Moderator
Posts: 39932
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: font-weight issue

Post by LIMPET235 »

Moving to Builds...
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: font-weight issue

Post by Bluefang »

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...
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: font-weight issue

Post by patrickjdempsey »

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/
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: font-weight issue

Post by Bluefang »

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...
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: font-weight issue

Post by patrickjdempsey »

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/
User avatar
Siemova
Posts: 31
Joined: October 18th, 2003, 8:00 pm
Location: Madisonville, TX
Contact:

Re: font-weight issue

Post by Siemova »

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

Re: font-weight issue

Post by supernova_00 »

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.
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: font-weight issue

Post by patrickjdempsey »

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/
User avatar
Siemova
Posts: 31
Joined: October 18th, 2003, 8:00 pm
Location: Madisonville, TX
Contact:

Re: font-weight issue

Post by Siemova »

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
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: font-weight issue

Post by patrickjdempsey »

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/
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: font-weight issue

Post by Bluefang »

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...
Locked