Closed Bug 99850 Opened 23 years ago Closed 22 years ago

changing document.linkColor more than once has no effect

Categories

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

x86
Windows 98
defect

Tracking

()

VERIFIED FIXED
mozilla1.4alpha

People

(Reporter: jruderman, Assigned: dbaron)

References

()

Details

(Keywords: testcase, Whiteboard: [CSS1-2.1][patch])

Attachments

(3 files)

Steps to reproduce: 1. Drag the personal homepagify bookmarklet from http://dmoz.org/Bookmarks/R/rpfuller/How_Not_to_Design_a_Web_Site/Bookmarklets/ onto your personal toolbar. 2. Go to http://www.cs.hmc.edu/~jruderma/s/ 3. Click the bookmarklet a few times. Result: the background and text colors keep changing, but the link colors and visited-link colors get "stuck" on the color they were set to the first time you activated the bookmarklet. Changing the background color of a web page always works: javascript:void(document.bgColor=Math.round(Math.random()*0x1000000)); But changing the link color only works the first time you do it: javascript:void(document.linkColor=Math.round(Math.random()*0x1000000));
Attached file testcase (deleted) —
This is vaguely similar to some issues from bug 87674. I suspect the problem here is that we need to invalidate some stuff in the rule tree when we change one of the rules internally, as HTMLStyleSheetImpl::Set{Link,VisitedLink,ActiveLink}Color do. I'm not sure why we don't see this problem with HTMLStyleSheetImpl::SetDocument{Foreground,Background}Color. hyatt?
Keywords: testcase
Whiteboard: [CSS1-2.1]
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → Future
cc'ing myself
The modified script I am using modifies only the the linkColor attributes, then sets the background of the DIVs to the colors the links are (it's pretty simple if you look). The color _is_ getting set, but is having no effect on the links. Weird.
It looks like the problem is that HTMLStyleSheetImpl::SetLinkColor needs to do an appropriate ClearStyleData (probably via the document's StyleRuleChanged method).
Attached patch patch (deleted) — Splinter Review
This fixes the bug by moving towards style rule immutability -- it makes the HTMLColorRule immutable.
Attachment #112873 - Flags: superreview?(bzbarsky)
Attachment #112873 - Flags: review?(bzbarsky)
Blocks: 188803
Whiteboard: [CSS1-2.1] → [CSS1-2.1][patch]
Target Milestone: Future → mozilla1.4alpha
Attachment #112873 - Flags: superreview?(bzbarsky)
Attachment #112873 - Flags: superreview+
Attachment #112873 - Flags: review?(bzbarsky)
Attachment #112873 - Flags: review+
Fix checked in to trunk, 2003-02-22 11:15 PST.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verified with attachment 92012 [details] on winXP trunk build 2003-02-24-04
Status: RESOLVED → VERIFIED
I added a set of reftests for document.linkColor and <body link>.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: