Loading editor/libeditor/html/nsHTMLEditRules.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -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. Loading editor/libeditor/html/nsHTMLEditUtils.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -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 // Loading editor/libeditor/html/nsHTMLEditUtils.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
editor/libeditor/html/nsHTMLEditRules.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -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. Loading
editor/libeditor/html/nsHTMLEditUtils.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -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 // Loading
editor/libeditor/html/nsHTMLEditUtils.h +1 −0 Original line number Diff line number Diff line Loading @@ -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