Closed Bug 87485 Opened 23 years ago Closed 23 years ago

Styles changed by DOM are not being realized in layout

Categories

(Core :: DOM: CSS Object Model, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.3

People

(Reporter: jrspm, Assigned: hyatt)

References

()

Details

(Keywords: regression, Whiteboard: [Hixie-P1])

Attachments

(2 files)

Using build 2001062211 on Win2k (SP2)

Steps to reproduce:
1. go to:  http://www.mozilla.org/newlayout/xml/debugdemos/tocdemo/rights.xml
2. click the "Contents" button
3. see the TOC display on the left
4. notice that the main body overlays the original document

Actual:
TOC overlays body

Expected:
When TOC is created, it is given a width of 12em.  Right before that, the main
body of the page is given a margin-left of 12em (
document.styleSheets[0].cssRules[0].style.marginLeft = "12em"; ) meaning that
the main body should not be overlayed by the TOC.  It should be to the right of TOC.

attaching a testcase shortly showing that styles can be read and set via the
Style DOM, however the new styles are not being rendered in the document.

Jake
Woops, accidentally uploaded the css file as text/html.  Well, testcase still
loads the css file ok.  I'll leave that.

Note:  in the testcase, the text with background black and color white is the
element that is being restyled via a class selector ( .test ).  What should be
happening when you toggle the style is:

Initially:
background-color: black;
margin-left: 12em;

After first toggle:
background-color: green;
margin-left: 0;  ( I set it to "0", Mozilla reports it as "0pt"...bug? )

Jake
adding cc
*** Bug 47319 has been marked as a duplicate of this bug. ***
This is not a DOM problem, the DOM code does properly tell layout about this
style change, something goes wrong either in the style code or in the
reflow/frame construction code. Over to attinasi, this could be a regression
from hyatt's stylesystem changes...
Assignee: jst → attinasi
It works correctly in NS6.1b1, so this has regressed since then...
Keywords: regression
hyatt: this is probably a style system regression.
Assignee: attinasi → hyatt
Whiteboard: [Hixie-P1]
It is. This has to do something similar to what is done when the .style property
is changed, namely invalidating portions of the rule tree cache.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.3
Any progress on this?

jake
i've been searching in bugzilla on if a bug exists about a style property not
being updated correctly. this is happening on a page where i'm dynamically
enabling and disabling a style sheet via the .disabled property.  *ALL* styles
*ARE* updated with the exception of the background-color property.

http://www.cherny.com/mozilla/css_switch/index.html

These style swaps work correctly in IE5.0+ and NS6.01 but not 0.9.1 or 0.9.2 ... 

I'm not sure if this is related to this bug, bug 34849, or another completely.

opinions? should I file a new one? or is it related?

thanks
:rob
I do not think that this is a dup of bug 34849. Rather, this is a regression
from a recent change to the style system. A related bug is bug 90081 - the
problem discovered there is that the rule tree needs to be rebuilt when the rule
processors are rebuilt, and this happens when a stylesheet is added, removed, or
enabled or disabled. Currently, we are not rebuilding the rule tree so the
cascade is not effectively being reprocessed and applied.

To be sure, try a build before the 6/01 build - that was when the new style code
was landed.

David, do you have any plans for managing invalidation of parts of the rule
tree? If so, that may help me with bug 90081 (there are many issues I am running
into trying to clear the rule tree, documented in that bug).

yeah i wasn't convinced it was a direct duplicate, but maybe related in some 
way.  i'll see if i can't check out the example i had with a build back-dated 
like you suggested, see if it does manifest itself around those dates.

again, it's not everything, most style changes take in my example, just the 
background color isn't updated.  however, now that i think about it, my example 
has only the one *color* change ... i should try some other color changes on 
the same thing, see if it behaves the same way.
is -moz-opacity also not working because of this?  The following testcase is 
taken from bug 66022.  That bug is only about a crash that was happening when 
using -moz-opacity.  The crash is now fixed, but the testcase doesn't work.  
jst said to post a new bug about it, but I want to check here to see if this 
bug is the reason for it not working?

http://bugzilla.mozilla.org/showattachment.cgi?attach_id=22999

Jake
Rob, the problem you are seeing sounds a heck of a lot like bug 88681.

"style change to background-color or background-image after disabling a style 
sheet is not complete"


Jake
yeah totally ... martin (who reported that) and i actually exchanged discussion 
on that on the newsgroups.

thanks!!
Fixed by the fix for 90081.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
bug 90081 was re-opened because the patch was backed out.  That leaves this bug 
unfixed.  

I hear there is a freeze tomorrow night.  Does this mean that Netscape 6.1 
won't be supporting a whole bunch of DHTML stuff like this?  I gotta say, that 
would be a real shame, since previous versions supported this.

Jake
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Working on this one for 0.9.3 actually.
Status: REOPENED → ASSIGNED
Target Milestone: mozilla0.9.4 → mozilla0.9.3
Fixed by 90081.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Attachment #39839 - Attachment mime type: text/html → text/css
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: