Move handling of "dir" and "bdo" into ua.css so it doesn't get turned off when

author styles are disabled.  Bug 261361, patch by fantasai
<fantasai.bugs@inkedblade.net>, r=dbaron, sr=bzbarsky
This commit is contained in:
bzbarsky%mit.edu 2004-12-09 16:08:43 +00:00
Родитель a84fe5ad7b
Коммит 23bcd45fd7
3 изменённых файлов: 15 добавлений и 40 удалений

Просмотреть файл

@ -2743,20 +2743,7 @@ void
nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
if (aData->mSID == eStyleStruct_TextReset) {
if (aData->mTextData->mUnicodeBidi.GetUnit() == eCSSUnit_Null) {
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::dir);
if (value && value->Type() == nsAttrValue::eEnum)
aData->mTextData->mUnicodeBidi.SetIntValue(
NS_STYLE_UNICODE_BIDI_EMBED, eCSSUnit_Enumerated);
}
} else if (aData->mSID == eStyleStruct_Visibility) {
if (aData->mDisplayData->mDirection.GetUnit() == eCSSUnit_Null) {
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::dir);
if (value && value->Type() == nsAttrValue::eEnum)
aData->mDisplayData->mDirection.SetIntValue(value->GetEnumValue(),
eCSSUnit_Enumerated);
}
if (aData->mSID == eStyleStruct_Visibility) {
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::lang);
if (value && value->Type() == nsAttrValue::eString) {
aData->mDisplayData->mLang.SetStringValue(value->GetStringValue(),
@ -2769,7 +2756,6 @@ nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttribu
/* static */ const nsGenericHTMLElement::MappedAttributeEntry
nsGenericHTMLElement::sCommonAttributeMap[] = {
{ &nsHTMLAtoms::dir },
{ &nsHTMLAtoms::lang },
{ nsnull }
};

Просмотреть файл

@ -63,7 +63,6 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
};
@ -95,30 +94,6 @@ NS_HTML_CONTENT_INTERFACE_MAP_END
NS_IMPL_DOM_CLONENODE(nsHTMLSpanElement)
static void
BdoMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
if (aData->mSID == eStyleStruct_TextReset &&
aData->mTextData->mUnicodeBidi.GetUnit() == eCSSUnit_Null) {
aData->mTextData->mUnicodeBidi.SetIntValue(NS_STYLE_UNICODE_BIDI_OVERRIDE, eCSSUnit_Enumerated);
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP
nsHTMLSpanElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const
{
if (mNodeInfo->Equals(nsHTMLAtoms::bdo)) {
aMapRuleFunc = &BdoMapAttributesIntoRule;
}
else {
nsGenericHTMLElement::GetAttributeMappingFunction(aMapRuleFunc);
}
return NS_OK;
}
nsresult
nsHTMLSpanElement::GetInnerHTML(nsAString& aInnerHTML)
{

Просмотреть файл

@ -37,6 +37,20 @@
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
/* bidi */
[dir="rtl"] {
direction: rtl;
unicode-bidi: embed;
}
[dir="ltr"] {
direction: ltr;
unicode-bidi: embed;
}
bdo[dir] {
unicode-bidi: bidi-override;
}
/* blocks */
html, div, map, dt, isindex {