Skip -moz-user-select=none only when copying. Follow-up to bug 166235. b=558726 r=roc

This commit is contained in:
Geoff Lankow 2010-04-14 16:55:16 +02:00
Родитель ea458d36b2
Коммит 96f669ed52
2 изменённых файлов: 12 добавлений и 10 удалений

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

@ -365,14 +365,16 @@ nsDocumentEncoder::SerializeToStringRecursive(nsIDOMNode* aNode,
if (!maybeFixedNode)
maybeFixedNode = aNode;
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
if (content){
nsIFrame* frame = content->GetPrimaryFrame();
if (frame) {
PRBool isSelectable;
frame->IsSelectable(&isSelectable, nsnull);
if (!isSelectable){
aDontSerializeRoot = PR_TRUE;
if (mIsCopying) {
nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
if (content){
nsIFrame* frame = content->GetPrimaryFrame();
if (frame) {
PRBool isSelectable;
frame->IsSelectable(&isSelectable, nsnull);
if (!isSelectable){
aDontSerializeRoot = PR_TRUE;
}
}
}
}

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

@ -30,8 +30,8 @@ var selection = window.getSelection();
// expected results for selection.toString()
var originalStrings = [
'This text should be copied.',
'This text should be copied.',
'This text should be copied.',
'This text should NOT be copied.',
'This text should NOT be copied.',
];
// expected results when selection is copied and HTML tags removed