Replace 0 and NULL with nullptr in WebCore/editing.
authorhs85.jeong@samsung.com <hs85.jeong@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Oct 2015 17:09:56 +0000 (17:09 +0000)
committerhs85.jeong@samsung.com <hs85.jeong@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Oct 2015 17:09:56 +0000 (17:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150555

Reviewed by Darin Adler.

No new tests because there is no behavior change.

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::ApplyStyleCommand):
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::applyInlineStyle):
* editing/ApplyStyleCommand.h:
(WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::applyCommandToComposite):
(WebCore::CompositeEditCommand::deleteInsignificantText):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
(WebCore::DeleteSelectionCommand::initializeStartEnd):
* editing/EditCommand.cpp:
(WebCore::EditCommand::EditCommand):
* editing/EditCommand.h:
* editing/EditingStyle.cpp:
(WebCore::HTMLElementEquivalent::HTMLElementEquivalent):
* editing/EditingStyle.h:
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::Editor::commandIsSupportedFromMenuOrKeyBinding):
(WebCore::Editor::Command::Command):
* editing/FrameSelection.cpp:
(WebCore::DragCaretController::setCaretPosition):
(WebCore::FrameSelection::directionOfSelection):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::entityMaskForText):
* editing/MarkupAccumulator.h:
* editing/RenderedPosition.cpp:
(WebCore::rendererFromPosition):
(WebCore::RenderedPosition::RenderedPosition):
* editing/RenderedPosition.h:
(WebCore::RenderedPosition::operator==):
(WebCore::RenderedPosition::uncachedInlineBox):
(WebCore::RenderedPosition::RenderedPosition):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
* editing/SetNodeAttributeCommand.cpp:
(WebCore::SetNodeAttributeCommand::doUnapply):
* editing/SmartReplaceCF.cpp:
(WebCore::getSmartSet):
* editing/SpellChecker.cpp:
(WebCore::SpellCheckRequest::SpellCheckRequest):
(WebCore::SpellCheckRequest::didSucceed):
(WebCore::SpellCheckRequest::didCancel):
(WebCore::SpellCheckRequest::setCheckerAndSequence):
(WebCore::SpellCheckRequest::requesterDestroyed):
(WebCore::SpellChecker::SpellChecker):
* editing/SpellChecker.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
(WebCore::VisiblePosition::localCaretRect):
(WebCore::enclosingBlockFlowElement):
* editing/VisibleUnits.cpp:
(WebCore::CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes):
(WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
(WebCore::visualWordPosition):
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):
* editing/htmlediting.cpp:
(WebCore::highestEnclosingNodeOfType):
(WebCore::highestNodeToRemoveInPruning):
* editing/htmlediting.h:
(WebCore::firstPositionInOrBeforeNode):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
(WebCore::Editor::fontForSelection):
* editing/mac/AlternativeTextUIController.mm:
(WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext):
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection):
* editing/markup.cpp:
* editing/markup.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191671 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/ApplyStyleCommand.h
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/EditCommand.cpp
Source/WebCore/editing/EditCommand.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h
Source/WebCore/editing/Editor.h
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/editing/MarkupAccumulator.h
Source/WebCore/editing/RenderedPosition.cpp
Source/WebCore/editing/RenderedPosition.h
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/SetNodeAttributeCommand.cpp
Source/WebCore/editing/SmartReplaceCF.cpp
Source/WebCore/editing/SpellChecker.cpp
Source/WebCore/editing/SpellChecker.h
Source/WebCore/editing/VisiblePosition.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/htmlediting.h
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/mac/AlternativeTextUIController.mm
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/editing/markup.h

index 6f066dc..97d9e44 100644 (file)
@@ -1,3 +1,88 @@
+2015-10-28  Hunseop Jeong  <hs85.jeong@samsung.com>
+
+        Replace 0 and NULL with nullptr in WebCore/editing.
+        https://bugs.webkit.org/show_bug.cgi?id=150555
+
+        Reviewed by Darin Adler.
+
+        No new tests because there is no behavior change.
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::ApplyStyleCommand):
+        (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
+        (WebCore::ApplyStyleCommand::applyInlineStyle):
+        * editing/ApplyStyleCommand.h:
+        (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::applyCommandToComposite):
+        (WebCore::CompositeEditCommand::deleteInsignificantText):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
+        (WebCore::DeleteSelectionCommand::initializeStartEnd):
+        * editing/EditCommand.cpp:
+        (WebCore::EditCommand::EditCommand):
+        * editing/EditCommand.h:
+        * editing/EditingStyle.cpp:
+        (WebCore::HTMLElementEquivalent::HTMLElementEquivalent):
+        * editing/EditingStyle.h:
+        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
+        * editing/Editor.h:
+        * editing/EditorCommand.cpp:
+        (WebCore::Editor::commandIsSupportedFromMenuOrKeyBinding):
+        (WebCore::Editor::Command::Command):
+        * editing/FrameSelection.cpp:
+        (WebCore::DragCaretController::setCaretPosition):
+        (WebCore::FrameSelection::directionOfSelection):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::entityMaskForText):
+        * editing/MarkupAccumulator.h:
+        * editing/RenderedPosition.cpp:
+        (WebCore::rendererFromPosition):
+        (WebCore::RenderedPosition::RenderedPosition):
+        * editing/RenderedPosition.h:
+        (WebCore::RenderedPosition::operator==):
+        (WebCore::RenderedPosition::uncachedInlineBox):
+        (WebCore::RenderedPosition::RenderedPosition):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::handleStyleSpans):
+        * editing/SetNodeAttributeCommand.cpp:
+        (WebCore::SetNodeAttributeCommand::doUnapply):
+        * editing/SmartReplaceCF.cpp:
+        (WebCore::getSmartSet):
+        * editing/SpellChecker.cpp:
+        (WebCore::SpellCheckRequest::SpellCheckRequest):
+        (WebCore::SpellCheckRequest::didSucceed):
+        (WebCore::SpellCheckRequest::didCancel):
+        (WebCore::SpellCheckRequest::setCheckerAndSequence):
+        (WebCore::SpellCheckRequest::requesterDestroyed):
+        (WebCore::SpellChecker::SpellChecker):
+        * editing/SpellChecker.h:
+        * editing/VisiblePosition.cpp:
+        (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
+        (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
+        (WebCore::VisiblePosition::localCaretRect):
+        (WebCore::enclosingBlockFlowElement):
+        * editing/VisibleUnits.cpp:
+        (WebCore::CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes):
+        (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
+        (WebCore::visualWordPosition):
+        (WebCore::previousLinePosition):
+        (WebCore::nextLinePosition):
+        * editing/htmlediting.cpp:
+        (WebCore::highestEnclosingNodeOfType):
+        (WebCore::highestNodeToRemoveInPruning):
+        * editing/htmlediting.h:
+        (WebCore::firstPositionInOrBeforeNode):
+        * editing/ios/EditorIOS.mm:
+        (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
+        (WebCore::Editor::fontForSelection):
+        * editing/mac/AlternativeTextUIController.mm:
+        (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::fontForSelection):
+        * editing/markup.cpp:
+        * editing/markup.h:
+
 2015-10-28  Xabier Rodriguez Calvar  <calvaris@igalia.com>
 
         [Streams API] Add write method to writable stream
index b8746c3..72e3ad4 100644 (file)
@@ -130,7 +130,6 @@ ApplyStyleCommand::ApplyStyleCommand(Document& document, const EditingStyle* sty
     , m_end(endingSelection().end().upstream())
     , m_useEndingSelection(true)
     , m_removeOnly(false)
-    , m_isInlineElementToRemoveFunction(0)
 {
 }
 
@@ -142,7 +141,6 @@ ApplyStyleCommand::ApplyStyleCommand(Document& document, const EditingStyle* sty
     , m_end(end)
     , m_useEndingSelection(false)
     , m_removeOnly(false)
-    , m_isInlineElementToRemoveFunction(0)
 {
 }
 
@@ -155,7 +153,6 @@ ApplyStyleCommand::ApplyStyleCommand(PassRefPtr<Element> element, bool removeOnl
     , m_useEndingSelection(true)
     , m_styledInlineElement(element)
     , m_removeOnly(removeOnly)
-    , m_isInlineElementToRemoveFunction(0)
 {
 }
 
@@ -468,8 +465,8 @@ HTMLElement* ApplyStyleCommand::splitAncestorsWithUnicodeBidi(Node* node, bool b
     if (!block || block == node)
         return 0;
 
-    Node* highestAncestorWithUnicodeBidi = 0;
-    Node* nextHighestAncestorWithUnicodeBidi = 0;
+    Node* highestAncestorWithUnicodeBidi = nullptr;
+    Node* nextHighestAncestorWithUnicodeBidi = nullptr;
     int highestAncestorUnicodeBidi = 0;
     for (Node* n = node->parentNode(); n != block; n = n->parentNode()) {
         int unicodeBidi = toIdentifier(ComputedStyleExtractor(n).propertyValue(CSSPropertyUnicodeBidi));
@@ -483,7 +480,7 @@ HTMLElement* ApplyStyleCommand::splitAncestorsWithUnicodeBidi(Node* node, bool b
     if (!highestAncestorWithUnicodeBidi)
         return 0;
 
-    HTMLElement* unsplitAncestor = 0;
+    HTMLElement* unsplitAncestor = nullptr;
 
     WritingDirection highestAncestorDirection;
     if (allowedDirection != NaturalWritingDirection
@@ -559,8 +556,8 @@ static Node* highestEmbeddingAncestor(Node* startNode, Node* enclosingNode)
 
 void ApplyStyleCommand::applyInlineStyle(EditingStyle* style)
 {
-    RefPtr<ContainerNode> startDummySpanAncestor = 0;
-    RefPtr<ContainerNode> endDummySpanAncestor = 0;
+    RefPtr<ContainerNode> startDummySpanAncestor;
+    RefPtr<ContainerNode> endDummySpanAncestor;
 
     // update document layout once before removing styles
     // so that we avoid the expense of updating before each and every call
index 9dbe871..fc7d26c 100644 (file)
@@ -77,11 +77,11 @@ private:
     bool isStyledInlineElementToRemove(Element*) const;
     bool shouldApplyInlineStyleToRun(EditingStyle*, Node* runStart, Node* pastEndNode);
     void removeConflictingInlineStyleFromRun(EditingStyle*, RefPtr<Node>& runStart, RefPtr<Node>& runEnd, PassRefPtr<Node> pastEndNode);
-    bool removeInlineStyleFromElement(EditingStyle*, PassRefPtr<HTMLElement>, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle = 0);
+    bool removeInlineStyleFromElement(EditingStyle*, PassRefPtr<HTMLElement>, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle = nullptr);
     inline bool shouldRemoveInlineStyleFromElement(EditingStyle* style, HTMLElement* element) {return removeInlineStyleFromElement(style, element, RemoveNone);}
     void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*&);
     bool removeImplicitlyStyledElement(EditingStyle*, HTMLElement*, InlineStyleRemovalMode, EditingStyle* extractedStyle);
-    bool removeCSSStyle(EditingStyle*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle = 0);
+    bool removeCSSStyle(EditingStyle*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle = nullptr);
     HTMLElement* highestAncestorWithConflictingInlineStyle(EditingStyle*, Node*);
     void applyInlineStyleToPushDown(Node*, EditingStyle*);
     void pushDownInlineStyleAroundNode(EditingStyle*, Node*);
@@ -127,7 +127,7 @@ private:
     bool m_useEndingSelection;
     RefPtr<Element> m_styledInlineElement;
     bool m_removeOnly;
-    IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction;
+    IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction { nullptr };
 };
 
 enum ShouldStyleAttributeBeEmpty { AllowNonEmptyStyleAttribute, StyleAttributeShouldBeEmpty };
index 22bbb33..6c1b56b 100644 (file)
@@ -277,7 +277,7 @@ void CompositeEditCommand::applyCommandToComposite(PassRefPtr<EditCommand> prpCo
     command->setParent(this);
     command->doApply();
     if (command->isSimpleEditCommand()) {
-        command->setParent(0);
+        command->setParent(nullptr);
         ensureComposition()->append(toSimpleEditCommand(command.get()));
     }
     m_commands.append(command.release());
@@ -825,7 +825,7 @@ void CompositeEditCommand::deleteInsignificantText(PassRefPtr<Text> textNode, un
         return;
 
     unsigned removed = 0;
-    InlineTextBox* prevBox = 0;
+    InlineTextBox* prevBox = nullptr;
     String str;
 
     // This loop structure works to process all gaps preceding a box,
@@ -854,7 +854,7 @@ void CompositeEditCommand::deleteInsignificantText(PassRefPtr<Text> textNode, un
             if (++sortedTextBoxesPosition < sortedTextBoxes.size())
                 box = sortedTextBoxes[sortedTextBoxesPosition];
             else
-                box = 0;
+                box = nullptr;
         }
     }
 
index 5609971..9689e19 100644 (file)
@@ -83,10 +83,6 @@ DeleteSelectionCommand::DeleteSelectionCommand(Document& document, bool smartDel
     , m_pruneStartBlockIfNecessary(false)
     , m_startsAtEmptyLine(false)
     , m_sanitizeMarkup(sanitizeMarkup)
-    , m_startBlock(0)
-    , m_endBlock(0)
-    , m_typingStyle(0)
-    , m_deleteIntoBlockquoteStyle(0)
 {
 }
 
@@ -102,17 +98,13 @@ DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection& selection
     , m_startsAtEmptyLine(false)
     , m_sanitizeMarkup(sanitizeMarkup)
     , m_selectionToDelete(selection)
-    , m_startBlock(0)
-    , m_endBlock(0)
-    , m_typingStyle(0)
-    , m_deleteIntoBlockquoteStyle(0)
 {
 }
 
 void DeleteSelectionCommand::initializeStartEnd(Position& start, Position& end)
 {
-    Node* startSpecialContainer = 0;
-    Node* endSpecialContainer = 0;
+    Node* startSpecialContainer = nullptr;
+    Node* endSpecialContainer = nullptr;
  
     start = m_selectionToDelete.start();
     end = m_selectionToDelete.end();
@@ -129,8 +121,8 @@ void DeleteSelectionCommand::initializeStartEnd(Position& start, Position& end)
         return;
     
     while (1) {
-        startSpecialContainer = 0;
-        endSpecialContainer = 0;
+        startSpecialContainer = nullptr;
+        endSpecialContainer = nullptr;
     
         Position s = positionBeforeContainingSpecialElement(start, &startSpecialContainer);
         Position e = positionAfterContainingSpecialElement(end, &endSpecialContainer);
index 4000d42..9f04847 100644 (file)
@@ -40,7 +40,6 @@ namespace WebCore {
 
 EditCommand::EditCommand(Document& document, EditAction editingAction)
     : m_document(document)
-    , m_parent(0)
     , m_editingAction(editingAction)
 {
     ASSERT(document.frame());
@@ -50,7 +49,6 @@ EditCommand::EditCommand(Document& document, EditAction editingAction)
 
 EditCommand::EditCommand(Document& document, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection)
     : m_document(document)
-    , m_parent(0)
 {
     ASSERT(document.frame());
     setStartingSelection(startingSelection);
index a783a9b..bf1e360 100644 (file)
@@ -79,7 +79,7 @@ private:
     Ref<Document> m_document;
     VisibleSelection m_startingSelection;
     VisibleSelection m_endingSelection;
-    CompositeEditCommand* m_parent;
+    CompositeEditCommand* m_parent { nullptr };
     EditAction m_editingAction { EditActionUnspecified };
 };
 
index f372281..12e9d52 100644 (file)
@@ -170,12 +170,11 @@ protected:
     HTMLElementEquivalent(CSSPropertyID, const QualifiedName& tagName);
     const CSSPropertyID m_propertyID;
     const RefPtr<CSSPrimitiveValue> m_primitiveValue;
-    const QualifiedName* m_tagName; // We can store a pointer because HTML tag names are const global.
+    const QualifiedName* m_tagName { nullptr }; // We can store a pointer because HTML tag names are const global.
 };
 
 HTMLElementEquivalent::HTMLElementEquivalent(CSSPropertyID id)
     : m_propertyID(id)
-    , m_tagName(0)
 {
 }
 
index 1279ce9..694fe41 100644 (file)
@@ -136,7 +136,7 @@ public:
     {
         return conflictsWithInlineStyleOfElement(element, &newInlineStyle, extractedStyle);
     }
-    bool conflictsWithImplicitStyleOfElement(HTMLElement*, EditingStyle* extractedStyle = 0, ShouldExtractMatchingStyle = DoNotExtractMatchingStyle) const;
+    bool conflictsWithImplicitStyleOfElement(HTMLElement*, EditingStyle* extractedStyle = nullptr, ShouldExtractMatchingStyle = DoNotExtractMatchingStyle) const;
     bool conflictsWithImplicitStyleOfAttributes(HTMLElement*) const;
     bool extractConflictingImplicitStyleOfAttributes(HTMLElement*, ShouldPreserveWritingDirection, EditingStyle* extractedStyle,
             Vector<QualifiedName>& conflictingAttributes, ShouldExtractMatchingStyle) const;
index 8a82f3d..9e6d780 100644 (file)
@@ -204,19 +204,19 @@ public:
         WEBCORE_EXPORT Command();
         Command(const EditorInternalCommand*, EditorCommandSource, PassRefPtr<Frame>);
 
-        WEBCORE_EXPORT bool execute(const String& parameter = String(), Event* triggeringEvent = 0) const;
+        WEBCORE_EXPORT bool execute(const String& parameter = String(), Event* triggeringEvent = nullptr) const;
         WEBCORE_EXPORT bool execute(Event* triggeringEvent) const;
 
         WEBCORE_EXPORT bool isSupported() const;
-        WEBCORE_EXPORT bool isEnabled(Event* triggeringEvent = 0) const;
+        WEBCORE_EXPORT bool isEnabled(Event* triggeringEvent = nullptr) const;
 
-        WEBCORE_EXPORT TriState state(Event* triggeringEvent = 0) const;
-        String value(Event* triggeringEvent = 0) const;
+        WEBCORE_EXPORT TriState state(Event* triggeringEvent = nullptr) const;
+        String value(Event* triggeringEvent = nullptr) const;
 
         WEBCORE_EXPORT bool isTextInsertion() const;
 
     private:
-        const EditorInternalCommand* m_command;
+        const EditorInternalCommand* m_command { nullptr };
         EditorCommandSource m_source;
         RefPtr<Frame> m_frame;
     };
index 76ac84c..bed85f1 100644 (file)
@@ -1677,7 +1677,6 @@ bool Editor::commandIsSupportedFromMenuOrKeyBinding(const String& commandName)
 }
 
 Editor::Command::Command()
-    : m_command(0)
 {
 }
 
index 630b00f..a71e8b5 100644 (file)
@@ -181,7 +181,7 @@ void DragCaretController::setCaretPosition(const VisiblePosition& position)
         invalidateCaretRect(node);
     m_position = position;
     setCaretRectNeedsUpdate();
-    Document* document = 0;
+    Document* document = nullptr;
     if (Node* node = m_position.deepEquivalent().deprecatedNode()) {
         invalidateCaretRect(node);
         document = &node->document();
@@ -552,8 +552,8 @@ TextDirection FrameSelection::directionOfEnclosingBlock()
 
 TextDirection FrameSelection::directionOfSelection()
 {
-    InlineBox* startBox = 0;
-    InlineBox* endBox = 0;
+    InlineBox* startBox = nullptr;
+    InlineBox* endBox = nullptr;
     int unusedOffset;
     // Cache the VisiblePositions because visibleStart() and visibleEnd()
     // can cause layout, which has the potential to invalidate lineboxes.
index 7d57599..f9682a4 100644 (file)
@@ -327,7 +327,7 @@ EntityMask MarkupAccumulator::entityMaskForText(const Text& text) const
     if (!text.document().isHTMLDocument())
         return EntityMaskInPCDATA;
 
-    const QualifiedName* parentName = 0;
+    const QualifiedName* parentName = nullptr;
     if (text.parentElement())
         parentName = &text.parentElement()->tagQName();
 
index de869d1..c60c06d 100644 (file)
@@ -60,7 +60,7 @@ enum EntityMask {
 // FIXME: Noncopyable?
 class MarkupAccumulator {
 public:
-    MarkupAccumulator(Vector<Node*>*, EAbsoluteURLs, const Range* = 0, EFragmentSerialization = HTMLFragmentSerialization);
+    MarkupAccumulator(Vector<Node*>*, EAbsoluteURLs, const Range* = nullptr, EFragmentSerialization = HTMLFragmentSerialization);
     virtual ~MarkupAccumulator();
 
     String serializeNodes(Node& targetNode, EChildrenOnly, Vector<QualifiedName>* tagNamesToSkip = nullptr);
@@ -85,7 +85,7 @@ protected:
     virtual void appendText(StringBuilder&, const Text&);
     virtual void appendElement(StringBuilder&, const Element&, Namespaces*);
 
-    void appendStartTag(const Node&, Namespaces* = 0);
+    void appendStartTag(const Node&, Namespaces* = nullptr);
 
     void appendOpenTag(StringBuilder&, const Element&, Namespaces*);
     void appendCloseTag(StringBuilder&, const Element&);
index 26e57e6..9938218 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 static inline RenderObject* rendererFromPosition(const Position& position)
 {
     ASSERT(position.isNotNull());
-    Node* rendererNode = 0;
+    Node* rendererNode = nullptr;
     switch (position.anchorType()) {
     case Position::PositionIsOffsetInAnchor:
         rendererNode = position.computeNodeAfterPosition();
@@ -64,9 +64,7 @@ static inline RenderObject* rendererFromPosition(const Position& position)
 }
 
 RenderedPosition::RenderedPosition(const VisiblePosition& position)
-    : m_renderer(0)
-    , m_inlineBox(0)
-    , m_offset(0)
+    : m_offset(0)
     , m_prevLeafChild(uncachedInlineBox())
     , m_nextLeafChild(uncachedInlineBox())
 {
@@ -80,9 +78,7 @@ RenderedPosition::RenderedPosition(const VisiblePosition& position)
 }
 
 RenderedPosition::RenderedPosition(const Position& position, EAffinity affinity)
-    : m_renderer(0)
-    , m_inlineBox(0)
-    , m_offset(0)
+    : m_offset(0)
     , m_prevLeafChild(uncachedInlineBox())
     , m_nextLeafChild(uncachedInlineBox())
 {
index 4f7eb28..d66d82b 100644 (file)
@@ -67,7 +67,7 @@ public:
     Position positionAtLeftBoundaryOfBiDiRun() const;
     Position positionAtRightBoundaryOfBiDiRun() const;
 
-    IntRect absoluteRect(LayoutUnit* extraWidthToEndOfLine = 0) const;
+    IntRect absoluteRect(LayoutUnit* extraWidthToEndOfLine = nullptr) const;
 
 private:
     bool operator==(const RenderedPosition&) const { return false; }
@@ -80,8 +80,8 @@ private:
     bool atLeftBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
     bool atRightBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
 
-    RenderObject* m_renderer;
-    InlineBox* m_inlineBox;
+    RenderObject* m_renderer { nullptr };
+    InlineBox* m_inlineBox { nullptr };
     int m_offset;
 
     static InlineBox* uncachedInlineBox() { return reinterpret_cast<InlineBox*>(1); }
@@ -92,9 +92,7 @@ private:
 };
 
 inline RenderedPosition::RenderedPosition()
-    : m_renderer(0)
-    , m_inlineBox(0)
-    , m_offset(0)
+    : m_offset(0)
     , m_prevLeafChild(uncachedInlineBox())
     , m_nextLeafChild(uncachedInlineBox())
 {
index 670f278..5b68f57 100644 (file)
@@ -775,7 +775,7 @@ static bool handleStyleSpansBeforeInsertion(ReplacementFragment& fragment, const
 // or at copy time.
 void ReplaceSelectionCommand::handleStyleSpans(InsertedNodes& insertedNodes)
 {
-    HTMLElement* wrappingStyleSpan = 0;
+    HTMLElement* wrappingStyleSpan = nullptr;
     // The style span that contains the source document's default style should be at
     // the top of the fragment, but Mail sometimes adds a wrapper (for Paste As Quotation),
     // so search for the top level style span instead of assuming it's at the top.
index aeb42c3..1950f0f 100644 (file)
@@ -49,7 +49,7 @@ void SetNodeAttributeCommand::doApply()
 void SetNodeAttributeCommand::doUnapply()
 {
     m_element->setAttribute(m_attribute, m_oldValue);
-    AtomicStringImpl* nullString = 0;
+    AtomicStringImpl* nullString = nullptr;
     m_oldValue = nullString;
 }
 
index 65f5128..85e9bc4 100644 (file)
@@ -36,8 +36,8 @@ namespace WebCore {
 
 static CFMutableCharacterSetRef getSmartSet(bool isPreviousCharacter)
 {
-    static CFMutableCharacterSetRef preSmartSet = NULL; 
-    static CFMutableCharacterSetRef postSmartSet = NULL;
+    static CFMutableCharacterSetRef preSmartSet;
+    static CFMutableCharacterSetRef postSmartSet;
     CFMutableCharacterSetRef smartSet = isPreviousCharacter ? preSmartSet : postSmartSet;
     if (!smartSet) {
         smartSet = CFCharacterSetCreateMutable(kCFAllocatorDefault);
index 37277aa..577ec95 100644 (file)
@@ -44,8 +44,7 @@
 namespace WebCore {
 
 SpellCheckRequest::SpellCheckRequest(PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, const String& text, TextCheckingTypeMask mask, TextCheckingProcessType processType)
-    : m_checker(0)
-    , m_checkingRange(checkingRange)
+    : m_checkingRange(checkingRange)
     , m_paragraphRange(paragraphRange)
     , m_rootEditableElement(m_checkingRange->startContainer().rootEditableElement())
     , m_requestData(unrequestedTextCheckingSequence, text, mask, processType)
@@ -79,7 +78,7 @@ void SpellCheckRequest::didSucceed(const Vector<TextCheckingResult>& results)
     if (!m_checker)
         return;
     m_checker->didCheckSucceed(m_requestData.sequence(), results);
-    m_checker = 0;
+    m_checker = nullptr;
 }
 
 void SpellCheckRequest::didCancel()
@@ -87,7 +86,7 @@ void SpellCheckRequest::didCancel()
     if (!m_checker)
         return;
     m_checker->didCheckCancel(m_requestData.sequence());
-    m_checker = 0;
+    m_checker = nullptr;
 }
 
 void SpellCheckRequest::setCheckerAndSequence(SpellChecker* requester, int sequence)
@@ -100,7 +99,7 @@ void SpellCheckRequest::setCheckerAndSequence(SpellChecker* requester, int seque
 
 void SpellCheckRequest::requesterDestroyed()
 {
-    m_checker = 0;
+    m_checker = nullptr;
 }
 
 SpellChecker::SpellChecker(Frame& frame)
index 7b9b9cc..da8c127 100644 (file)
@@ -63,7 +63,7 @@ public:
 private:
     SpellCheckRequest(PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, const String&, TextCheckingTypeMask, TextCheckingProcessType);
 
-    SpellChecker* m_checker;
+    SpellChecker* m_checker { nullptr };
     RefPtr<Range> m_checkingRange;
     RefPtr<Range> m_paragraphRange;
     RefPtr<Element> m_rootEditableElement;
index 63c0fbe..d9ad664 100644 (file)
@@ -173,7 +173,7 @@ Position VisiblePosition::leftVisuallyDistinctCandidate() const
 
             if (box->direction() == primaryDirection) {
                 if (!prevBox) {
-                    InlineBox* logicalStart = 0;
+                    InlineBox* logicalStart = nullptr;
                     if (primaryDirection == LTR ? box->root().getLogicalStartBoxWithNode(logicalStart) : box->root().getLogicalEndBoxWithNode(logicalStart)) {
                         box = logicalStart;
                         renderer = &box->renderer();
@@ -338,7 +338,7 @@ Position VisiblePosition::rightVisuallyDistinctCandidate() const
 
             if (box->direction() == primaryDirection) {
                 if (!nextBox) {
-                    InlineBox* logicalEnd = 0;
+                    InlineBox* logicalEnd = nullptr;
                     if (primaryDirection == LTR ? box->root().getLogicalEndBoxWithNode(logicalEnd) : box->root().getLogicalStartBoxWithNode(logicalEnd)) {
                         box = logicalEnd;
                         renderer = &box->renderer();
@@ -600,7 +600,7 @@ UChar32 VisiblePosition::characterAfter() const
 LayoutRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
 {
     if (m_deepPosition.isNull()) {
-        renderer = 0;
+        renderer = nullptr;
         return IntRect();
     }
     Node* node = m_deepPosition.anchorNode();
@@ -714,7 +714,7 @@ bool setEnd(Range *r, const VisiblePosition &visiblePosition)
 Element* enclosingBlockFlowElement(const VisiblePosition& visiblePosition)
 {
     if (visiblePosition.isNull())
-        return NULL;
+        return nullptr;
 
     return deprecatedEnclosingBlockFlowElement(visiblePosition.deepEquivalent().deprecatedNode());
 }
index e2bb795..02ef1dd 100644 (file)
@@ -133,11 +133,13 @@ private:
     const Vector<InlineBox*>& collectBoxes(const RootInlineBox*);
     int boxIndexInLeaves(const InlineTextBox*) const;
 
-    const RootInlineBox* m_rootInlineBox;
+    const RootInlineBox* m_rootInlineBox { nullptr };
     Vector<InlineBox*> m_leafBoxes;
 };
 
-CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes() : m_rootInlineBox(0) { };
+CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes()
+{
+}
 
 const InlineBox* CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox(const RootInlineBox* root, const InlineTextBox* box)
 {
@@ -346,9 +348,9 @@ static VisiblePosition visualWordPosition(const VisiblePosition& visiblePosition
         return VisiblePosition();
 
     TextDirection blockDirection = directionOfEnclosingBlock(visiblePosition.deepEquivalent());
-    InlineBox* previouslyVisitedBox = 0;
+    InlineBox* previouslyVisitedBox = nullptr;
     VisiblePosition current = visiblePosition;
-    TextBreakIterator* iter = 0;
+    TextBreakIterator* iter = nullptr;
 
     CachedLogicallyOrderedLeafBoxes leafBoxes;
     Vector<UChar, 1024> string;
@@ -957,7 +959,7 @@ VisiblePosition previousLinePosition(const VisiblePosition& visiblePosition, int
     if (!renderer)
         return VisiblePosition();
 
-    RootInlineBox* root = 0;
+    RootInlineBox* root = nullptr;
     InlineBox* box;
     int ignoredCaretOffset;
     visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
@@ -966,7 +968,7 @@ VisiblePosition previousLinePosition(const VisiblePosition& visiblePosition, int
         // We want to skip zero height boxes.
         // This could happen in case it is a TrailingFloatsRootInlineBox.
         if (!root || !root->logicalHeight() || !root->firstLeafChild())
-            root = 0;
+            root = nullptr;
     }
 
     if (!root) {
@@ -1012,7 +1014,7 @@ VisiblePosition nextLinePosition(const VisiblePosition& visiblePosition, int lin
     if (!renderer)
         return VisiblePosition();
 
-    RootInlineBox* root = 0;
+    RootInlineBox* root = nullptr;
     InlineBox* box;
     int ignoredCaretOffset;
     visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
@@ -1021,7 +1023,7 @@ VisiblePosition nextLinePosition(const VisiblePosition& visiblePosition, int lin
         // We want to skip zero height boxes.
         // This could happen in case it is a TrailingFloatsRootInlineBox.
         if (!root || !root->logicalHeight() || !root->firstLeafChild())
-            root = 0;
+            root = nullptr;
     }
 
     if (!root) {
index 7caa14f..9229d79 100644 (file)
@@ -623,7 +623,7 @@ Node* enclosingNodeOfType(const Position& p, bool (*nodeIsOfType)(const Node*),
 
 Node* highestEnclosingNodeOfType(const Position& p, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule, Node* stayWithin)
 {
-    Node* highest = 0;
+    Node* highest = nullptr;
     Node* root = rule == CannotCrossEditingBoundary ? highestEditableRoot(p) : 0;
     for (Node* n = p.containerNode(); n && n != stayWithin; n = n->parentNode()) {
         if (root && !n->hasEditableStyle())
@@ -653,7 +653,7 @@ static bool hasARenderedDescendant(Node* node, Node* excludedNode)
 
 Node* highestNodeToRemoveInPruning(Node* node)
 {
-    Node* previousNode = 0;
+    Node* previousNode = nullptr;
     Node* rootEditableElement = node ? node->rootEditableElement() : 0;
     for (; node; node = node->parentNode()) {
         if (RenderObject* renderer = node->renderer()) {
index f69d9d8..10ced02 100644 (file)
@@ -57,7 +57,7 @@ Node* highestAncestor(Node*);
 Node* highestEditableRoot(const Position&, EditableType = ContentIsEditable);
 
 Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*),
-    EditingBoundaryCrossingRule = CannotCrossEditingBoundary, Node* stayWithin = 0);
+    EditingBoundaryCrossingRule = CannotCrossEditingBoundary, Node* stayWithin = nullptr);
 Node* highestNodeToRemoveInPruning(Node*);
 Node* lowestEditableAncestor(Node*);
 
@@ -143,9 +143,9 @@ Position nextVisuallyDistinctCandidate(const Position&);
 Position previousVisuallyDistinctCandidate(const Position&);
 
 Position positionOutsideTabSpan(const Position&);
-Position positionBeforeContainingSpecialElement(const Position&, Node** containingSpecialElement = 0);
-Position positionAfterContainingSpecialElement(const Position&, Node** containingSpecialElement = 0);
-Position positionOutsideContainingSpecialElement(const Position&, Node** containingSpecialElement = 0);
+Position positionBeforeContainingSpecialElement(const Position&, Node** containingSpecialElement = nullptr);
+Position positionAfterContainingSpecialElement(const Position&, Node** containingSpecialElement = nullptr);
+Position positionOutsideContainingSpecialElement(const Position&, Node** containingSpecialElement = nullptr);
 
 inline Position firstPositionInOrBeforeNode(Node* node)
 {
@@ -215,7 +215,7 @@ Ref<HTMLElement> createHTMLElement(Document&, const QualifiedName&);
 Ref<HTMLElement> createHTMLElement(Document&, const AtomicString&);
 
 HTMLElement* enclosingList(Node*);
-HTMLElement* outermostEnclosingList(Node*, Node* rootList = 0);
+HTMLElement* outermostEnclosingList(Node*, Node* rootList = nullptr);
 Node* enclosingListChild(Node*);
 
 // -------------------------------------------------------------------------
index aa6e3e8..afd12b2 100644 (file)
@@ -122,7 +122,7 @@ void Editor::setTextAlignmentForChangedBaseWritingDirection(WritingDirection dir
     if (!value)
         return;
         
-    const char *newValue = NULL;
+    const char *newValue = nullptr;
     ETextAlign textAlign = *value;
     switch (textAlign) {
         case TASTART:
@@ -204,7 +204,7 @@ const Font* Editor::fontForSelection(bool& hasMultipleFonts) const
         return result;
     }
 
-    const Font* font = 0;
+    const Font* font = nullptr;
     RefPtr<Range> range = m_frame.selection().toNormalizedRange();
     if (Node* startNode = adjustedSelectionStartForStyleComputation(m_frame.selection().selection()).deprecatedNode()) {
         Node* pastEnd = range->pastLastNode();
index 6ca5d5f..3f1ba50 100644 (file)
@@ -47,10 +47,7 @@ uint64_t AlternativeTextUIController::AlernativeTextContextController::addAltern
 
 NSTextAlternatives* AlternativeTextUIController::AlernativeTextContextController::alternativesForContext(uint64_t context)
 {
-    HashMapType::const_iterator itr = m_alternativesObjectMap.find(context);
-    if (itr == m_alternativesObjectMap.end())
-        return NULL;
-    return itr->value.get();
+    return m_alternativesObjectMap.get(context).get();
 }
 
 void AlternativeTextUIController::AlernativeTextContextController::removeAlternativesForContext(uint64_t context)
index ea51366..25b65ac 100644 (file)
@@ -127,7 +127,7 @@ const Font* Editor::fontForSelection(bool& hasMultipleFonts) const
         return result;
     }
 
-    const Font* font = 0;
+    const Font* font = nullptr;
     RefPtr<Range> range = m_frame.selection().toNormalizedRange();
     Node* startNode = adjustedSelectionStartForStyleComputation(m_frame.selection().selection()).deprecatedNode();
     if (range && startNode) {
index 3e1a9a8..37cb2ef 100644 (file)
@@ -118,7 +118,7 @@ class StyledMarkupAccumulator final : public MarkupAccumulator {
 public:
     enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
 
-    StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs, EAnnotateForInterchange, const Range*, bool needsPositionStyleConversion, Node* highestNodeToBeSerialized = 0);
+    StyledMarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs, EAnnotateForInterchange, const Range*, bool needsPositionStyleConversion, Node* highestNodeToBeSerialized = nullptr);
 
     Node* serializeNodes(Node* startNode, Node* pastEnd);
     void wrapWithNode(Node&, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
index a545ba5..47a4ed9 100644 (file)
@@ -63,7 +63,7 @@ void replaceChildrenWithFragment(ContainerNode&, Ref<DocumentFragment>&&, Except
 void replaceChildrenWithText(ContainerNode&, const String&, ExceptionCode&);
 
 String createMarkup(const Range&, Vector<Node*>* = nullptr, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false, EAbsoluteURLs = DoNotResolveURLs);
-String createMarkup(const Node&, EChildrenOnly = IncludeNode, Vector<Node*>* = nullptr, EAbsoluteURLs = DoNotResolveURLs, Vector<QualifiedName>* tagNamesToSkip = 0, EFragmentSerialization = HTMLFragmentSerialization);
+String createMarkup(const Node&, EChildrenOnly = IncludeNode, Vector<Node*>* = nullptr, EAbsoluteURLs = DoNotResolveURLs, Vector<QualifiedName>* tagNamesToSkip = nullptr, EFragmentSerialization = HTMLFragmentSerialization);
 
 WEBCORE_EXPORT String createFullMarkup(const Node&);
 WEBCORE_EXPORT String createFullMarkup(const Range&);