Closed
Bug 69714
Opened 25 years ago
Closed 25 years ago
text does not show up on colored buttons.
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: TAF2000, Assigned: harishd)
References
()
Details
(Keywords: testcase)
Attachments
(1 file)
|
401 bytes,
text/html
|
Details |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; 0.8) Gecko/20010215
BuildID: 2001021508
On the page, http://essaytrader.net, the logon screen has buttons that are
colored black.. the text on them should show up white (as it does in IE). The
text shows up black and you can not see it.
Reproducible: Always
Steps to Reproduce:
Just go to the page.
Actual Results: The text on the buttons didn't show up.
Expected Results: Expected white font on the black buttons.
Comment 1•25 years ago
|
||
The buttons in question look like this:
<input TYPE="SUBMIT" NAME="Submit" VALUE="Login" STYLE="background:black"
STYLE="color:white">
Looks like we're only picking up the first style attribute. Over to parser.
Will attach a very simple testcase...
Confirming bug on linux build 2001-02-19-08 so this will get looked at.
Assignee: rods → harishd
Status: UNCONFIRMED → NEW
Component: HTML Form Controls → Parser
Ever confirmed: true
Keywords: testcase
OS: Windows NT → All
QA Contact: bsharma → janc
Hardware: PC → All
Comment 2•25 years ago
|
||
Parser does not do any attribute processing. In other words, parser just does
the job of collecting attributes ( and it seems to be doing its job ). The
problem is probably somewhere in the layout ( just guessing ). Giving bug to
Mark to investigate further.
Assignee: harishd → attinasi
Comment 4•25 years ago
|
||
Harish, the problem is that there are two style attributes on the body, and only
the values from the first one are being put into the content model. Here is a
piece of the content dump from the testcase (for the body):
body@02899120 id=bod style=color: white; refcount=3<
...
>
Notice that the second style attribute value (style= "background:black")is not
there. I'm not sure how layout can handle this since the content model is
missing the data.
I am not sure what should be happening to the second style attribute, actually,
but according to teh reporter it is handled OK in IE (thought Nav4 ignores the
first style attribute in the testcase).
Assignee: attinasi → harishd
Mark: I noticed that ( the content model ) too. The parser seems to be sending
that information to the sink. I'm not sure where it's getting lost ( may be it's
getting lost in the sink or somewhere else in the layout ). I will investigate
more.
Status: NEW → ASSIGNED
Comment 6•25 years ago
|
||
The problem is in HTMLContentSink::AddAttributes - it only adds the attribute if
it does not already exist:
if (NS_CONTENT_ATTR_NOT_THERE ==
aContent->GetHTMLAttribute(keyAtom, value)) {
// Get value and remove mandatory quotes
GetAttributeValueAt(aNode, i, v);
// Add attribute to content
aContent->SetAttribute(kNameSpaceID_HTML, keyAtom, v,aNotify);
}
Not sure if this is correct or not, if the values should be merged or what...
Who owns the ContentSink?
Mark: That's one problem. I actually forced all the attributes to pass thro'
SetAttribute() and still did not end up with a correct result. I think the core
of the problem could be somewhere up in the nsGenericHTMLElements
Comment 8•25 years ago
|
||
Yea, there are places in GenericHTMLElement where that same check for the
attribute already being there is made. So, what should happen, really? If an
attribute is specified multiple times, should the first one prevail, the last
one prevail, or their contents be combined (which only makes sense for some
attributes).
I have a feeling that this is not a compliance isses, but I'm CC'ing beppe for
her HTML standards position. Beppe? What should happen if an attribute is
specified multiple times in HTML?
Comment 9•25 years ago
|
||
More info (in case we decide to fix this): HTMLAttributesImpl::SetAttributeFor
checks if the attribute already exists and overwrites it if it does. The code
I'm thinking of is:
if (haveAttr) {
HTMLAttribute* attr =
HTMLAttribute::FindHTMLAttribute(aAttrName, mFirstUnmapped);
NS_ASSERTION(attr, "failed to find attribute");
if (attr) {
attr->mValue = aValue;
}
}
So, if we do want to 'merge' the second attribute value we need to modify this
behavior in addition to fixing the content sink so it does not screen the
attribute.
Considering that Nav does not honor this (only IE?), I think it is not a
compatibility issue, and is likely a WONTFIX or INVALID, but I'd like to hear
opposing opinions on that myself...
| Assignee | ||
Comment 10•25 years ago
|
||
In the case of identical attributes, mozilla always considers the attribute
value that was first encountered, unlike Nav. 4.x which for certain cases
considers the first attribute and for a few other the final attribute. Ex.
<body bgcolor=red bgcolor=blue>
In Mozilla -> red background
In Nav. 4.x -> red background
In IE -> red background
for
<body style="background-color:white" style="background-color:black">
In Mozilla -> white background
In Nav. 4.x -> black background <<<< NOTICE THIS
in IE -> white background
In other words, Nav4.x seems to be inconsistent & mozilla seems to be
consistent.
| Assignee | ||
Comment 11•25 years ago
|
||
I agree with Mark in marking this bug INVALID.
| Assignee | ||
Comment 12•25 years ago
|
||
sorry, I meant WONTFIX.
Comment 13•25 years ago
|
||
in html, or sgml for that matter, an attribute can be specified only one time
per inside an element. if, as in this case, there are more than one instance,
the first instance should be recognized and others should be ignored.
A good explanation of this is in the SGML Handbook, pg 36 B.5.2.2 Complex
Attribute Values
Comment 14•25 years ago
|
||
oops I stomped on harish -- remarking it for him
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•