зеркало из https://github.com/mozilla/pjs.git
Bug 480647 part 3 - Clean up nsHTMLCSSUtils::GenerateCSSDeclarationsFromHTMLStyle; r=ehsan
This commit is contained in:
Родитель
8a0ad5f175
Коммит
fffaab3b93
|
@ -853,77 +853,64 @@ nsHTMLCSSUtils::GenerateCSSDeclarationsFromHTMLStyle(dom::Element* aElement,
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aElement);
|
MOZ_ASSERT(aElement);
|
||||||
nsIAtom* tagName = aElement->Tag();
|
nsIAtom* tagName = aElement->Tag();
|
||||||
|
const nsHTMLCSSUtils::CSSEquivTable* equivTable = nsnull;
|
||||||
|
|
||||||
if (nsEditProperty::b == aHTMLProperty) {
|
if (nsEditProperty::b == aHTMLProperty) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, boldEquivTable, aValue, aGetOrRemoveRequest);
|
equivTable = boldEquivTable;
|
||||||
}
|
} else if (nsEditProperty::i == aHTMLProperty) {
|
||||||
else if (nsEditProperty::i == aHTMLProperty) {
|
equivTable = italicEquivTable;
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, italicEquivTable, aValue, aGetOrRemoveRequest);
|
} else if (nsEditProperty::u == aHTMLProperty) {
|
||||||
}
|
equivTable = underlineEquivTable;
|
||||||
else if (nsEditProperty::u == aHTMLProperty) {
|
} else if (nsEditProperty::strike == aHTMLProperty) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, underlineEquivTable, aValue, aGetOrRemoveRequest);
|
equivTable = strikeEquivTable;
|
||||||
}
|
} else if (nsEditProperty::tt == aHTMLProperty) {
|
||||||
else if (nsEditProperty::strike == aHTMLProperty) {
|
equivTable = ttEquivTable;
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, strikeEquivTable, aValue, aGetOrRemoveRequest);
|
} else if (aAttribute) {
|
||||||
}
|
|
||||||
else if (nsEditProperty::tt == aHTMLProperty) {
|
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, ttEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
else if (aAttribute) {
|
|
||||||
if (nsEditProperty::font == aHTMLProperty &&
|
if (nsEditProperty::font == aHTMLProperty &&
|
||||||
aAttribute->EqualsLiteral("color")) {
|
aAttribute->EqualsLiteral("color")) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, fontColorEquivTable, aValue, aGetOrRemoveRequest);
|
equivTable = fontColorEquivTable;
|
||||||
}
|
} else if (nsEditProperty::font == aHTMLProperty &&
|
||||||
else if (nsEditProperty::font == aHTMLProperty &&
|
aAttribute->EqualsLiteral("face")) {
|
||||||
aAttribute->EqualsLiteral("face")) {
|
equivTable = fontFaceEquivTable;
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, fontFaceEquivTable, aValue, aGetOrRemoveRequest);
|
} else if (aAttribute->EqualsLiteral("bgcolor")) {
|
||||||
}
|
equivTable = bgcolorEquivTable;
|
||||||
else if (aAttribute->EqualsLiteral("bgcolor")) {
|
} else if (aAttribute->EqualsLiteral("background")) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, bgcolorEquivTable, aValue, aGetOrRemoveRequest);
|
equivTable = backgroundImageEquivTable;
|
||||||
}
|
} else if (aAttribute->EqualsLiteral("text")) {
|
||||||
else if (aAttribute->EqualsLiteral("background")) {
|
equivTable = textColorEquivTable;
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, backgroundImageEquivTable, aValue, aGetOrRemoveRequest);
|
} else if (aAttribute->EqualsLiteral("border")) {
|
||||||
}
|
equivTable = borderEquivTable;
|
||||||
else if (aAttribute->EqualsLiteral("text")) {
|
} else if (aAttribute->EqualsLiteral("align")) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, textColorEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
else if (aAttribute->EqualsLiteral("border")) {
|
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, borderEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
else if (aAttribute->EqualsLiteral("align")) {
|
|
||||||
if (nsEditProperty::table == tagName) {
|
if (nsEditProperty::table == tagName) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, tableAlignEquivTable, aValue, aGetOrRemoveRequest);
|
equivTable = tableAlignEquivTable;
|
||||||
}
|
} else if (nsEditProperty::hr == tagName) {
|
||||||
else if (nsEditProperty::hr == tagName) {
|
equivTable = hrAlignEquivTable;
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, hrAlignEquivTable, aValue, aGetOrRemoveRequest);
|
} else if (nsEditProperty::legend == tagName ||
|
||||||
}
|
|
||||||
else if (nsEditProperty::legend == tagName ||
|
|
||||||
nsEditProperty::caption == tagName) {
|
nsEditProperty::caption == tagName) {
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, captionAlignEquivTable, aValue, aGetOrRemoveRequest);
|
equivTable = captionAlignEquivTable;
|
||||||
}
|
} else {
|
||||||
else {
|
equivTable = textAlignEquivTable;
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, textAlignEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
}
|
||||||
|
} else if (aAttribute->EqualsLiteral("valign")) {
|
||||||
|
equivTable = verticalAlignEquivTable;
|
||||||
|
} else if (aAttribute->EqualsLiteral("nowrap")) {
|
||||||
|
equivTable = nowrapEquivTable;
|
||||||
|
} else if (aAttribute->EqualsLiteral("width")) {
|
||||||
|
equivTable = widthEquivTable;
|
||||||
|
} else if (aAttribute->EqualsLiteral("height") ||
|
||||||
|
(nsEditProperty::hr == tagName &&
|
||||||
|
aAttribute->EqualsLiteral("size"))) {
|
||||||
|
equivTable = heightEquivTable;
|
||||||
|
} else if (aAttribute->EqualsLiteral("type") &&
|
||||||
|
(nsEditProperty::ol == tagName
|
||||||
|
|| nsEditProperty::ul == tagName
|
||||||
|
|| nsEditProperty::li == tagName)) {
|
||||||
|
equivTable = listStyleTypeEquivTable;
|
||||||
}
|
}
|
||||||
else if (aAttribute->EqualsLiteral("valign")) {
|
}
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, verticalAlignEquivTable, aValue, aGetOrRemoveRequest);
|
if (equivTable) {
|
||||||
}
|
BuildCSSDeclarations(cssPropertyArray, cssValueArray, equivTable,
|
||||||
else if (aAttribute->EqualsLiteral("nowrap")) {
|
aValue, aGetOrRemoveRequest);
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, nowrapEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
else if (aAttribute->EqualsLiteral("width")) {
|
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, widthEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
else if (aAttribute->EqualsLiteral("height") ||
|
|
||||||
(nsEditProperty::hr == tagName && aAttribute->EqualsLiteral("size"))) {
|
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, heightEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
else if (aAttribute->EqualsLiteral("type") &&
|
|
||||||
(nsEditProperty::ol == tagName
|
|
||||||
|| nsEditProperty::ul == tagName
|
|
||||||
|| nsEditProperty::li == tagName)) {
|
|
||||||
BuildCSSDeclarations(cssPropertyArray, cssValueArray, listStyleTypeEquivTable, aValue, aGetOrRemoveRequest);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче