зеркало из https://github.com/mozilla/pjs.git
20603: In an HTML document, the body node should always be part of the
selection, because output needs to get style nodes on the body. r=sfraser
This commit is contained in:
Родитель
f19ca0df41
Коммит
b5d1582420
|
@ -3559,5 +3559,22 @@ nsHTMLDocument::GetForms(nsIDOMHTMLCollection** aForms)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsHTMLDocument::IsInSelection(nsIDOMSelection* aSelection,
|
||||
const nsIContent* aContent) const
|
||||
{
|
||||
// HTML document has to include body in the selection,
|
||||
// so that output can see style nodes on the body.
|
||||
nsIAtom* tag;
|
||||
nsresult rv = aContent->GetTag(tag);
|
||||
PRBool retval = (NS_SUCCEEDED(rv) && tag == nsHTMLAtoms::body);
|
||||
NS_IF_RELEASE(tag);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
return nsDocument::IsInSelection(aSelection, aContent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -133,6 +133,11 @@ public:
|
|||
*/
|
||||
NS_IMETHOD FindNext(const nsString &aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound);
|
||||
|
||||
/*
|
||||
* Like nsDocument::IsInSelection except it always includes the body node
|
||||
*/
|
||||
virtual PRBool IsInSelection(nsIDOMSelection* aSelection, const nsIContent *aContent) const;
|
||||
|
||||
protected:
|
||||
// Find/Search Method/Data member
|
||||
PRBool SearchBlock(BlockText & aBlockText,
|
||||
|
|
|
@ -3559,5 +3559,22 @@ nsHTMLDocument::GetForms(nsIDOMHTMLCollection** aForms)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsHTMLDocument::IsInSelection(nsIDOMSelection* aSelection,
|
||||
const nsIContent* aContent) const
|
||||
{
|
||||
// HTML document has to include body in the selection,
|
||||
// so that output can see style nodes on the body.
|
||||
nsIAtom* tag;
|
||||
nsresult rv = aContent->GetTag(tag);
|
||||
PRBool retval = (NS_SUCCEEDED(rv) && tag == nsHTMLAtoms::body);
|
||||
NS_IF_RELEASE(tag);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
return nsDocument::IsInSelection(aSelection, aContent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -133,6 +133,11 @@ public:
|
|||
*/
|
||||
NS_IMETHOD FindNext(const nsString &aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound);
|
||||
|
||||
/*
|
||||
* Like nsDocument::IsInSelection except it always includes the body node
|
||||
*/
|
||||
virtual PRBool IsInSelection(nsIDOMSelection* aSelection, const nsIContent *aContent) const;
|
||||
|
||||
protected:
|
||||
// Find/Search Method/Data member
|
||||
PRBool SearchBlock(BlockText & aBlockText,
|
||||
|
|
Загрузка…
Ссылка в новой задаче