cmanske says that there is no need to get editorShell, it's always here...; b=91548, r=brade, sr=kin

This commit is contained in:
glazman%netscape.com 2002-01-29 09:08:08 +00:00
Родитель 9626570b63
Коммит 65bda09872
1 изменённых файлов: 32 добавлений и 37 удалений

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

@ -28,44 +28,39 @@ function BuildCSSAttributeTable()
// we can't trust DOM 2 ElementCSSInlineStyle because gElement can be
// outside of the document's tree
var styleAttr = gElement.getAttribute("style");
// we need the
var editorShell = window.opener.editorShell;
if (editorShell) {
editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell);
var editor = editorShell.editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
var styleRule = editor.ParseStyleAttrIntoCSSRule(styleAttr);
if (styleRule == undefined)
{
dump("Inline styles undefined\n");
return;
}
var style = styleRule.style;
var declLength = style.length;
if (declLength == undefined || declLength == 0)
{
if (declLength == undefined) {
dump("Failed to query the number of inline style declarations\n");
}
return;
}
if (declLength > 0)
{
var added = false;
for (i = 0; i < declLength; i++)
{
name = style.item(i);
value = style.getPropertyValue(name);
AddTreeItem( name, value, "CSSAList", CSSAttrs );
}
}
ClearCSSInputWidgets();
var editor = editorShell.editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
var styleRule = editor.ParseStyleAttrIntoCSSRule(styleAttr);
if (styleRule == undefined)
{
dump("Inline styles undefined\n");
return;
}
var style = styleRule.style;
var declLength = style.length;
if (declLength == undefined || declLength == 0)
{
if (declLength == undefined) {
dump("Failed to query the number of inline style declarations\n");
}
return;
}
if (declLength > 0)
{
var added = false;
for (i = 0; i < declLength; i++)
{
name = style.item(i);
value = style.getPropertyValue(name);
AddTreeItem( name, value, "CSSAList", CSSAttrs );
}
}
ClearCSSInputWidgets();
}
function onChangeCSSAttribute()