Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(996)

Unified Diff: Source/core/editing/VisibleSelection.cpp

Issue 24278008: [oilpan] Handlify Nodes in htmlediting (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index acd93afdc4b304bfee05e75c506df9be2f48326c..3da3c55af8378cba09d27809fce5156bd36fbf97 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -96,7 +96,7 @@ VisibleSelection::VisibleSelection(const Handle<const Range>& range, EAffinity a
VisibleSelection VisibleSelection::selectionFromContentsOfNode(Node* node)
{
- ASSERT(!editingIgnoresContent(node));
+ ASSERT(!editingIgnoresContent(adoptRawResult(node)));
return VisibleSelection(firstPositionInNode(adoptRawResult(node)), lastPositionInNode(adoptRawResult(node)), DOWNSTREAM);
}
@@ -304,12 +304,12 @@ void VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity(Text
VisiblePosition wordEnd(endOfWord(originalEnd, side));
VisiblePosition end(wordEnd);
- if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.deprecatedNode().handle().raw())) {
+ if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.deprecatedNode())) {
// Select the paragraph break (the space from the end of a paragraph to the start of
// the next one) to match TextEdit.
end = wordEnd.next();
- if (Node* table = isFirstPositionAfterTable(end)) {
+ if (Handle<Node> table = isFirstPositionAfterTable(end)) {
// The paragraph break after the last paragraph in the last cell of a block table ends
// at the start of the paragraph after the table.
if (isBlock(table))
@@ -359,7 +359,7 @@ void VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity(Text
// of the next one) in the selection.
VisiblePosition end(visibleParagraphEnd.next());
- if (Node* table = isFirstPositionAfterTable(end)) {
+ if (Handle<Node> table = isFirstPositionAfterTable(end)) {
// The paragraph break after the last paragraph in the last cell of a block table ends
// at the start of the paragraph after the table, not at the position just after the table.
if (isBlock(table))
@@ -522,11 +522,11 @@ void VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries()
if (m_base.isNull() || m_start.isNull() || m_end.isNull())
return;
- Node* baseRoot = highestEditableRoot(m_base);
- Node* startRoot = highestEditableRoot(m_start);
- Node* endRoot = highestEditableRoot(m_end);
+ Handle<Node> baseRoot = highestEditableRoot(m_base);
+ Handle<Node> startRoot = highestEditableRoot(m_start);
+ Handle<Node> endRoot = highestEditableRoot(m_end);
- Node* baseEditableAncestor = lowestEditableAncestor(m_base.containerNode().handle().raw());
+ Handle<Node> baseEditableAncestor = lowestEditableAncestor(m_base.containerNode());
// The base, start and end are all in the same region. No adjustment necessary.
if (baseRoot == startRoot && baseRoot == endRoot)
@@ -561,18 +561,18 @@ void VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries()
// The selection ends in editable content or non-editable content inside a different editable ancestor,
// move backward until non-editable content inside the same lowest editable ancestor is reached.
- Node* endEditableAncestor = lowestEditableAncestor(m_end.containerNode().handle().raw());
+ Handle<Node> endEditableAncestor = lowestEditableAncestor(m_end.containerNode());
if (endRoot || endEditableAncestor != baseEditableAncestor) {
Position p = previousVisuallyDistinctCandidate(m_end);
Handle<Node> shadowAncestor = endRoot ? endRoot->shadowHost() : nullptr;
if (p.isNull() && shadowAncestor)
p = positionAfterNode(shadowAncestor);
- while (p.isNotNull() && !(lowestEditableAncestor(p.containerNode().handle().raw()) == baseEditableAncestor && !isEditablePosition(p))) {
+ while (p.isNotNull() && !(lowestEditableAncestor(p.containerNode()) == baseEditableAncestor && !isEditablePosition(p))) {
HandleScope scope;
Handle<Node> root = editableRootForPosition(p);
shadowAncestor = root ? root->shadowHost() : nullptr;
- p = isAtomicNode(p.containerNode().handle().raw()) ? positionInParentBeforeNode(p.containerNode()) : previousVisuallyDistinctCandidate(p);
+ p = isAtomicNode(p.containerNode()) ? positionInParentBeforeNode(p.containerNode()) : previousVisuallyDistinctCandidate(p);
if (p.isNull() && shadowAncestor)
p = positionAfterNode(shadowAncestor);
}
@@ -592,17 +592,17 @@ void VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries()
// The selection starts in editable content or non-editable content inside a different editable ancestor,
// move forward until non-editable content inside the same lowest editable ancestor is reached.
- Node* startEditableAncestor = lowestEditableAncestor(m_start.containerNode().handle().raw());
+ Handle<Node> startEditableAncestor = lowestEditableAncestor(m_start.containerNode());
if (startRoot || startEditableAncestor != baseEditableAncestor) {
Position p = nextVisuallyDistinctCandidate(m_start);
Handle<Node> shadowAncestor = startRoot ? startRoot->shadowHost() : nullptr;
if (p.isNull() && shadowAncestor)
p = positionBeforeNode(shadowAncestor);
- while (p.isNotNull() && !(lowestEditableAncestor(p.containerNode().handle().raw()) == baseEditableAncestor && !isEditablePosition(p))) {
+ while (p.isNotNull() && !(lowestEditableAncestor(p.containerNode()) == baseEditableAncestor && !isEditablePosition(p))) {
HandleScope scope;
Handle<Node> root = editableRootForPosition(p);
shadowAncestor = root ? root->shadowHost() : nullptr;
- p = isAtomicNode(p.containerNode().handle().raw()) ? positionInParentAfterNode(p.containerNode()) : nextVisuallyDistinctCandidate(p);
+ p = isAtomicNode(p.containerNode()) ? positionInParentAfterNode(p.containerNode()) : nextVisuallyDistinctCandidate(p);
if (p.isNull() && shadowAncestor)
p = positionBeforeNode(shadowAncestor);
}
@@ -622,7 +622,7 @@ void VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries()
}
// Correct the extent if necessary.
- if (baseEditableAncestor != lowestEditableAncestor(m_extent.containerNode().handle().raw()))
+ if (baseEditableAncestor != lowestEditableAncestor(m_extent.containerNode()))
m_extent = m_baseIsFirst ? m_end : m_start;
}

Powered by Google App Engine
This is Rietveld 408576698