Closed Bug 39642 Opened 24 years ago Closed 24 years ago

Changing HTML attributes does not cause style update

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: attinasi, Assigned: shaver)

References

Details

(Whiteboard: [nsbeta2+][6/15][5/30: going in today when tree opens])

Attachments

(2 files)

Changing some HTML attributes (like bgcolor) via the DOM is not causing the 
style to change. This is due to shaver's recent changes that look for attrivutes 
that are relevant to rules - well, many HTML attributes are implicitly mapped to 
CSS and are thus relevant, even though they may not appear in selectors.

I have a patch that fixes this by restricting shaver's changes to XML content 
and not HTML content.

This is critical because many basic HTML attribute changes are not doing 
anything.
Yeah, this is sucky.  Let's fix it. =)
Marking nsbeta2: this is going to affect a lot of HTML pages. The fix is also 
pretty simple and low-risk. I strongly urge fixing this for beta2.
Status: NEW → ASSIGNED
Keywords: nsbeta2
Priority: P3 → P2
Whiteboard: reviewed fix in hand, hoping to get approval for nsbeta2 :)
Target Milestone: --- → M16
I think we need my patch, too.  Marc, do you agree?
We need shaver's patch too because class and ID selectors will apply to XUL 
elements (since they implement nsIStyledContent), so we need to consider those 
attributes as relevant.

Shaver, for XML elements the ID attribute does not have to be called 'ID' - the 
XML DTD defines what the identifier attribute is, so the patch is not as general 
as it could be. I don't know how to get to the attribute name for the XML 
element's identifier, though :(  Also, according to the CSS spec (5.8.3) class 
selectors are only for HTML documents. We apply them to XML docs too though.
Just a nsbeta2 reminder: this is a big problem as it is - changing HTML 
attributes via script will not cause the element's style to be updated.
Adding dogfood kwd. 

This is a pretty smelly problem that prevents many DHTML pages from being 
rendered properly (any that change HTML presentational attributes, like bgcolor, 
background, align to name a few).
Keywords: dogfood
This bug needs some attention! 

It is a recent regression, we have a fix, and this affects all kinds of 
regression tests (ones that modify HTML attributes), and it will break 99% of 
DHTML pages on the web.

What does a poor engineer have to do to get an important fix approved? I'm 
cc'ing everybody I can think of to get some visibility...
Whiteboard: reviewed fix in hand, hoping to get approval for nsbeta2 :) → [fix in hand]
PDT team -- I recommend [nsbeta2][6/15]. The attributes are HTML 3.2, and they 
should be settable from JavaScript, with effect, through DOM1. 

Marc -- I think the PDT team has probably just fallen behind on the nominations. 
Thanks for pushing to get this in! 
Putting on [nsbeta2+][6/15] radar.
Whiteboard: [fix in hand] → [nsbeta2+][6/15][fix in hand]
I checked in the AttributeAffectsStyle change. 

Shaver, can you check in your patch now so we can close this puppy?
Assignee: attinasi → shaver
Status: ASSIGNED → NEW
I'm on it, brendan/waterson willing.
Status: NEW → ASSIGNED
Whiteboard: [nsbeta2+][6/15][fix in hand] → [nsbeta2+][6/15][5/30: going in today when tree opens]
In the tree.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Related/dup of bug 40178?

Marc, Mike: setting the bgcolor via JavaScript doesn't work, as of the 2000-06-
01-20/21-M16 builds.  Setting the background via similar methods does appear to
work.

Check out:
http://voodoolady/bugzilla/nobgcolor.html for bgcolor testcase
http://voodoolady/bugzilla/nobackground.html for background testcase

Re-opening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Argh.
Bad HTML on my part should *not* constitute an emergency on your part.

The bgcolor file I pointed you guys to had a typo.  Pardon my zeal in re-opening.

Marking VERIFIED FIXED on:
- MacOS9 2000-06-01-20-M16 Commercial Build
- Linux6 2000-06-01-20-M16 Commercial Build
- Win98  2000-06-01-20-M16 Commercial Build
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Marking VERIFIED (see previous comments)
Status: RESOLVED → VERIFIED
*** Bug 40178 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: