mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-07 11:56:51 +00:00
Bug: 156203(copy/paste doesn't always copy numbers/letters in <OL>)
Patch: t_mutreja@yahoo.com, r=akkana, sr=jst, a=asa.
This commit is contained in:
parent
6ee82128ba
commit
5594f693c7
@ -680,7 +680,7 @@ nsPlainTextSerializer::DoOpenContainer(PRInt32 aTag)
|
||||
mIndent += kIndentSizeList; // see ul
|
||||
}
|
||||
else if (type == eHTMLTag_li) {
|
||||
if (mTagStackIndex > 1 && mTagStack[mTagStackIndex-2] == eHTMLTag_ol) {
|
||||
if (mTagStackIndex > 1 && IsInOL()) {
|
||||
if (mOLStackIndex > 0) {
|
||||
nsAutoString valueAttr;
|
||||
if(NS_SUCCEEDED(GetAttributeValue(nsHTMLAtoms::value, valueAttr))){
|
||||
@ -1833,6 +1833,26 @@ nsPlainTextSerializer::IsInPre()
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is required only to indentify LI's inside OL.
|
||||
* Returns TRUE if we are inside an OL tag and FALSE otherwise.
|
||||
*/
|
||||
PRBool
|
||||
nsPlainTextSerializer::IsInOL()
|
||||
{
|
||||
PRInt32 i = mTagStackIndex;
|
||||
while(--i >= 0) {
|
||||
if(mTagStack[i] == eHTMLTag_ol)
|
||||
return PR_TRUE;
|
||||
if (mTagStack[i] == eHTMLTag_ul) {
|
||||
// If a UL is reached first, LI belongs the UL nested in OL.
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
// We may reach here for orphan LI's.
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
@return 0 = no header, 1 = h1, ..., 6 = h6
|
||||
*/
|
||||
|
@ -146,6 +146,7 @@ protected:
|
||||
PRBool IsBlockLevel(PRInt32 aId);
|
||||
PRBool IsContainer(PRInt32 aId);
|
||||
PRBool IsInPre();
|
||||
PRBool IsInOL();
|
||||
PRBool IsCurrentNodeConverted();
|
||||
nsresult GetIdForContent(nsIContent* aContent, PRInt32* aID);
|
||||
nsresult GetParserService(nsIParserService** aParserService);
|
||||
|
Loading…
Reference in New Issue
Block a user