mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
49407bfd85
commit
a39425eab1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user