From 1349bede7051966e754bf7174e952eff710b1792 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 12 Oct 2017 23:29:51 -0400 Subject: [PATCH] Bug 1408170 - Set child correctly in HTMLEditRules::GetPromotedPoint(); r=masayuki --- editor/libeditor/HTMLEditRules.cpp | 2 +- editor/libeditor/crashtests/1408170.html | 20 ++++++++++++++++++++ editor/libeditor/crashtests/crashtests.list | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 editor/libeditor/crashtests/1408170.html diff --git a/editor/libeditor/HTMLEditRules.cpp b/editor/libeditor/HTMLEditRules.cpp index 1bfb7e892e63..a54b4d3ce8b3 100644 --- a/editor/libeditor/HTMLEditRules.cpp +++ b/editor/libeditor/HTMLEditRules.cpp @@ -5572,7 +5572,7 @@ HTMLEditRules::GetPromotedPoint(RulesEndpoint aWhere, !htmlEditor->IsVisibleBRElement(priorNode) && !IsBlockNode(*priorNode)) { offset = priorNode->GetParentNode()->IndexOf(priorNode); - child = node; + child = priorNode; node = priorNode->GetParentNode(); priorNode = htmlEditor->GetPriorHTMLNode(node, offset, child, true); } diff --git a/editor/libeditor/crashtests/1408170.html b/editor/libeditor/crashtests/1408170.html new file mode 100644 index 000000000000..cc05a45e689f --- /dev/null +++ b/editor/libeditor/crashtests/1408170.html @@ -0,0 +1,20 @@ + + + +
+ + diff --git a/editor/libeditor/crashtests/crashtests.list b/editor/libeditor/crashtests/crashtests.list index c1638f26673b..fa4d80fa4184 100644 --- a/editor/libeditor/crashtests/crashtests.list +++ b/editor/libeditor/crashtests/crashtests.list @@ -90,3 +90,4 @@ load 1393171.html load 1402469.html load 1402904.html load 1405747.html +load 1408170.html