From 4608d13850c2a37ecc59071cae6ab4d4d4f81ac2 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Wed, 26 May 1999 23:47:19 +0000 Subject: [PATCH] sync to nsIStyledContent API change add table style rule to table cell --- .../content/src/nsHTMLTableCellElement.cpp | 33 ++++++++++++++++++- .../content/src/nsHTMLTableCellElement.cpp | 33 ++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/content/html/content/src/nsHTMLTableCellElement.cpp b/content/html/content/src/nsHTMLTableCellElement.cpp index 722561f927d9..015932e2e028 100644 --- a/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/content/html/content/src/nsHTMLTableCellElement.cpp @@ -108,7 +108,7 @@ public: NS_IMPL_ICONTENT_USING_GENERIC(mInner) // nsIHTMLContent - NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner) + NS_IMPL_IHTMLCONTENT_USING_GENERIC2(mInner) protected: nsresult GetRow(nsIDOMHTMLTableRowElement** aRow); @@ -272,6 +272,37 @@ nsHTMLTableCellElement::SetCellIndex(PRInt32 aCellIndex) return NS_OK; } +NS_IMETHODIMP +nsHTMLTableCellElement::GetContentStyleRules(nsISupportsArray* aRules) +{ + // get table, add its rules too + nsIContent* row = nsnull; // XXX can we safely presume structure or do we need to QI on the way up? + if (NS_SUCCEEDED(GetParent(row)) && row) { + nsIContent* section = nsnull; + if (NS_SUCCEEDED(row->GetParent(section)) && section) { + nsIContent* table = nsnull; + if (NS_SUCCEEDED(section->GetParent(table)) && table) { + nsIStyledContent* styledTable = nsnull; + if (NS_SUCCEEDED(table->QueryInterface(kIStyledContentIID, (void**)&styledTable))) { + styledTable->GetContentStyleRules(aRules); + NS_RELEASE(styledTable); + } + NS_RELEASE(table); + } + NS_RELEASE(section); + } + NS_RELEASE(row); + } + return mInner.GetContentStyleRules(aRules); +} + +NS_IMETHODIMP +nsHTMLTableCellElement::GetInlineStyleRules(nsISupportsArray* aRules) +{ + return mInner.GetInlineStyleRules(aRules); +} + + NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr) NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Align, align) NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis) diff --git a/layout/html/content/src/nsHTMLTableCellElement.cpp b/layout/html/content/src/nsHTMLTableCellElement.cpp index 722561f927d9..015932e2e028 100644 --- a/layout/html/content/src/nsHTMLTableCellElement.cpp +++ b/layout/html/content/src/nsHTMLTableCellElement.cpp @@ -108,7 +108,7 @@ public: NS_IMPL_ICONTENT_USING_GENERIC(mInner) // nsIHTMLContent - NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner) + NS_IMPL_IHTMLCONTENT_USING_GENERIC2(mInner) protected: nsresult GetRow(nsIDOMHTMLTableRowElement** aRow); @@ -272,6 +272,37 @@ nsHTMLTableCellElement::SetCellIndex(PRInt32 aCellIndex) return NS_OK; } +NS_IMETHODIMP +nsHTMLTableCellElement::GetContentStyleRules(nsISupportsArray* aRules) +{ + // get table, add its rules too + nsIContent* row = nsnull; // XXX can we safely presume structure or do we need to QI on the way up? + if (NS_SUCCEEDED(GetParent(row)) && row) { + nsIContent* section = nsnull; + if (NS_SUCCEEDED(row->GetParent(section)) && section) { + nsIContent* table = nsnull; + if (NS_SUCCEEDED(section->GetParent(table)) && table) { + nsIStyledContent* styledTable = nsnull; + if (NS_SUCCEEDED(table->QueryInterface(kIStyledContentIID, (void**)&styledTable))) { + styledTable->GetContentStyleRules(aRules); + NS_RELEASE(styledTable); + } + NS_RELEASE(table); + } + NS_RELEASE(section); + } + NS_RELEASE(row); + } + return mInner.GetContentStyleRules(aRules); +} + +NS_IMETHODIMP +nsHTMLTableCellElement::GetInlineStyleRules(nsISupportsArray* aRules) +{ + return mInner.GetInlineStyleRules(aRules); +} + + NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr) NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Align, align) NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis)