Last Comment Bug 99850 - changing document.linkColor more than once has no effect
: changing document.linkColor more than once has no effect
: testcase
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: x86 Windows 98
P1 minor with 1 vote (vote)
: mozilla1.4alpha
Assigned To: David Baron :dbaron: ⌚️UTC-8
: Hixie (not reading bugmail)
: Jet Villegas (:jet)
Depends on:
Blocks: 188803
  Show dependency treegraph
Reported: 2001-09-15 21:54 PDT by Jesse Ruderman
Modified: 2007-12-17 22:13 PST (History)
2 users (show)
jruderman: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

testcase (933 bytes, text/html)
2001-09-16 07:38 PDT, David Baron :dbaron: ⌚️UTC-8
no flags Details
Attachment showing document.linkColor is changing, but not being painted (1014 bytes, text/html)
2002-07-19 14:56 PDT, Eli Friedman
no flags Details
patch (2.58 KB, patch)
2003-01-28 09:01 PST, David Baron :dbaron: ⌚️UTC-8
bzbarsky: review+
bzbarsky: superreview+
Details | Diff | Splinter Review

Description User image Jesse Ruderman 2001-09-15 21:54:43 PDT
Steps to reproduce:
1. Drag the personal homepagify bookmarklet from 
onto your personal toolbar.
2. Go to
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:

But changing the link color only works the first time you do it:
Comment 1 User image David Baron :dbaron: ⌚️UTC-8 2001-09-16 07:38:28 PDT
Created attachment 49501 [details]
Comment 2 User image David Baron :dbaron: ⌚️UTC-8 2001-09-16 07:48:18 PDT
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?
Comment 3 User image Madhur Bhatia 2002-05-17 14:28:19 PDT
cc'ing myself
Comment 4 User image Eli Friedman 2002-07-19 14:56:58 PDT
Created attachment 92012 [details]
Attachment showing document.linkColor is changing, but not being painted

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.
Comment 5 User image David Baron :dbaron: ⌚️UTC-8 2002-07-21 06:55:52 PDT
It looks like the problem is that HTMLStyleSheetImpl::SetLinkColor needs to do
an appropriate ClearStyleData (probably via the document's StyleRuleChanged method).
Comment 6 User image David Baron :dbaron: ⌚️UTC-8 2003-01-28 09:01:08 PST
Created attachment 112873 [details] [diff] [review]

This fixes the bug by moving towards style rule immutability -- it makes the
HTMLColorRule immutable.
Comment 7 User image David Baron :dbaron: ⌚️UTC-8 2003-02-22 13:51:36 PST
Fix checked in to trunk, 2003-02-22 11:15 PST.
Comment 8 User image Madhur Bhatia 2003-02-24 13:01:33 PST
verified with  attachment 92012 [details] on winXP trunk build 2003-02-24-04

Comment 9 User image Jesse Ruderman 2007-12-17 22:13:08 PST
I added a set of reftests for document.linkColor and <body link>.

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