mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 13:25:00 +00:00
#114429, caret ignores a backspace on a line before a <HR>.
r=jfrancis, sr=kin
This commit is contained in:
parent
1ef06c2bf5
commit
08f5019d8d
@ -6253,12 +6253,14 @@ nsHTMLEditRules::AdjustSelection(nsISelection *aSelection, nsIEditor::EDirection
|
||||
res = mHTMLEditor->GetPriorHTMLSibling(selNode, selOffset, address_of(nearNode));
|
||||
if (NS_FAILED(res)) return res;
|
||||
if (nearNode && (nsTextEditUtils::IsBreak(nearNode)
|
||||
|| nsHTMLEditUtils::IsImage(nearNode)))
|
||||
|| nsHTMLEditUtils::IsImage(nearNode)
|
||||
|| nsHTMLEditUtils::IsHR(nearNode)))
|
||||
return NS_OK; // this is a good place for the caret to be
|
||||
res = mHTMLEditor->GetNextHTMLSibling(selNode, selOffset, address_of(nearNode));
|
||||
if (NS_FAILED(res)) return res;
|
||||
if (nearNode && (nsTextEditUtils::IsBreak(nearNode)
|
||||
|| nsHTMLEditUtils::IsImage(nearNode)))
|
||||
|| nsHTMLEditUtils::IsImage(nearNode)
|
||||
|| nsHTMLEditUtils::IsHR(nearNode)))
|
||||
return NS_OK; // this is a good place for the caret to be
|
||||
|
||||
// look for a nearby text node.
|
||||
|
@ -101,6 +101,16 @@ nsHTMLEditUtils::IsParagraph(nsIDOMNode *node)
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// IsHR: true if node an horizontal rule
|
||||
//
|
||||
PRBool
|
||||
nsHTMLEditUtils::IsHR(nsIDOMNode *node)
|
||||
{
|
||||
return nsTextEditUtils::NodeIsType(node, NS_LITERAL_STRING("hr"));
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// IsListItem: true if node an html list item
|
||||
//
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
// from nsHTMLEditRules:
|
||||
static PRBool IsHeader(nsIDOMNode *aNode);
|
||||
static PRBool IsParagraph(nsIDOMNode *aNode);
|
||||
static PRBool IsHR(nsIDOMNode *aNode);
|
||||
static PRBool IsListItem(nsIDOMNode *aNode);
|
||||
static PRBool IsTable(nsIDOMNode *aNode);
|
||||
static PRBool IsTableRow(nsIDOMNode *aNode);
|
||||
|
Loading…
Reference in New Issue
Block a user