mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 751200 - Don't fall in infinite loops if the content iterator has gone bad; r=bzbarsky
This commit is contained in:
parent
abfc1cc082
commit
c9fd386a7e
@ -302,7 +302,9 @@ static nsresult GenerateFlatTextContent(nsRange* aRange,
|
||||
nsAutoString tmpStr;
|
||||
for (; !iter->IsDone(); iter->Next()) {
|
||||
nsINode* node = iter->GetCurrentNode();
|
||||
if (!node || !node->IsNodeOfType(nsINode::eCONTENT))
|
||||
if (!node)
|
||||
break;
|
||||
if (!node->IsNodeOfType(nsINode::eCONTENT))
|
||||
continue;
|
||||
nsIContent* content = static_cast<nsIContent*>(node);
|
||||
|
||||
@ -384,7 +386,9 @@ nsContentEventHandler::SetRangeFromFlatTextOffset(
|
||||
nsCOMPtr<nsIContent> content;
|
||||
for (; !iter->IsDone(); iter->Next()) {
|
||||
nsINode* node = iter->GetCurrentNode();
|
||||
if (!node || !node->IsNodeOfType(nsINode::eCONTENT))
|
||||
if (!node)
|
||||
break;
|
||||
if (!node->IsNodeOfType(nsINode::eCONTENT))
|
||||
continue;
|
||||
nsIContent* content = static_cast<nsIContent*>(node);
|
||||
|
||||
@ -616,7 +620,9 @@ nsContentEventHandler::OnQueryTextRect(nsQueryContentEvent* aEvent)
|
||||
do {
|
||||
iter->Next();
|
||||
node = iter->GetCurrentNode();
|
||||
if (!node || !node->IsNodeOfType(nsINode::eCONTENT))
|
||||
if (!node)
|
||||
break;
|
||||
if (!node->IsNodeOfType(nsINode::eCONTENT))
|
||||
continue;
|
||||
frame = static_cast<nsIContent*>(node)->GetPrimaryFrame();
|
||||
} while (!frame && !iter->IsDone());
|
||||
@ -921,7 +927,9 @@ nsContentEventHandler::GetFlatTextOffsetOfRange(nsIContent* aRootContent,
|
||||
*aNativeOffset = 0;
|
||||
for (; !iter->IsDone(); iter->Next()) {
|
||||
nsINode* node = iter->GetCurrentNode();
|
||||
if (!node || !node->IsNodeOfType(nsINode::eCONTENT))
|
||||
if (!node)
|
||||
break;
|
||||
if (!node->IsNodeOfType(nsINode::eCONTENT))
|
||||
continue;
|
||||
nsIContent* content = static_cast<nsIContent*>(node);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user