зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a84fe5ad7b
Коммит
23bcd45fd7
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче