changing document.linkColor more than once has no effect

VERIFIED FIXED in mozilla1.4alpha

Status

()

Core
CSS Parsing and Computation
P1
minor
VERIFIED FIXED
16 years ago
10 years ago

People

(Reporter: Jesse Ruderman, Assigned: dbaron)

Tracking

({testcase})

Trunk
mozilla1.4alpha
x86
Windows 98
testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CSS1-2.1][patch], URL)

Attachments

(3 attachments)

(Reporter)

Description

16 years ago
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));
(Assignee)

Comment 1

16 years ago
Created attachment 49501 [details]
testcase
(Assignee)

Comment 2

16 years ago
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]
(Assignee)

Updated

15 years ago
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → Future

Comment 3

15 years ago
cc'ing myself

Comment 4

15 years ago
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.
(Assignee)

Comment 5

15 years ago
It looks like the problem is that HTMLStyleSheetImpl::SetLinkColor needs to do
an appropriate ClearStyleData (probably via the document's StyleRuleChanged method).
(Assignee)

Comment 6

15 years ago
Created attachment 112873 [details] [diff] [review]
patch

This fixes the bug by moving towards style rule immutability -- it makes the
HTMLColorRule immutable.
(Assignee)

Updated

15 years ago
Attachment #112873 - Flags: superreview?(bzbarsky)
Attachment #112873 - Flags: review?(bzbarsky)
(Assignee)

Updated

15 years ago
Blocks: 188803
(Assignee)

Updated

15 years ago
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+
(Assignee)

Comment 7

15 years ago
Fix checked in to trunk, 2003-02-22 11:15 PST.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED

Comment 8

15 years ago
verified with  attachment 92012 [details] on winXP trunk build 2003-02-24-04


Status: RESOLVED → VERIFIED
(Reporter)

Comment 9

10 years ago
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.