Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b0dd983d54fd6ccc4f4c3218b8a7a7816d6d11a8
      
https://github.com/WebKit/WebKit/commit/b0dd983d54fd6ccc4f4c3218b8a7a7816d6d11a8
  Author: Sam Weinig <[email protected]>
  Date:   2026-03-06 (Fri, 06 Mar 2026)

  Changed paths:
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/FragmentDirectiveGenerator.cpp
    M Source/WebCore/dom/Position.cpp
    M Source/WebCore/dom/Position.h
    M Source/WebCore/dom/PositionInlines.h
    M Source/WebCore/dom/PositionIterator.cpp
    M Source/WebCore/editing/ApplyBlockElementCommand.cpp
    M Source/WebCore/editing/ApplyStyleCommand.cpp
    M Source/WebCore/editing/BreakBlockquoteCommand.cpp
    M Source/WebCore/editing/CompositeEditCommand.cpp
    M Source/WebCore/editing/CreateLinkCommand.cpp
    M Source/WebCore/editing/DeleteSelectionCommand.cpp
    M Source/WebCore/editing/Editing.cpp
    M Source/WebCore/editing/Editing.h
    M Source/WebCore/editing/EditingInlines.h
    M Source/WebCore/editing/EditingStyle.cpp
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/editing/FormatBlockCommand.cpp
    M Source/WebCore/editing/FrameSelection.cpp
    M Source/WebCore/editing/IndentOutdentCommand.cpp
    M Source/WebCore/editing/InsertLineBreakCommand.cpp
    M Source/WebCore/editing/InsertListCommand.cpp
    M Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
    M Source/WebCore/editing/InsertTextCommand.cpp
    M Source/WebCore/editing/ReplaceSelectionCommand.cpp
    M Source/WebCore/editing/TextIterator.cpp
    M Source/WebCore/editing/TextManipulationController.cpp
    M Source/WebCore/editing/TypingCommand.cpp
    M Source/WebCore/editing/VisibleSelection.cpp
    M Source/WebCore/editing/VisibleUnits.cpp
    M Source/WebCore/editing/cocoa/DataDetection.mm
    M Source/WebCore/editing/markup.cpp
    M Source/WebCore/html/HTMLTextFormControlElement.cpp
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/svg/SVGTextContentElement.cpp
    M Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
    M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  Replace a few `Node*` parameters that must never be null with `Node&` 
parameters.
https://bugs.webkit.org/show_bug.cgi?id=309271

Reviewed by Ryosuke Niwa.

The functions `positionInParentBeforeNode`, `positionInParentAfterNode`, 
`positionBeforeNode`,
`positionAfterNode`, `firstPositionInNode`, and `lastPositionInNode` all 
previously took a
single `Node*` parameter, but required that the `Node*` never be null, 
unconditionally
dereferencing it without any null checks.

This changes them to take a `Node&` instead, and updates the call sites to 
match. This makes
it easier to understand at the callers side and makes it necessary for them to 
understand
why dereferencing is safe.

In a few places where it was easily accomplished, RefPtrs were converted to Refs
allowing the removal of some explicit dereferencing at call sites.

Additionally, the definitions of the functions `firstPositionInOrBeforeNode` and
`firstPositionInNode` were moved to their corresponding `Inlines.h" files so 
they
could be adjacent to their "last" counterparts.

* Source/WebCore/accessibility/AXObjectCache.cpp:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
* Source/WebCore/accessibility/AccessibilityObject.cpp:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/dom/Document.cpp:
* Source/WebCore/dom/Element.cpp:
* Source/WebCore/dom/FragmentDirectiveGenerator.cpp:
* Source/WebCore/dom/Position.cpp:
* Source/WebCore/dom/Position.h:
* Source/WebCore/dom/PositionInlines.h:
* Source/WebCore/dom/PositionIterator.cpp:
* Source/WebCore/editing/ApplyBlockElementCommand.cpp:
* Source/WebCore/editing/ApplyStyleCommand.cpp:
* Source/WebCore/editing/BreakBlockquoteCommand.cpp:
* Source/WebCore/editing/CompositeEditCommand.cpp:
* Source/WebCore/editing/CreateLinkCommand.cpp:
* Source/WebCore/editing/DeleteSelectionCommand.cpp:
* Source/WebCore/editing/Editing.cpp:
* Source/WebCore/editing/Editing.h:
* Source/WebCore/editing/EditingInlines.h:
* Source/WebCore/editing/EditingStyle.cpp:
* Source/WebCore/editing/Editor.cpp:
* Source/WebCore/editing/FormatBlockCommand.cpp:
* Source/WebCore/editing/FrameSelection.cpp:
* Source/WebCore/editing/IndentOutdentCommand.cpp:
* Source/WebCore/editing/InsertLineBreakCommand.cpp:
* Source/WebCore/editing/InsertListCommand.cpp:
* Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp:
* Source/WebCore/editing/InsertTextCommand.cpp:
* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
* Source/WebCore/editing/TextIterator.cpp:
* Source/WebCore/editing/TextManipulationController.cpp:
* Source/WebCore/editing/TypingCommand.cpp:
* Source/WebCore/editing/VisibleSelection.cpp:
* Source/WebCore/editing/VisibleUnits.cpp:
* Source/WebCore/editing/cocoa/DataDetection.mm:
* Source/WebCore/editing/markup.cpp:
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
* Source/WebCore/page/EventHandler.cpp:
* Source/WebCore/page/LocalFrame.cpp:
* Source/WebCore/svg/SVGTextContentElement.cpp:
* Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:

Canonical link: https://commits.webkit.org/308798@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to