[Webkit-unassigned] [Bug 224941] Crash in BreakBlockquoteCommand::doApply()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 23 13:04:13 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224941

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darin at apple.com
 Attachment #426932|review?                     |review+
              Flags|                            |

--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 426932
  --> https://bugs.webkit.org/attachment.cgi?id=426932
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426932&action=review

> Source/WebCore/editing/BreakBlockquoteCommand.cpp:114
> +            Node* nextNode = NodeTraversal::next(*startNode);
> +            if (nextNode)
> +                startNode = nextNode;

Should be scoped:

    if (auto nextNode = NodeTraversal::next(*startNode))
        startNode = nextNode;

> Source/WebCore/editing/BreakBlockquoteCommand.cpp:120
> +        Node* nextNode = NodeTraversal::next(*startNode);
> +        startNode = childAtOffset ? childAtOffset : (nextNode ? nextNode : startNode);

Ideally would like to avoid doing node traversal if childAtOffset is non-null. I’d write this:

    if (auto child = startNode->traverseToChildAt(pos.deprecatedEditingOffset()))
        startNode = child;
    else if (auto next = NodeTraversal::next(*startNode))
        startNode = next;

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210423/9c0bd60b/attachment-0001.htm>


More information about the webkit-unassigned mailing list