added visibility style attribute
moved attributes from position to display struct
This commit is contained in:
@@ -52,7 +52,11 @@ NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
// Do not paint ourselves if we are a pseudo-frame
|
||||
if (PR_FALSE == IsPseudoFrame()) {
|
||||
if (PR_FALSE == IsPseudoFrame()) { // this trip isn't really necessary
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
PRIntn skipSides = GetSkipSides();
|
||||
nsStyleColor* color =
|
||||
(nsStyleColor*)mStyleContext->GetData(eStyleStruct_Color);
|
||||
@@ -63,6 +67,7 @@ NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
||||
aDirtyRect, mRect, *spacing, skipSides);
|
||||
}
|
||||
}
|
||||
|
||||
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
nsStyleColor* myColor =
|
||||
(nsStyleColor*)mStyleContext->GetData(eStyleStruct_Color);
|
||||
nsStyleSpacing* mySpacing =
|
||||
@@ -40,6 +44,7 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
|
||||
aDirtyRect, mRect, *myColor);
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
||||
aDirtyRect, mRect, *mySpacing, 0);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ AbsoluteFrame::~AbsoluteFrame()
|
||||
|
||||
nsIView* AbsoluteFrame::CreateView(nsIView* aContainingView,
|
||||
const nsRect& aRect,
|
||||
nsStylePosition* aPosition)
|
||||
nsStylePosition* aPosition,
|
||||
nsStyleDisplay* aDisplay)
|
||||
{
|
||||
nsIView* view;
|
||||
|
||||
@@ -81,22 +82,22 @@ nsIView* AbsoluteFrame::CreateView(nsIView* aContainingView,
|
||||
nsIScrollableView* scrollView = nsnull;
|
||||
nsresult result;
|
||||
nsViewClip clip = {0, 0, 0, 0};
|
||||
PRUint8 clipType = (aPosition->mClipFlags & NS_STYLE_CLIP_TYPE_MASK);
|
||||
PRUint8 clipType = (aDisplay->mClipFlags & NS_STYLE_CLIP_TYPE_MASK);
|
||||
nsViewClip* pClip = nsnull;
|
||||
|
||||
// Is there a clip rect specified?
|
||||
if (NS_STYLE_CLIP_RECT == clipType) {
|
||||
if ((NS_STYLE_CLIP_LEFT_AUTO & aPosition->mClipFlags) == 0) {
|
||||
clip.mLeft = aPosition->mClip.left;
|
||||
if ((NS_STYLE_CLIP_LEFT_AUTO & aDisplay->mClipFlags) == 0) {
|
||||
clip.mLeft = aDisplay->mClip.left;
|
||||
}
|
||||
if ((NS_STYLE_CLIP_RIGHT_AUTO & aPosition->mClipFlags) == 0) {
|
||||
clip.mRight = aPosition->mClip.right;
|
||||
if ((NS_STYLE_CLIP_RIGHT_AUTO & aDisplay->mClipFlags) == 0) {
|
||||
clip.mRight = aDisplay->mClip.right;
|
||||
}
|
||||
if ((NS_STYLE_CLIP_TOP_AUTO & aPosition->mClipFlags) == 0) {
|
||||
clip.mTop = aPosition->mClip.top;
|
||||
if ((NS_STYLE_CLIP_TOP_AUTO & aDisplay->mClipFlags) == 0) {
|
||||
clip.mTop = aDisplay->mClip.top;
|
||||
}
|
||||
if ((NS_STYLE_CLIP_BOTTOM_AUTO & aPosition->mClipFlags) == 0) {
|
||||
clip.mBottom = aPosition->mClip.bottom;
|
||||
if ((NS_STYLE_CLIP_BOTTOM_AUTO & aDisplay->mClipFlags) == 0) {
|
||||
clip.mBottom = aDisplay->mClip.bottom;
|
||||
}
|
||||
pClip = &clip;
|
||||
}
|
||||
@@ -285,7 +286,8 @@ NS_METHOD AbsoluteFrame::Reflow(nsIPresContext* aPresContext,
|
||||
ComputeViewBounds(containingRect, position, rect);
|
||||
|
||||
// Create a view for the frame
|
||||
nsIView* view = CreateView(containingView, rect, position);
|
||||
nsStyleDisplay* display = (nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
nsIView* view = CreateView(containingView, rect, position, display);
|
||||
NS_RELEASE(containingView);
|
||||
|
||||
mFrame->SetView(view);
|
||||
@@ -294,7 +296,7 @@ NS_METHOD AbsoluteFrame::Reflow(nsIPresContext* aPresContext,
|
||||
// Resize reflow the absolutely positioned element
|
||||
nsSize availSize(rect.width, rect.height);
|
||||
|
||||
if (NS_STYLE_OVERFLOW_VISIBLE == position->mOverflow) {
|
||||
if (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflow) {
|
||||
// Don't constrain the height since the container should be enlarged to
|
||||
// contain overflowing frames
|
||||
availSize.height = NS_UNCONSTRAINEDSIZE;
|
||||
@@ -309,7 +311,7 @@ NS_METHOD AbsoluteFrame::Reflow(nsIPresContext* aPresContext,
|
||||
// the desired size
|
||||
if ((eStyleUnit_Auto == position->mWidth.GetUnit()) ||
|
||||
((desiredSize.width > availSize.width) &&
|
||||
(NS_STYLE_OVERFLOW_VISIBLE == position->mOverflow))) {
|
||||
(NS_STYLE_OVERFLOW_VISIBLE == display->mOverflow))) {
|
||||
rect.width = desiredSize.width;
|
||||
}
|
||||
if (eStyleUnit_Auto == position->mHeight.GetUnit()) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "nsFrame.h"
|
||||
struct nsStylePosition;
|
||||
struct nsStyleDisplay;
|
||||
|
||||
// Implementation of a frame that's used as a placeholder for an absolutely
|
||||
// positioned frame
|
||||
@@ -58,7 +59,8 @@ protected:
|
||||
|
||||
nsIView* CreateView(nsIView* aContainingView,
|
||||
const nsRect& aRect,
|
||||
nsStylePosition* aPosition);
|
||||
nsStylePosition* aPosition,
|
||||
nsStyleDisplay* aDisplay);
|
||||
nsIFrame* GetContainingBlock();
|
||||
void ComputeViewBounds(const nsRect& aContainingInnerRect,
|
||||
nsStylePosition* aPosition,
|
||||
|
||||
@@ -98,6 +98,13 @@ NS_METHOD HRuleFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (PR_FALSE == disp->mVisible) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
float p2t = aPresContext.GetPixelsToTwips();
|
||||
nscoord thickness = nscoord(p2t * ((HRulePart*)mContent)->mThickness);
|
||||
|
||||
|
||||
@@ -52,7 +52,11 @@ NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
// Do not paint ourselves if we are a pseudo-frame
|
||||
if (PR_FALSE == IsPseudoFrame()) {
|
||||
if (PR_FALSE == IsPseudoFrame()) { // this trip isn't really necessary
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
PRIntn skipSides = GetSkipSides();
|
||||
nsStyleColor* color =
|
||||
(nsStyleColor*)mStyleContext->GetData(eStyleStruct_Color);
|
||||
@@ -63,6 +67,7 @@ NS_METHOD nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
||||
aDirtyRect, mRect, *spacing, skipSides);
|
||||
}
|
||||
}
|
||||
|
||||
PaintChildren(aPresContext, aRenderingContext, aDirtyRect);
|
||||
|
||||
|
||||
@@ -326,6 +326,10 @@ ImageFrame::Paint(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
// First paint background and borders
|
||||
nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect);
|
||||
|
||||
@@ -343,6 +347,7 @@ ImageFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsRect inner;
|
||||
GetInnerArea(&aPresContext, inner);
|
||||
aRenderingContext.DrawImage(image, inner);
|
||||
}
|
||||
|
||||
if (GetShowFrameBorders()) {
|
||||
nsIImageMap* map = GetImageMap();
|
||||
|
||||
@@ -32,6 +32,10 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
nsStyleColor* myColor =
|
||||
(nsStyleColor*)mStyleContext->GetData(eStyleStruct_Color);
|
||||
nsStyleSpacing* mySpacing =
|
||||
@@ -40,6 +44,7 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
|
||||
aDirtyRect, mRect, *myColor);
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,
|
||||
aDirtyRect, mRect, *mySpacing, 0);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,10 @@ NS_METHOD BulletFrame::Paint(nsIPresContext& aCX,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
nsStyleFont* myFont =
|
||||
(nsStyleFont*)mStyleContext->GetData(eStyleStruct_Font);
|
||||
nsStyleColor* myColor =
|
||||
@@ -122,6 +126,7 @@ NS_METHOD BulletFrame::Paint(nsIPresContext& aCX,
|
||||
break;
|
||||
}
|
||||
NS_RELEASE(fm);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -431,6 +431,10 @@ NS_METHOD TextFrame::Paint(nsIPresContext& aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsStyleDisplay* disp =
|
||||
(nsStyleDisplay*)mStyleContext->GetData(eStyleStruct_Display);
|
||||
|
||||
if (disp->mVisible) {
|
||||
// Get style data
|
||||
nsStyleColor* color =
|
||||
(nsStyleColor*)mStyleContext->GetData(eStyleStruct_Color);
|
||||
@@ -457,6 +461,7 @@ NS_METHOD TextFrame::Paint(nsIPresContext& aPresContext,
|
||||
aRenderingContext.SetColor(color->mBackgroundColor);
|
||||
PaintRegularText(aPresContext, aRenderingContext, aDirtyRect, onePixel, onePixel);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user