Fixes for the mouseover toolbar button problem. Approved by Chris.

This commit is contained in:
hyatt%netscape.com 1999-03-18 21:18:00 +00:00
parent 2a2e262462
commit f015e3ae42
10 changed files with 53 additions and 53 deletions

View File

@ -2589,25 +2589,11 @@ RDFElementImpl::GetInlineStyleRule(nsIStyleRule*& aResult)
NS_IMETHODIMP
RDFElementImpl::GetStyleHintForAttributeChange(const nsIAtom* aAttribute, PRInt32 *aHint) const
{
*aHint = NS_STYLE_HINT_REFLOW;
*aHint = NS_STYLE_HINT_UNKNOWN;
if (mNameSpaceID == kNameSpaceID_XUL)
{
// We are a XUL tag and need to specify a style hint.
if (!mTag)
return NS_OK;
nsString tagName;
mTag->ToString(tagName);
nsString attributeName;
aAttribute->ToString(attributeName);
if (tagName == "progressmeter")
{
// Give hints for the values that should only involve a content change
if (attributeName == "value" || attributeName == "mode")
*aHint = NS_STYLE_HINT_CONTENT;
}
*aHint = NS_STYLE_HINT_CONTENT;
}
return NS_OK;

View File

@ -362,7 +362,7 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
if (eFramePaintLayer_Overlay == aWhichLayer)
{
if (mOutlineStyle) {
if /*(mOutlineStyle) */ (PR_FALSE) {
GetButtonOutlineRect(aRect, rect);

View File

@ -362,7 +362,7 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
if (eFramePaintLayer_Overlay == aWhichLayer)
{
if (mOutlineStyle) {
if /*(mOutlineStyle) */ (PR_FALSE) {
GetButtonOutlineRect(aRect, rect);

View File

@ -184,6 +184,23 @@ NS_NewTitledButtonFrame ( nsIFrame*& aNewFrame )
} // NS_NewTitledButtonFrame
NS_IMETHODIMP
nsTitledButtonFrame::AttributeChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsIAtom* aAttribute,
PRInt32 aHint)
{
mNeedsLayout = PR_TRUE;
UpdateAttributes(*aPresContext);
// redraw
nsRect frameRect;
GetRect(frameRect);
nsRect rect(0,0,frameRect.width, frameRect.height);
Invalidate(rect, PR_TRUE);
return NS_OK;
}
nsTitledButtonFrame::nsTitledButtonFrame()
{
mTitle = "";
@ -688,8 +705,6 @@ nsTitledButtonFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
UpdateAttributes(aPresContext);
mNeedsLayout = PR_TRUE;
nsresult result = nsLeafFrame::Reflow(aPresContext, aMetrics, aReflowState, aStatus);
mRenderer.AddFocusBordersAndPadding(aPresContext, aReflowState, aMetrics, mBorderPadding);

View File

@ -56,6 +56,11 @@ public:
nsIStyleContext* aContext,
nsIFrame* asPrevInFlow);
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD ReResolveStyleContext ( nsIPresContext* aPresContext,
nsIStyleContext* aParentContext) ;

View File

@ -304,3 +304,19 @@ void nsTreeCellFrame::Hover(nsIPresContext& aPresContext, PRBool isHover, PRBool
NS_IF_RELEASE(pParentContent);
}
// XXX This method will go away.
NS_IMETHODIMP
nsTreeCellFrame::AttributeChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsIAtom* aAttribute,
PRInt32 aHint)
{
// redraw
nsRect frameRect;
GetRect(frameRect);
nsRect rect(0, 0, frameRect.width, frameRect.height);
Invalidate(rect, PR_TRUE);
return NS_OK;
}

View File

@ -44,6 +44,12 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
AttributeChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsIAtom* aAttribute,
PRInt32 aHint);
void Select(nsIPresContext& presContext, PRBool isSelected, PRBool notifyForReflow = PR_TRUE);
void Hover(nsIPresContext& presContext, PRBool isHover, PRBool notifyForReflow = PR_TRUE);

View File

@ -2589,25 +2589,11 @@ RDFElementImpl::GetInlineStyleRule(nsIStyleRule*& aResult)
NS_IMETHODIMP
RDFElementImpl::GetStyleHintForAttributeChange(const nsIAtom* aAttribute, PRInt32 *aHint) const
{
*aHint = NS_STYLE_HINT_REFLOW;
*aHint = NS_STYLE_HINT_UNKNOWN;
if (mNameSpaceID == kNameSpaceID_XUL)
{
// We are a XUL tag and need to specify a style hint.
if (!mTag)
return NS_OK;
nsString tagName;
mTag->ToString(tagName);
nsString attributeName;
aAttribute->ToString(attributeName);
if (tagName == "progressmeter")
{
// Give hints for the values that should only involve a content change
if (attributeName == "value" || attributeName == "mode")
*aHint = NS_STYLE_HINT_CONTENT;
}
*aHint = NS_STYLE_HINT_CONTENT;
}
return NS_OK;

View File

@ -2589,25 +2589,11 @@ RDFElementImpl::GetInlineStyleRule(nsIStyleRule*& aResult)
NS_IMETHODIMP
RDFElementImpl::GetStyleHintForAttributeChange(const nsIAtom* aAttribute, PRInt32 *aHint) const
{
*aHint = NS_STYLE_HINT_REFLOW;
*aHint = NS_STYLE_HINT_UNKNOWN;
if (mNameSpaceID == kNameSpaceID_XUL)
{
// We are a XUL tag and need to specify a style hint.
if (!mTag)
return NS_OK;
nsString tagName;
mTag->ToString(tagName);
nsString attributeName;
aAttribute->ToString(attributeName);
if (tagName == "progressmeter")
{
// Give hints for the values that should only involve a content change
if (attributeName == "value" || attributeName == "mode")
*aHint = NS_STYLE_HINT_CONTENT;
}
*aHint = NS_STYLE_HINT_CONTENT;
}
return NS_OK;

View File

@ -54,7 +54,7 @@ treehead treeitem treecell {
padding-left: 4px;
}
treeitem[selected="true"] > treecell {
treecell[selectedcell] {
background-color: yellow;
}