Closed
Bug 556694
Opened 15 years ago
Closed 15 years ago
Selection color isn't reverted when input field is specified only background-color
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a5
People
(Reporter: masayuki, Assigned: masayuki)
References
(Depends on 1 open bug, )
Details
(Keywords: regression)
Attachments
(1 file, 3 obsolete files)
10.49 KB,
patch
|
Details | Diff | Splinter Review |
This is regression of bug 472410. See bug 472410 comment 5 and later.
I'll post the patch.
Assignee | ||
Updated•15 years ago
|
Summary: Selection color isn't reverted when input field only specified background-color → Selection color isn't reverted when input field is specified only background-color
Assignee | ||
Comment 1•15 years ago
|
||
Assignee | ||
Comment 2•15 years ago
|
||
Should check nsIFrame::IsThemed().
Attachment #437507 -
Attachment is obsolete: true
Attachment #437620 -
Flags: review?(dbaron)
Why do you check mAppearance on one element, and then IsThemed on it and all its ancestors?
I'm a bit concerned about the ancestor check too; something that's a container for arbitrary content can be themed (e.g., toolbox, toolbar, window, dialog, the various vista toolboxes). Behaving differently if an arbitrary ancestor is themed seems wrong.
Also, I don't understand from the summary what the bug that you're fixing is. Could you explain?
Attachment #437620 -
Flags: review?(dbaron) → review-
(In reply to comment #3)
> Why do you check mAppearance on one element, and then IsThemed on it and all
> its ancestors?
>
> I'm a bit concerned about the ancestor check too; something that's a container
> for arbitrary content can be themed (e.g., toolbox, toolbar, window, dialog,
> the various vista toolboxes). Behaving differently if an arbitrary ancestor is
> themed seems wrong.
Er, sorry, never mind this part; I see what the code is doing now.
Instead of this, I think the changes in bug 472410 to FindNonTransparentBackground are the wrong approach: FindNonTransparentBackground should take a frame as an argument, walk up the frame tree (using nsLayoutUtils::GetParentOrPlaceholderFor), and return a frame. This allows FindNonTransparentBackground to also check IsThemed() rather than just mAppearance. And then you don't need the weird loop to redo the work that FindNonTransparentBackground already did.
(In reply to comment #5)
> frame tree (using nsLayoutUtils::GetParentOrPlaceholderFor), and return a
Actually, it should just use nsIFrame::GetParent. The current behavior of walking the style context tree rather than the frame tree is incorrect for what FindNonTransparentBackground is doing. That changes what the function does, but for the better.
Assignee | ||
Comment 7•15 years ago
|
||
Thank you. Seems it's better to use nsLayoutUtils::GetParentOrPlaceholderFor().
Attachment #437620 -
Attachment is obsolete: true
Attachment #437743 -
Flags: review?(dbaron)
Attachment #437743 -
Flags: review?(dbaron) → review+
Comment on attachment 437743 [details] [diff] [review]
Patch v2.0
>diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp
>+ const nsStyleBackground* bg =
>+ frame->GetStyleContext()->GetStyleBackground();
This can be simplified to frame->GetStyleBackground().
>diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp
>+ bgFrame->GetStyleContext()->
>+ GetVisitedDependentColor(eCSSProperty_background_color);
This can just be bgFrame->GetVisitedDependentColor(...).
>diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
>+ mTableBgColor = bgFrame->GetStyleContext()->GetStyleBackground();
And this can just be bgFrame->GetStyleBackground().
r=dbaron with that
Assignee | ||
Comment 9•15 years ago
|
||
thank you, dbaron!
Attachment #437743 -
Attachment is obsolete: true
Assignee | ||
Comment 10•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in
before you can comment on or make changes to this bug.
Description
•