зеркало из https://github.com/mozilla/gecko-dev.git
#113663, clean up and improve support for frameborder and scrolling attributes on frame elements.
r=bz, sr=attinasi
This commit is contained in:
Родитель
98d8f3682b
Коммит
7550ac6b77
|
@ -2898,7 +2898,7 @@ static nsGenericHTMLElement::EnumTable kDivAlignTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static nsGenericHTMLElement::EnumTable kFrameborderQuirksTable[] = {
|
||||
static nsGenericHTMLElement::EnumTable kFrameborderTable[] = {
|
||||
{ "yes", NS_STYLE_FRAME_YES },
|
||||
{ "no", NS_STYLE_FRAME_NO },
|
||||
{ "1", NS_STYLE_FRAME_1 },
|
||||
|
@ -2906,13 +2906,7 @@ static nsGenericHTMLElement::EnumTable kFrameborderQuirksTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static nsGenericHTMLElement::EnumTable kFrameborderStandardTable[] = {
|
||||
{ "1", NS_STYLE_FRAME_1 },
|
||||
{ "0", NS_STYLE_FRAME_0 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static nsGenericHTMLElement::EnumTable kScrollingQuirksTable[] = {
|
||||
static nsGenericHTMLElement::EnumTable kScrollingTable[] = {
|
||||
{ "yes", NS_STYLE_FRAME_YES },
|
||||
{ "no", NS_STYLE_FRAME_NO },
|
||||
{ "on", NS_STYLE_FRAME_ON },
|
||||
|
@ -2923,13 +2917,6 @@ static nsGenericHTMLElement::EnumTable kScrollingQuirksTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static nsGenericHTMLElement::EnumTable kScrollingStandardTable[] = {
|
||||
{ "yes", NS_STYLE_FRAME_YES },
|
||||
{ "no", NS_STYLE_FRAME_NO },
|
||||
{ "auto", NS_STYLE_FRAME_AUTO },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static nsGenericHTMLElement::EnumTable kTableVAlignTable[] = {
|
||||
{ "top", NS_STYLE_VERTICAL_ALIGN_TOP },
|
||||
{ "middle", NS_STYLE_VERTICAL_ALIGN_MIDDLE },
|
||||
|
@ -3124,51 +3111,31 @@ nsGenericHTMLElement::ImageAttributeToString(nsIAtom* aAttribute,
|
|||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseFrameborderValue(PRBool aStandardMode,
|
||||
const nsAReadableString& aString,
|
||||
nsGenericHTMLElement::ParseFrameborderValue(const nsAReadableString& aString,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aStandardMode) {
|
||||
return ParseEnumValue(aString, kFrameborderStandardTable, aResult);
|
||||
} else {
|
||||
return ParseEnumValue(aString, kFrameborderQuirksTable, aResult);
|
||||
}
|
||||
return ParseEnumValue(aString, kFrameborderTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::FrameborderValueToString(PRBool aStandardMode,
|
||||
const nsHTMLValue& aValue,
|
||||
nsGenericHTMLElement::FrameborderValueToString(const nsHTMLValue& aValue,
|
||||
nsAWritableString& aResult)
|
||||
{
|
||||
if (aStandardMode) {
|
||||
return EnumValueToString(aValue, kFrameborderStandardTable, aResult);
|
||||
} else {
|
||||
return EnumValueToString(aValue, kFrameborderQuirksTable, aResult);
|
||||
}
|
||||
return EnumValueToString(aValue, kFrameborderTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseScrollingValue(PRBool aStandardMode,
|
||||
const nsAReadableString& aString,
|
||||
nsGenericHTMLElement::ParseScrollingValue(const nsAReadableString& aString,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aStandardMode) {
|
||||
return ParseEnumValue(aString, kScrollingStandardTable, aResult);
|
||||
} else {
|
||||
return ParseEnumValue(aString, kScrollingQuirksTable, aResult);
|
||||
}
|
||||
return ParseEnumValue(aString, kScrollingTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ScrollingValueToString(PRBool aStandardMode,
|
||||
const nsHTMLValue& aValue,
|
||||
nsGenericHTMLElement::ScrollingValueToString(const nsHTMLValue& aValue,
|
||||
nsAWritableString& aResult)
|
||||
{
|
||||
if (aStandardMode) {
|
||||
return EnumValueToString(aValue, kScrollingStandardTable, aResult);
|
||||
} else {
|
||||
return EnumValueToString(aValue, kScrollingQuirksTable, aResult);
|
||||
}
|
||||
return EnumValueToString(aValue, kScrollingTable, aResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -295,20 +295,16 @@ public:
|
|||
const nsHTMLValue& aValue,
|
||||
nsAWritableString& aResult);
|
||||
|
||||
static PRBool ParseFrameborderValue(PRBool aStandardMode,
|
||||
const nsAReadableString& aString,
|
||||
static PRBool ParseFrameborderValue(const nsAReadableString& aString,
|
||||
nsHTMLValue& aResult);
|
||||
|
||||
static PRBool FrameborderValueToString(PRBool aStandardMode,
|
||||
const nsHTMLValue& aValue,
|
||||
static PRBool FrameborderValueToString(const nsHTMLValue& aValue,
|
||||
nsAWritableString& aResult);
|
||||
|
||||
static PRBool ParseScrollingValue(PRBool aStandardMode,
|
||||
const nsAReadableString& aString,
|
||||
static PRBool ParseScrollingValue(const nsAReadableString& aString,
|
||||
nsHTMLValue& aResult);
|
||||
|
||||
static PRBool ScrollingValueToString(PRBool aStandardMode,
|
||||
const nsHTMLValue& aValue,
|
||||
static PRBool ScrollingValueToString(const nsHTMLValue& aValue,
|
||||
nsAWritableString& aResult);
|
||||
|
||||
nsresult ReparseStyleAttribute(void);
|
||||
|
|
|
@ -259,8 +259,7 @@ nsHTMLFrameElement::StringToAttribute(nsIAtom* aAttribute,
|
|||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
// XXX need to check for correct mode
|
||||
if (ParseFrameborderValue(PR_FALSE, aValue, aResult)) {
|
||||
if (ParseFrameborderValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +278,7 @@ nsHTMLFrameElement::StringToAttribute(nsIAtom* aAttribute,
|
|||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||
if (ParseScrollingValue(PR_FALSE, aValue, aResult)) {
|
||||
if (ParseScrollingValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -293,11 +292,11 @@ nsHTMLFrameElement::AttributeToString(nsIAtom* aAttribute,
|
|||
nsAWritableString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
FrameborderValueToString(PR_FALSE, aValue, aResult);
|
||||
FrameborderValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||
ScrollingValueToString(PR_FALSE, aValue, aResult);
|
||||
ScrollingValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,8 +172,7 @@ nsHTMLFrameSetElement::StringToAttribute(nsIAtom* aAttribute,
|
|||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
// XXX need to check for correct mode
|
||||
if (nsGenericHTMLElement::ParseFrameborderValue(PR_FALSE, aValue, aResult)) {
|
||||
if (nsGenericHTMLElement::ParseFrameborderValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -191,8 +190,7 @@ nsHTMLFrameSetElement::AttributeToString(nsIAtom* aAttribute,
|
|||
nsAWritableString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
// XXX need to check for correct mode
|
||||
nsGenericHTMLElement::FrameborderValueToString(PR_FALSE, aValue, aResult);
|
||||
nsGenericHTMLElement::FrameborderValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
|
||||
|
|
|
@ -280,12 +280,12 @@ nsHTMLIFrameElement::StringToAttribute(nsIAtom* aAttribute,
|
|||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
if (ParseFrameborderValue(!InNavQuirksMode(mDocument), aValue, aResult)) {
|
||||
if (ParseFrameborderValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||
if (ParseScrollingValue(PR_TRUE, aValue, aResult)) {
|
||||
if (ParseScrollingValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -304,11 +304,11 @@ nsHTMLIFrameElement::AttributeToString(nsIAtom* aAttribute,
|
|||
nsAWritableString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
FrameborderValueToString(PR_TRUE, aValue, aResult);
|
||||
FrameborderValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||
ScrollingValueToString(PR_TRUE, aValue, aResult);
|
||||
ScrollingValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::align) {
|
||||
|
|
|
@ -252,7 +252,7 @@ public:
|
|||
PRBool GetURL(nsIContent* aContent, nsString& aResult);
|
||||
PRBool GetName(nsIContent* aContent, nsString& aResult);
|
||||
PRInt32 GetScrolling(nsIContent* aContent);
|
||||
nsFrameborder GetFrameBorder(PRBool aStandardMode);
|
||||
nsFrameborder GetFrameBorder();
|
||||
PRInt32 GetMarginWidth(nsIPresContext* aPresContext, nsIContent* aContent);
|
||||
PRInt32 GetMarginHeight(nsIPresContext* aPresContext, nsIContent* aContent);
|
||||
|
||||
|
@ -775,7 +775,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetScrolling(nsIContent* aContent)
|
|||
return returnValue;
|
||||
}
|
||||
|
||||
nsFrameborder nsHTMLFrameInnerFrame::GetFrameBorder(PRBool aStandardMode)
|
||||
nsFrameborder nsHTMLFrameInnerFrame::GetFrameBorder()
|
||||
{
|
||||
nsFrameborder rv = eFrameborder_Notset;
|
||||
nsresult res = NS_OK;
|
||||
|
@ -784,22 +784,17 @@ nsFrameborder nsHTMLFrameInnerFrame::GetFrameBorder(PRBool aStandardMode)
|
|||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (content->GetHTMLAttribute(nsHTMLAtoms::frameborder, value))) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
PRInt32 intValue;
|
||||
intValue = value.GetIntValue();
|
||||
if (!aStandardMode) {
|
||||
if (NS_STYLE_FRAME_YES == intValue) {
|
||||
switch (value.GetIntValue())
|
||||
{
|
||||
case NS_STYLE_FRAME_1:
|
||||
case NS_STYLE_FRAME_YES:
|
||||
rv = eFrameborder_Yes;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_NO == intValue) {
|
||||
break;
|
||||
|
||||
case NS_STYLE_FRAME_0:
|
||||
case NS_STYLE_FRAME_NO:
|
||||
rv = eFrameborder_No;
|
||||
}
|
||||
} else {
|
||||
if (NS_STYLE_FRAME_0 == intValue) {
|
||||
rv = eFrameborder_No;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_1 == intValue) {
|
||||
rv = eFrameborder_Yes;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,7 +358,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
nsCOMPtr<nsIPresShell> shell;
|
||||
aPresContext->GetShell(getter_AddRefs(shell));
|
||||
|
||||
nsFrameborder frameborder = GetFrameBorder(PR_FALSE);
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
PRInt32 borderWidth = GetBorderWidth(aPresContext, PR_FALSE);
|
||||
nscolor borderColor = GetBorderColor();
|
||||
|
||||
|
@ -404,7 +404,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
|
||||
aPresContext->ResolveStyleContextFor(child, mStyleContext,
|
||||
PR_FALSE, getter_AddRefs(kidSC));
|
||||
if (nsHTMLAtoms::frameset == tag.get()) {
|
||||
if (nsHTMLAtoms::frameset == tag) {
|
||||
result = NS_NewHTMLFramesetFrame(shell, &frame);
|
||||
|
||||
mChildTypes[mChildCount] = FRAMESET;
|
||||
|
@ -421,7 +421,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
|
||||
mChildTypes[mChildCount] = FRAME;
|
||||
|
||||
mChildFrameborder[mChildCount] = GetFrameBorder(child, PR_FALSE);
|
||||
mChildFrameborder[mChildCount] = GetFrameBorder(child);
|
||||
mChildBorderColors[mChildCount].Set(GetBorderColor(child));
|
||||
}
|
||||
|
||||
|
@ -627,7 +627,7 @@ PRInt32 nsHTMLFramesetFrame::GetBorderWidth(nsIPresContext* aPresContext,
|
|||
PRBool forcing = mForceFrameResizability && aTakeForcingIntoAccount;
|
||||
|
||||
if (!forcing) {
|
||||
nsFrameborder frameborder = GetFrameBorder(PR_FALSE);
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
if (frameborder == eFrameborder_No) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1017,28 +1017,23 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
}
|
||||
|
||||
static
|
||||
nsFrameborder GetFrameBorderHelper(nsIHTMLContent* aContent,
|
||||
PRBool aStandardMode)
|
||||
nsFrameborder GetFrameBorderHelper(nsIHTMLContent* aContent)
|
||||
{
|
||||
if (nsnull != aContent) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetHTMLAttribute(nsHTMLAtoms::frameborder, value))) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
PRInt32 intValue;
|
||||
intValue = value.GetIntValue();
|
||||
if (!aStandardMode) {
|
||||
if (NS_STYLE_FRAME_YES == intValue) {
|
||||
intValue = NS_STYLE_FRAME_1;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_NO == intValue) {
|
||||
intValue = NS_STYLE_FRAME_0;
|
||||
}
|
||||
}
|
||||
if (NS_STYLE_FRAME_0 == intValue) {
|
||||
return eFrameborder_No;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_1 == intValue) {
|
||||
return eFrameborder_Yes;
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
switch (value.GetIntValue())
|
||||
{
|
||||
case NS_STYLE_FRAME_YES:
|
||||
case NS_STYLE_FRAME_1:
|
||||
return eFrameborder_Yes;
|
||||
break;
|
||||
|
||||
case NS_STYLE_FRAME_NO:
|
||||
case NS_STYLE_FRAME_0:
|
||||
return eFrameborder_No;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1046,13 +1041,13 @@ nsFrameborder GetFrameBorderHelper(nsIHTMLContent* aContent,
|
|||
return eFrameborder_Notset;
|
||||
}
|
||||
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(PRBool aStandardMode)
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder()
|
||||
{
|
||||
nsFrameborder result = eFrameborder_Notset;
|
||||
nsIHTMLContent* content = nsnull;
|
||||
mContent->QueryInterface(kIHTMLContentIID, (void**) &content);
|
||||
if (nsnull != content) {
|
||||
result = GetFrameBorderHelper(content, aStandardMode);
|
||||
if (content) {
|
||||
result = GetFrameBorderHelper(content);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
if (eFrameborder_Notset == result) {
|
||||
|
@ -1061,18 +1056,17 @@ nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(PRBool aStandardMode)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(nsIContent* aContent,
|
||||
PRBool aStandardMode)
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(nsIContent* aContent)
|
||||
{
|
||||
nsFrameborder result = eFrameborder_Notset;
|
||||
nsIHTMLContent* content = nsnull;
|
||||
aContent->QueryInterface(kIHTMLContentIID, (void**) &content);
|
||||
if (nsnull != content) {
|
||||
result = GetFrameBorderHelper(content, aStandardMode);
|
||||
result = GetFrameBorderHelper(content);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
if (eFrameborder_Notset == result) {
|
||||
return GetFrameBorder(aStandardMode);
|
||||
return GetFrameBorder();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1180,7 +1174,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
|
|||
PRBool* horBordersVis = nsnull; // horizontal borders visibility
|
||||
nscolor* horBorderColors = nsnull;
|
||||
nscolor borderColor = GetBorderColor();
|
||||
nsFrameborder frameborder = GetFrameBorder(PR_FALSE);
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
|
||||
if (firstTime) {
|
||||
verBordersVis = new PRBool[mNumCols];
|
||||
|
|
|
@ -219,9 +219,9 @@ protected:
|
|||
|
||||
void SetParentBorderColor(nscolor aColor) { mParentBorderColor = aColor; }
|
||||
|
||||
nsFrameborder GetFrameBorder(PRBool aStandardMode);
|
||||
nsFrameborder GetFrameBorder();
|
||||
|
||||
nsFrameborder GetFrameBorder(nsIContent* aContent, PRBool aStandardMode);
|
||||
nsFrameborder GetFrameBorder(nsIContent* aContent);
|
||||
|
||||
nscolor GetBorderColor();
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ public:
|
|||
PRBool GetURL(nsIContent* aContent, nsString& aResult);
|
||||
PRBool GetName(nsIContent* aContent, nsString& aResult);
|
||||
PRInt32 GetScrolling(nsIContent* aContent);
|
||||
nsFrameborder GetFrameBorder(PRBool aStandardMode);
|
||||
nsFrameborder GetFrameBorder();
|
||||
PRInt32 GetMarginWidth(nsIPresContext* aPresContext, nsIContent* aContent);
|
||||
PRInt32 GetMarginHeight(nsIPresContext* aPresContext, nsIContent* aContent);
|
||||
|
||||
|
@ -775,7 +775,7 @@ PRInt32 nsHTMLFrameInnerFrame::GetScrolling(nsIContent* aContent)
|
|||
return returnValue;
|
||||
}
|
||||
|
||||
nsFrameborder nsHTMLFrameInnerFrame::GetFrameBorder(PRBool aStandardMode)
|
||||
nsFrameborder nsHTMLFrameInnerFrame::GetFrameBorder()
|
||||
{
|
||||
nsFrameborder rv = eFrameborder_Notset;
|
||||
nsresult res = NS_OK;
|
||||
|
@ -784,22 +784,17 @@ nsFrameborder nsHTMLFrameInnerFrame::GetFrameBorder(PRBool aStandardMode)
|
|||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (content->GetHTMLAttribute(nsHTMLAtoms::frameborder, value))) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
PRInt32 intValue;
|
||||
intValue = value.GetIntValue();
|
||||
if (!aStandardMode) {
|
||||
if (NS_STYLE_FRAME_YES == intValue) {
|
||||
switch (value.GetIntValue())
|
||||
{
|
||||
case NS_STYLE_FRAME_1:
|
||||
case NS_STYLE_FRAME_YES:
|
||||
rv = eFrameborder_Yes;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_NO == intValue) {
|
||||
break;
|
||||
|
||||
case NS_STYLE_FRAME_0:
|
||||
case NS_STYLE_FRAME_NO:
|
||||
rv = eFrameborder_No;
|
||||
}
|
||||
} else {
|
||||
if (NS_STYLE_FRAME_0 == intValue) {
|
||||
rv = eFrameborder_No;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_1 == intValue) {
|
||||
rv = eFrameborder_Yes;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,7 +358,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
nsCOMPtr<nsIPresShell> shell;
|
||||
aPresContext->GetShell(getter_AddRefs(shell));
|
||||
|
||||
nsFrameborder frameborder = GetFrameBorder(PR_FALSE);
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
PRInt32 borderWidth = GetBorderWidth(aPresContext, PR_FALSE);
|
||||
nscolor borderColor = GetBorderColor();
|
||||
|
||||
|
@ -404,7 +404,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
|
||||
aPresContext->ResolveStyleContextFor(child, mStyleContext,
|
||||
PR_FALSE, getter_AddRefs(kidSC));
|
||||
if (nsHTMLAtoms::frameset == tag.get()) {
|
||||
if (nsHTMLAtoms::frameset == tag) {
|
||||
result = NS_NewHTMLFramesetFrame(shell, &frame);
|
||||
|
||||
mChildTypes[mChildCount] = FRAMESET;
|
||||
|
@ -421,7 +421,7 @@ nsHTMLFramesetFrame::Init(nsIPresContext* aPresContext,
|
|||
|
||||
mChildTypes[mChildCount] = FRAME;
|
||||
|
||||
mChildFrameborder[mChildCount] = GetFrameBorder(child, PR_FALSE);
|
||||
mChildFrameborder[mChildCount] = GetFrameBorder(child);
|
||||
mChildBorderColors[mChildCount].Set(GetBorderColor(child));
|
||||
}
|
||||
|
||||
|
@ -627,7 +627,7 @@ PRInt32 nsHTMLFramesetFrame::GetBorderWidth(nsIPresContext* aPresContext,
|
|||
PRBool forcing = mForceFrameResizability && aTakeForcingIntoAccount;
|
||||
|
||||
if (!forcing) {
|
||||
nsFrameborder frameborder = GetFrameBorder(PR_FALSE);
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
if (frameborder == eFrameborder_No) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1017,28 +1017,23 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
}
|
||||
|
||||
static
|
||||
nsFrameborder GetFrameBorderHelper(nsIHTMLContent* aContent,
|
||||
PRBool aStandardMode)
|
||||
nsFrameborder GetFrameBorderHelper(nsIHTMLContent* aContent)
|
||||
{
|
||||
if (nsnull != aContent) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetHTMLAttribute(nsHTMLAtoms::frameborder, value))) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
PRInt32 intValue;
|
||||
intValue = value.GetIntValue();
|
||||
if (!aStandardMode) {
|
||||
if (NS_STYLE_FRAME_YES == intValue) {
|
||||
intValue = NS_STYLE_FRAME_1;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_NO == intValue) {
|
||||
intValue = NS_STYLE_FRAME_0;
|
||||
}
|
||||
}
|
||||
if (NS_STYLE_FRAME_0 == intValue) {
|
||||
return eFrameborder_No;
|
||||
}
|
||||
else if (NS_STYLE_FRAME_1 == intValue) {
|
||||
return eFrameborder_Yes;
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
switch (value.GetIntValue())
|
||||
{
|
||||
case NS_STYLE_FRAME_YES:
|
||||
case NS_STYLE_FRAME_1:
|
||||
return eFrameborder_Yes;
|
||||
break;
|
||||
|
||||
case NS_STYLE_FRAME_NO:
|
||||
case NS_STYLE_FRAME_0:
|
||||
return eFrameborder_No;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1046,13 +1041,13 @@ nsFrameborder GetFrameBorderHelper(nsIHTMLContent* aContent,
|
|||
return eFrameborder_Notset;
|
||||
}
|
||||
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(PRBool aStandardMode)
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder()
|
||||
{
|
||||
nsFrameborder result = eFrameborder_Notset;
|
||||
nsIHTMLContent* content = nsnull;
|
||||
mContent->QueryInterface(kIHTMLContentIID, (void**) &content);
|
||||
if (nsnull != content) {
|
||||
result = GetFrameBorderHelper(content, aStandardMode);
|
||||
if (content) {
|
||||
result = GetFrameBorderHelper(content);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
if (eFrameborder_Notset == result) {
|
||||
|
@ -1061,18 +1056,17 @@ nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(PRBool aStandardMode)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(nsIContent* aContent,
|
||||
PRBool aStandardMode)
|
||||
nsFrameborder nsHTMLFramesetFrame::GetFrameBorder(nsIContent* aContent)
|
||||
{
|
||||
nsFrameborder result = eFrameborder_Notset;
|
||||
nsIHTMLContent* content = nsnull;
|
||||
aContent->QueryInterface(kIHTMLContentIID, (void**) &content);
|
||||
if (nsnull != content) {
|
||||
result = GetFrameBorderHelper(content, aStandardMode);
|
||||
result = GetFrameBorderHelper(content);
|
||||
NS_RELEASE(content);
|
||||
}
|
||||
if (eFrameborder_Notset == result) {
|
||||
return GetFrameBorder(aStandardMode);
|
||||
return GetFrameBorder();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1180,7 +1174,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext* aPresContext,
|
|||
PRBool* horBordersVis = nsnull; // horizontal borders visibility
|
||||
nscolor* horBorderColors = nsnull;
|
||||
nscolor borderColor = GetBorderColor();
|
||||
nsFrameborder frameborder = GetFrameBorder(PR_FALSE);
|
||||
nsFrameborder frameborder = GetFrameBorder();
|
||||
|
||||
if (firstTime) {
|
||||
verBordersVis = new PRBool[mNumCols];
|
||||
|
|
|
@ -219,9 +219,9 @@ protected:
|
|||
|
||||
void SetParentBorderColor(nscolor aColor) { mParentBorderColor = aColor; }
|
||||
|
||||
nsFrameborder GetFrameBorder(PRBool aStandardMode);
|
||||
nsFrameborder GetFrameBorder();
|
||||
|
||||
nsFrameborder GetFrameBorder(nsIContent* aContent, PRBool aStandardMode);
|
||||
nsFrameborder GetFrameBorder(nsIContent* aContent);
|
||||
|
||||
nscolor GetBorderColor();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче