Closed
Bug 109291
Opened 24 years ago
Closed 24 years ago
document.*Color is empty
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bugzilla, Assigned: hwaara)
References
()
Details
Attachments
(1 file, 2 obsolete files)
|
6.37 KB,
patch
|
hwaara
:
review+
hwaara
:
superreview+
|
Details | Diff | Splinter Review |
on http://gemal.dk/browserspy/showprop.html?document the property
"document.vlinkColor" is empty while with IE it's #800080
build 20011108
| Reporter | ||
Comment 1•24 years ago
|
||
the same goes for "document.linkColor" "document.fgColor" and "document.alinkColor"
Summary: document.vlinkColor is empty → document.*Color is empty
Updated•24 years ago
|
Target Milestone: --- → mozilla0.9.9
Comment 3•24 years ago
|
||
Moving Netscape owned 0.9.9 and 1.0 bugs that don't have an nsbeta1, nsbeta1+,
topembed, topembed+, Mozilla0.9.9+ or Mozilla1.0+ keyword. Please send any
questions or feedback about this to adt@netscape.com. You can search for
"Moving bugs not scheduled for a project" to quickly delete this bugmail.
Target Milestone: mozilla1.0 → mozilla1.2
| Assignee | ||
Comment 4•24 years ago
|
||
OK, I implemented:
* document.fgColor
* document.vlinkColor
* document.alinkColor
* document.linkColor
and those on the document.body.* to work like IE and NS4.x's attributes work,
when there attributes are not explicitely set.
Since neither the backend nor the UI supports getting/setting ALINKs of the UA
stylesheet, I will spin off a separate bug for that and for now make body.aLink
point to body.link (this is how IE works presently, AFAICT).
| Assignee | ||
Comment 5•24 years ago
|
||
Comments, suggestions, nits and reviews are all welcome.
| Assignee | ||
Comment 6•24 years ago
|
||
Spun off bug 142163 for the alink issue.
You don't need to call FlushPendingNotifications to flush reflows, since the
colors don't depend on reflows.
Comment 8•24 years ago
|
||
Comment on attachment 82283 [details] [diff] [review]
Patch v1
Great patch, thanks for doing it! A few stylistic nits :-)
>+NS_IMETHODIMP
>+nsHTMLBodyElement::GetVLink(nsAString& aVlinkColor)
>+{
>+ // If we don't have an attribute, find the default color from the
>+ // UA stylesheet.
>+ if (NS_CONTENT_ATTR_NOT_THERE == GetAttr(kNameSpaceID_None, nsHTMLAtoms::vlink, aVlinkColor)) {
Please move the assignment out of the if. Do something like this:
nsresult rv = GetAttr(kNameSpaceID_None, nsHTMLAtoms::vlink, aVlinkColor);
if (rv == NS_CONTENT_ATTR_NOT_THERE)
(we use rv instead of result everywhere)
>+ nsresult result = NS_OK;
>+ if (mDocument) {
>+ // Make sure the presentation is up-to-date
>+ result = mDocument->FlushPendingNotifications();
>+ if (NS_FAILED(result)) {
>+ return result;
>+ }
>+ }
>+
What dbaron said. Also please use NS_ENSURE_SUCCESS(rv, rv) everywhere instead
of
if (NS_FAILED(rv)) {
return rv;
}
>+ nsCOMPtr<nsIPresContext> context;
>+ result = GetPresContext(this, getter_AddRefs(context));
>+
>+ if (NS_FAILED(result)) {
>+ return result;
>+ }
>+
>+ nscolor vlinkColor;
>+ result = context->GetDefaultVisitedLinkColor(&vlinkColor);
>+
You don't use the value of result here. Please use it or remove it.
Apart from those nits, it's great! There are even comments, wow :-)
| Assignee | ||
Comment 9•24 years ago
|
||
Is it safe to fix all these nits (FlushNotifications and stylistc) in
GetBgColor() as well, or is that somehow special-cased?
| Assignee | ||
Comment 10•24 years ago
|
||
Looks like it depends on the FlushPendingNotifications() call since it checks
the primary frame.
Comment 11•24 years ago
|
||
Yep I'd say clean up GetBgColor as well, it's old code :-) Not sure about
FlushPendingNotifications for that function, though.
| Assignee | ||
Comment 12•24 years ago
|
||
Changes:
* GetBgColor() stylistically cleaned up.
* Dbaron's and Fabian's nits fixed.
Attachment #82283 -
Attachment is obsolete: true
Comment 13•24 years ago
|
||
Comment on attachment 82324 [details] [diff] [review]
Patch v2
r=fabian
Attachment #82324 -
Flags: review+
| Assignee | ||
Comment 14•24 years ago
|
||
Reassigning.
Assignee: jst → hwaara
Target Milestone: mozilla1.2alpha → ---
Comment 15•24 years ago
|
||
Comment on attachment 82324 [details] [diff] [review]
Patch v2
Ignore the return value from GetPresContext() and just check for a non-null
prescontext and return NS_OK if there's no prescontext. Not having a
prescontext is not an error case so we don't want to throw an exception in such
a case.
sr=jst with that change (upon checkin).
Attachment #82324 -
Flags: superreview+
| Assignee | ||
Comment 16•24 years ago
|
||
Final patch with jst's comments incorporated.
Attachment #82324 -
Attachment is obsolete: true
| Assignee | ||
Updated•24 years ago
|
Attachment #82549 -
Flags: superreview+
Attachment #82549 -
Flags: review+
| Assignee | ||
Comment 17•24 years ago
|
||
Fix checked in.
| Assignee | ||
Comment 18•24 years ago
|
||
Marking fixed too.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•