Last Comment Bug 219516 - text-decoration doesn't work on submit input button in standards mode
: text-decoration doesn't work on submit input button in standards mode
Status: RESOLVED WORKSFORME
: qawanted, testcase
Product: Core
Classification: Components
Component: Layout: Block and Inline (show other bugs)
: Trunk
: All All
: -- minor with 4 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://mmcc.cx/submitlink
: 230983 256653 264026 270379 273283 292363 310047 386868 432929 444795 482283 541837 560881 (view as bug list)
Depends on:
Blocks: 332124
  Show dependency treegraph
 
Reported: 2003-09-17 16:25 PDT by Travis Watkins
Modified: 2012-09-04 05:48 PDT (History)
23 users (show)
roc: blocking1.9.1-
roc: wanted1.9.1-
bzbarsky: blocking1.9-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Simple test case to show this bug (283 bytes, text/html)
2007-05-03 03:48 PDT, Helen Emerson
no flags Details
Testcase showing all text-decoration values on inputs (type=button) and paragraphs (1.01 KB, text/html)
2008-09-05 12:25 PDT, jsp
no flags Details

Description Travis Watkins 2003-09-17 16:25:30 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030911 Firebird/0.6.1+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030911 Firebird/0.6.1+

In http://mmcc.cx/submitlink, when you move your mouse over the text it should
get underlined and the input should have a background color of #eee. However the
only thing that seems to work is the cursor: pointer;. I have been told this
works correctly in Mozilla 1.2, so I'm not sure why it wouldn't now.

Reproducible: Always

Steps to Reproduce:
1. Create a page with <input type="submit" value="foobar">
2. Set some CSS to make it change its background-color or text-decoration on :hover

Actual Results:  
Nothing changed.

Expected Results:  
The background-color and text-decoration styles should have taken effect.
Comment 1 Bill Mason 2003-09-17 16:45:15 PDT
WFM 20030911 PC/WinXP
Comment 2 Travis Watkins 2003-09-17 20:24:52 PDT
Do you have any options set? All I've changed from the default install is Web
Developer 0.3 and User Agent Switcher 0.23, however I will try a fresh install
and if one of those was causing the problem, sorry for wasting time.
Comment 3 Travis Watkins 2003-09-17 20:27:34 PDT
No change, still not sure what could be causing this. I was told it could be a
'regression bug', whatever that is.
Comment 4 Andrew Schultz 2003-09-18 08:10:19 PDT
the background change worksforme with linux trunk 20030916, but I do see the
problem with text-decoration.

the text-behavior changed between linux trunk 2002120908 and 2002121021,
indicating bug 1777.
Comment 5 Boris Zbarsky [:bz] 2003-09-25 09:13:58 PDT
The <input> is a replaced element, not a block.  So it's not clear what exactly
text-decoration applied to it should do.  The :hover is not an issue here, since
adding the text-decoration to the non-:hover rule also does not work.
Comment 6 Hixie (not reading bugmail) 2003-09-25 10:22:01 PDT
<input> is a replaced element. We should handle it the same way as an image as 
far as text-decoration goes.
Comment 7 Boris Zbarsky [:bz] 2003-09-25 13:45:43 PDT
In other words, do what we do now, no?
Comment 8 Boris Zbarsky [:bz] 2003-09-25 14:55:01 PDT
If we decide to fix this, it's a matter of adding "text-decoration: inherit" to
the *|*::-moz-button-content rule in forms.css.....
Comment 9 Boris Zbarsky [:bz] 2003-11-16 00:43:47 PST
OK, marking invalid per comment 6.
Comment 10 Stefan [:stefanh] 2004-01-15 08:47:09 PST
*** Bug 230983 has been marked as a duplicate of this bug. ***
Comment 11 Stefan [:stefanh] 2004-01-15 08:55:54 PST
Hmm... When i open attachment 139113 [details] in bug 230983 with Mozilla 2004010905 (Mac
OS 10.2.8) text-decoration: blink; in standards mode works.
Comment 12 Rick Bull 2004-01-15 09:58:14 PST
Comment 6 states that replaced elements should not implement text-decoration,
but correct me if I'm wrong, that's not what CSS 2 says (unless this has changed
in a newer version):

  If the element has no content or no text content (e.g., the IMG element in
HTML), user agents must ignore this property

So text-decoration should only be ignored if the element doesn't have text
content, which <button> (and the ALT of image for that matter) does. It doesn't
say anything about replaced elements. But maybe I'm misinterpreting it?
Comment 13 Mats Palmgren (vacation) 2004-08-24 15:26:30 PDT
*** Bug 256653 has been marked as a duplicate of this bug. ***
Comment 14 Nikolai Tsvetkov 2004-08-24 15:42:24 PDT
(In reply to comment #13)
> *** Bug 256653 has been marked as a duplicate of this bug. ***

Any suggestions to make the button text underlined, anyway?
style="text-decoration: inherited;" doesn't work. :-/
Comment 15 Mats Palmgren (vacation) 2004-08-24 15:49:20 PDT
Reopening for re-consideration. CSS 2.1 says:

"If an element contains no text (ignoring white space in elements that have
'white-space' set to 'normal', 'pre-line', or 'no-wrap'), user agents must
refrain from rendering text decorations on the element."

http://www.w3.org/TR/CSS21/text.html#propdef-text-decoration

IMO, a button "contains text" (unless it's a type=image).
Comment 16 Bill Mason 2004-10-12 08:27:03 PDT
*** Bug 264026 has been marked as a duplicate of this bug. ***
Comment 17 Erik Fabert 2004-11-17 06:06:28 PST
*** Bug 270379 has been marked as a duplicate of this bug. ***
Comment 18 charon me 2004-11-17 09:15:52 PST
i originally posted 270379. sorry for not finding 219516, because it does not
have the word button in it.

Do we see text on top of a button as text or not? I think it is a matter of
interpretation. I understand it is possible to say it is not text (its a value),
but is it an image? is it empty? do font properties apply to it? Does it consist
of letters and is readable? It seems to me it is text indeed.

so to be consistent the alt on an image should be treated the same way, but it
isnt: http://www.charon.sk/button_underline_test.htm
text-decoration:underline is applied do the alt text of an image as well as
other text and font properties.
Comment 19 Micha³ Piaskowski 2004-12-05 13:05:15 PST
*** Bug 273283 has been marked as a duplicate of this bug. ***
Comment 20 Jason Barnabe (np) 2005-05-14 13:56:41 PDT
*** Bug 292363 has been marked as a duplicate of this bug. ***
Comment 21 Jason Barnabe (np) 2005-05-14 14:00:12 PDT
This works if the button is position absolute or fixed or if the page is in
quirks mode.
Comment 22 Peter van der Woude [:Peter6] 2005-05-14 14:15:06 PDT
leaving this unco while others dupe bugs aginst it seems pointless
->New ( based on comment #15 )
Comment 23 Boris Zbarsky [:bz] 2005-06-07 20:32:57 PDT
> This works if the button is position absolute or fixed

Or if it's just |display: block|, which those force.  See comment 5.
Comment 24 Adam Guthrie 2005-09-26 09:02:51 PDT
*** Bug 310047 has been marked as a duplicate of this bug. ***
Comment 25 Boris Zbarsky [:bz] 2006-01-06 21:11:07 PST
Note that this needs a clear spec before we change any code.  Ian?
Comment 26 Hixie (not reading bugmail) 2006-01-08 14:40:39 PST
# CSS2.1 does not define which properties apply to form controls and
# frames, or how CSS can be used to style them. User agents may apply
# CSS properties to these elements. Authors are recommended to treat
# such support as experimental. A future level of CSS may specify this
# further.
 -- CSS2.1 section 3.2.
Comment 27 Helen Emerson 2007-05-03 03:48:57 PDT
Created attachment 263576 [details]
Simple test case to show this bug

In quirks mode it displays the underline, in standards mode it doesn't. If you add a position:absolute; style to the button it will display the underline. It probably should be consistent for all types of positioning.

I was testing this on Firefox 2.0.0.3:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

I also tested the same sample in IE7 and Opera 9.10 and it showed an underline in IE7 but no underline in Opera.
Comment 28 David Baron :dbaron: ⌚️UTC+8 (review requests must explain patch) 2007-05-04 14:43:32 PDT
Maybe related to the bug about text-decoration on inline-block?
Comment 29 Phil Ringnalda (:philor, back in August) 2007-07-05 00:01:23 PDT
*** Bug 386868 has been marked as a duplicate of this bug. ***
Comment 30 Gabriele Best [:Gabri] 2007-11-01 13:13:34 PDT
after 4 years, why haven't you resolved this bug yet?
Comment 31 Gabriele Best [:Gabri] 2007-11-02 08:05:09 PDT
Please, can you fix it in firefox3?
Comment 32 Kevin Brosnan 2007-11-02 08:35:39 PDT
*** Bug 386868 has been marked as a duplicate of this bug. ***
Comment 33 Boris Zbarsky [:bz] 2007-11-02 08:53:39 PDT
It's not clear that the current behavior is wrong (and hence that there is anything to fix).  The key is to figure out what the "right" behavior is, which is a specification matter, not an implementation one.  

And had you read the bug, you'd know all that.
Comment 34 Gabriele Best [:Gabri] 2007-11-02 10:33:57 PDT
But it is a bug!

Why can't you resolve it?
Comment 35 Boris Zbarsky [:bz] 2007-11-02 12:09:18 PDT
> But it is a bug!

Why?  Please read this bug carefully.  Then read the relevant specifications.

Then think about whether a GIF of some text styled with "text-decoration: underline" should underline the text.

It's clear that you would like this sort of thing to work.  It's not clear that it should.  It also isn't clear that it shouldn't, which is why this bug is open pending spec clarification and not resolved "invalid".
Comment 36 Gabriele Best [:Gabri] 2007-11-02 15:00:39 PDT
I'm a web developer, not a c++ one :(
I'm not capable to resolve this bug patching firefox.

I think that after 4 years, you should to resolve this stupid bug.
Comment 37 Daniel.S 2008-06-06 05:20:58 PDT
*** Bug 432929 has been marked as a duplicate of this bug. ***
Comment 38 pike 2008-07-11 10:39:36 PDT
>Why?  Please read this bug carefully.  Then read the relevant specifications.

You are repeating comment 6, which marked this bug invalid. 
So I will repeat comment 12, which marked it valid again. Sigh.

" If the element has no content or no text content (e.g., the IMG element in
HTML), user agents must ignore this property. So text-decoration should 
only be ignored if the element doesn't have text content, which <button> does"

so button { text-decoration:underline; } should work, but it incorrectly doesn't. 
notice button {text-decoration:line-through; } does work, btw

*-pike

Comment 39 pike 2008-07-11 11:43:13 PDT
reading my own post, maybe my complaints were not really on the right place; i've now filed a more specific bug report about the <button> element only (so not the <input type=button> element) here : https://bugzilla.mozilla.org/show_bug.cgi?id=444795
Comment 40 jsp 2008-09-05 12:25:56 PDT
Created attachment 337104 [details]
Testcase showing all text-decoration values on inputs (type=button) and paragraphs

Enhanced testcase, showing all text-decoration values applied to inputs of type button and to paragraph text (the latter to illustrate what is supported by the browser).

At present, while underline, overline, and line-through are not supported by inputs, blink is, so the implementation is inconsistent.  One text-decoration is supported, three are not.
Comment 41 Mats Palmgren (vacation) 2009-03-09 14:34:48 PDT
*** Bug 482283 has been marked as a duplicate of this bug. ***
Comment 42 Ria Klaassen (not reading all bugmail) 2010-01-24 10:33:52 PST
*** Bug 541837 has been marked as a duplicate of this bug. ***
Comment 43 Robert Longson 2010-04-21 10:10:38 PDT
*** Bug 560881 has been marked as a duplicate of this bug. ***
Comment 44 Adam Brunner 2011-07-07 07:07:53 PDT
This bug is not reproducable under:
Firefox 4.0 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0) Gecko/20100101 Firefox/4.0)
Firefox 5.0 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:5.0) Gecko/20100101 Firefox/5.0)

Thanks guys!
Comment 45 Boris Zbarsky [:bz] 2012-09-04 05:48:09 PDT
*** Bug 444795 has been marked as a duplicate of this bug. ***

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