зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1151873 - Stop forcing text/plain-only content being copied to the clipboard when an ancestor of the selected node has significant whitespace; r=roc
When fixing bug 116083, I didn't understand the purpose of the original code correctly. Setting mIsTextWidget to true will force a text/plain MIME type, and therefore disabling the copying of any HTML content. I don't know why this path in the code used to exist, but it is basically the cause of this bug, so we should remove it.
This commit is contained in:
Родитель
730757f275
Коммит
3a36f66164
|
@ -1380,19 +1380,6 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
|
|||
mIsTextWidget = true;
|
||||
break;
|
||||
}
|
||||
else if (selContent->IsElement()) {
|
||||
nsRefPtr<nsStyleContext> styleContext =
|
||||
nsComputedDOMStyle::GetStyleContextForElementNoFlush(selContent->AsElement(),
|
||||
nullptr, nullptr);
|
||||
if (styleContext) {
|
||||
const nsStyleText* textStyle = styleContext->StyleText();
|
||||
if (textStyle->WhiteSpaceOrNewlineIsSignificant()) {
|
||||
// Copy as plaintext for all preformatted elements
|
||||
mIsTextWidget = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// normalize selection if we are not in a widget
|
||||
|
|
Загрузка…
Ссылка в новой задаче