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
+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
, m_end(endingSelection().end().upstream())
, m_useEndingSelection(true)
, m_removeOnly(false)
- , m_isInlineElementToRemoveFunction(0)
{
}
, m_end(end)
, m_useEndingSelection(false)
, m_removeOnly(false)
- , m_isInlineElementToRemoveFunction(0)
{
}
, m_useEndingSelection(true)
, m_styledInlineElement(element)
, m_removeOnly(removeOnly)
- , m_isInlineElementToRemoveFunction(0)
{
}
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));
if (!highestAncestorWithUnicodeBidi)
return 0;
- HTMLElement* unsplitAncestor = 0;
+ HTMLElement* unsplitAncestor = nullptr;
WritingDirection highestAncestorDirection;
if (allowedDirection != NaturalWritingDirection
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
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*);
bool m_useEndingSelection;
RefPtr<Element> m_styledInlineElement;
bool m_removeOnly;
- IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction;
+ IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction { nullptr };
};
enum ShouldStyleAttributeBeEmpty { AllowNonEmptyStyleAttribute, StyleAttributeShouldBeEmpty };
command->setParent(this);
command->doApply();
if (command->isSimpleEditCommand()) {
- command->setParent(0);
+ command->setParent(nullptr);
ensureComposition()->append(toSimpleEditCommand(command.get()));
}
m_commands.append(command.release());
return;
unsigned removed = 0;
- InlineTextBox* prevBox = 0;
+ InlineTextBox* prevBox = nullptr;
String str;
// This loop structure works to process all gaps preceding a box,
if (++sortedTextBoxesPosition < sortedTextBoxes.size())
box = sortedTextBoxes[sortedTextBoxesPosition];
else
- box = 0;
+ box = nullptr;
}
}
, m_pruneStartBlockIfNecessary(false)
, m_startsAtEmptyLine(false)
, m_sanitizeMarkup(sanitizeMarkup)
- , m_startBlock(0)
- , m_endBlock(0)
- , m_typingStyle(0)
- , m_deleteIntoBlockquoteStyle(0)
{
}
, 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();
return;
while (1) {
- startSpecialContainer = 0;
- endSpecialContainer = 0;
+ startSpecialContainer = nullptr;
+ endSpecialContainer = nullptr;
Position s = positionBeforeContainingSpecialElement(start, &startSpecialContainer);
Position e = positionAfterContainingSpecialElement(end, &endSpecialContainer);
EditCommand::EditCommand(Document& document, EditAction editingAction)
: m_document(document)
- , m_parent(0)
, m_editingAction(editingAction)
{
ASSERT(document.frame());
EditCommand::EditCommand(Document& document, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection)
: m_document(document)
- , m_parent(0)
{
ASSERT(document.frame());
setStartingSelection(startingSelection);
Ref<Document> m_document;
VisibleSelection m_startingSelection;
VisibleSelection m_endingSelection;
- CompositeEditCommand* m_parent;
+ CompositeEditCommand* m_parent { nullptr };
EditAction m_editingAction { EditActionUnspecified };
};
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)
{
}
{
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;
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;
};
}
Editor::Command::Command()
- : m_command(0)
{
}
invalidateCaretRect(node);
m_position = position;
setCaretRectNeedsUpdate();
- Document* document = 0;
+ Document* document = nullptr;
if (Node* node = m_position.deepEquivalent().deprecatedNode()) {
invalidateCaretRect(node);
document = &node->document();
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.
if (!text.document().isHTMLDocument())
return EntityMaskInPCDATA;
- const QualifiedName* parentName = 0;
+ const QualifiedName* parentName = nullptr;
if (text.parentElement())
parentName = &text.parentElement()->tagQName();
// 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);
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&);
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();
}
RenderedPosition::RenderedPosition(const VisiblePosition& position)
- : m_renderer(0)
- , m_inlineBox(0)
- , m_offset(0)
+ : m_offset(0)
, m_prevLeafChild(uncachedInlineBox())
, m_nextLeafChild(uncachedInlineBox())
{
}
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())
{
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; }
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); }
};
inline RenderedPosition::RenderedPosition()
- : m_renderer(0)
- , m_inlineBox(0)
- , m_offset(0)
+ : m_offset(0)
, m_prevLeafChild(uncachedInlineBox())
, m_nextLeafChild(uncachedInlineBox())
{
// 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.
void SetNodeAttributeCommand::doUnapply()
{
m_element->setAttribute(m_attribute, m_oldValue);
- AtomicStringImpl* nullString = 0;
+ AtomicStringImpl* nullString = nullptr;
m_oldValue = nullString;
}
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);
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)
if (!m_checker)
return;
m_checker->didCheckSucceed(m_requestData.sequence(), results);
- m_checker = 0;
+ m_checker = nullptr;
}
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)
void SpellCheckRequest::requesterDestroyed()
{
- m_checker = 0;
+ m_checker = nullptr;
}
SpellChecker::SpellChecker(Frame& frame)
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;
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();
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();
LayoutRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
{
if (m_deepPosition.isNull()) {
- renderer = 0;
+ renderer = nullptr;
return IntRect();
}
Node* node = m_deepPosition.anchorNode();
Element* enclosingBlockFlowElement(const VisiblePosition& visiblePosition)
{
if (visiblePosition.isNull())
- return NULL;
+ return nullptr;
return deprecatedEnclosingBlockFlowElement(visiblePosition.deepEquivalent().deprecatedNode());
}
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)
{
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;
if (!renderer)
return VisiblePosition();
- RootInlineBox* root = 0;
+ RootInlineBox* root = nullptr;
InlineBox* box;
int ignoredCaretOffset;
visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
// 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) {
if (!renderer)
return VisiblePosition();
- RootInlineBox* root = 0;
+ RootInlineBox* root = nullptr;
InlineBox* box;
int ignoredCaretOffset;
visiblePosition.getInlineBoxAndOffset(box, ignoredCaretOffset);
// 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) {
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())
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()) {
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*);
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)
{
Ref<HTMLElement> createHTMLElement(Document&, const AtomicString&);
HTMLElement* enclosingList(Node*);
-HTMLElement* outermostEnclosingList(Node*, Node* rootList = 0);
+HTMLElement* outermostEnclosingList(Node*, Node* rootList = nullptr);
Node* enclosingListChild(Node*);
// -------------------------------------------------------------------------
if (!value)
return;
- const char *newValue = NULL;
+ const char *newValue = nullptr;
ETextAlign textAlign = *value;
switch (textAlign) {
case TASTART:
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();
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)
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) {
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);
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&);