getComputedStyle was not implemented for text-align property; b=78709, r=harishd, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@93929 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
93639e5bd7
commit
8ed00123b0
@ -147,6 +147,9 @@ private:
|
||||
// List properties
|
||||
nsresult GetListStyleImage(nsIFrame *aFrame, nsIDOMCSSPrimitiveValue*& aValue);
|
||||
|
||||
// Text Properties
|
||||
nsresult GetTextAlign(nsIFrame *aFrame, nsIDOMCSSPrimitiveValue*& aValue);
|
||||
|
||||
nsresult GetBehavior(nsIFrame *aFrame, nsIDOMCSSPrimitiveValue*& aValue);
|
||||
|
||||
nsROCSSPrimitiveValue* GetROCSSPrimitiveValue();
|
||||
@ -435,6 +438,9 @@ nsComputedDOMStyle::GetPropertyCSSValue(const nsAReadableString& aPropertyName,
|
||||
case eCSSProperty_outline_color:
|
||||
rv = GetOutlineColor(frame, *getter_AddRefs(val)); break;
|
||||
|
||||
case eCSSProperty_text_align:
|
||||
rv = GetTextAlign(frame, *getter_AddRefs(val)); break;
|
||||
|
||||
// Z-Index property
|
||||
case eCSSProperty_z_index:
|
||||
rv = GetZIndex(frame, *getter_AddRefs(val)); break;
|
||||
@ -1227,6 +1233,28 @@ nsComputedDOMStyle::GetListStyleImage(nsIFrame *aFrame,
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),(void**)&aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetTextAlign(nsIFrame *aFrame,
|
||||
nsIDOMCSSPrimitiveValue*& aValue)
|
||||
{
|
||||
nsROCSSPrimitiveValue* val=GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
const nsStyleText* text=nsnull;
|
||||
GetStyleData(eStyleStruct_Text,(const nsStyleStruct*&)text,aFrame);
|
||||
|
||||
if(text) {
|
||||
const nsCString& align=
|
||||
nsCSSProps::SearchKeywordTable(text->mTextAlign,nsCSSProps::kTextAlignKTable);
|
||||
val->SetString(align);
|
||||
}
|
||||
else {
|
||||
val->SetString("start");
|
||||
}
|
||||
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),(void **)&aValue);
|
||||
}
|
||||
|
||||
#if 0
|
||||
NS_IMETHODIMP
|
||||
nsComputedDOMStyle::GetCaptionSide(nsAWritableString& aCaptionSide)
|
||||
|
||||
@ -147,6 +147,9 @@ private:
|
||||
// List properties
|
||||
nsresult GetListStyleImage(nsIFrame *aFrame, nsIDOMCSSPrimitiveValue*& aValue);
|
||||
|
||||
// Text Properties
|
||||
nsresult GetTextAlign(nsIFrame *aFrame, nsIDOMCSSPrimitiveValue*& aValue);
|
||||
|
||||
nsresult GetBehavior(nsIFrame *aFrame, nsIDOMCSSPrimitiveValue*& aValue);
|
||||
|
||||
nsROCSSPrimitiveValue* GetROCSSPrimitiveValue();
|
||||
@ -435,6 +438,9 @@ nsComputedDOMStyle::GetPropertyCSSValue(const nsAReadableString& aPropertyName,
|
||||
case eCSSProperty_outline_color:
|
||||
rv = GetOutlineColor(frame, *getter_AddRefs(val)); break;
|
||||
|
||||
case eCSSProperty_text_align:
|
||||
rv = GetTextAlign(frame, *getter_AddRefs(val)); break;
|
||||
|
||||
// Z-Index property
|
||||
case eCSSProperty_z_index:
|
||||
rv = GetZIndex(frame, *getter_AddRefs(val)); break;
|
||||
@ -1227,6 +1233,28 @@ nsComputedDOMStyle::GetListStyleImage(nsIFrame *aFrame,
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),(void**)&aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetTextAlign(nsIFrame *aFrame,
|
||||
nsIDOMCSSPrimitiveValue*& aValue)
|
||||
{
|
||||
nsROCSSPrimitiveValue* val=GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
const nsStyleText* text=nsnull;
|
||||
GetStyleData(eStyleStruct_Text,(const nsStyleStruct*&)text,aFrame);
|
||||
|
||||
if(text) {
|
||||
const nsCString& align=
|
||||
nsCSSProps::SearchKeywordTable(text->mTextAlign,nsCSSProps::kTextAlignKTable);
|
||||
val->SetString(align);
|
||||
}
|
||||
else {
|
||||
val->SetString("start");
|
||||
}
|
||||
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),(void **)&aValue);
|
||||
}
|
||||
|
||||
#if 0
|
||||
NS_IMETHODIMP
|
||||
nsComputedDOMStyle::GetCaptionSide(nsAWritableString& aCaptionSide)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user