[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
darin at apple.com
darin at apple.com
Thu Apr 8 00:44:46 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit ea5cc30f013be1a69022e6ec99b58abc6d5b0628
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 21 20:15:17 2009 +0000
Renamed m_sel to m_selection. Used do-webcore-rename.
Reviewed by Mark Rowe.
* editing/SelectionController.cpp:
(WebCore::SelectionController::setSelection):
(WebCore::SelectionController::nodeWillBeRemoved):
(WebCore::SelectionController::willBeModified):
(WebCore::SelectionController::directionOfEnclosingBlock):
(WebCore::SelectionController::modifyExtendingRight):
(WebCore::SelectionController::modifyExtendingForward):
(WebCore::SelectionController::modifyMovingRight):
(WebCore::SelectionController::modifyMovingForward):
(WebCore::SelectionController::modifyExtendingLeft):
(WebCore::SelectionController::modifyExtendingBackward):
(WebCore::SelectionController::modifyMovingLeft):
(WebCore::SelectionController::modifyMovingBackward):
(WebCore::SelectionController::modify):
(WebCore::SelectionController::expandUsingGranularity):
(WebCore::SelectionController::xPosForVerticalArrowNavigation):
(WebCore::SelectionController::setBase):
(WebCore::SelectionController::setExtent):
(WebCore::SelectionController::layout):
(WebCore::SelectionController::caretRenderer):
(WebCore::SelectionController::invalidateCaretRect):
(WebCore::SelectionController::paintCaret):
(WebCore::SelectionController::debugRenderer):
(WebCore::SelectionController::contains):
(WebCore::SelectionController::selectAll):
(WebCore::SelectionController::formatForDebugger):
(WebCore::SelectionController::showTreeForThis):
* editing/SelectionController.h:
* editing/gtk/SelectionControllerGtk.cpp:
(WebCore::SelectionController::notifyAccessibilityForSelectionChange):
* editing/mac/SelectionControllerMac.mm:
(WebCore::SelectionController::notifyAccessibilityForSelectionChange):
Let the script do its thing. Made sure no tests broke.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b9b5b79..59154ba 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2009-12-21 Darin Adler <darin at apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Renamed m_sel to m_selection. Used do-webcore-rename.
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::setSelection):
+ (WebCore::SelectionController::nodeWillBeRemoved):
+ (WebCore::SelectionController::willBeModified):
+ (WebCore::SelectionController::directionOfEnclosingBlock):
+ (WebCore::SelectionController::modifyExtendingRight):
+ (WebCore::SelectionController::modifyExtendingForward):
+ (WebCore::SelectionController::modifyMovingRight):
+ (WebCore::SelectionController::modifyMovingForward):
+ (WebCore::SelectionController::modifyExtendingLeft):
+ (WebCore::SelectionController::modifyExtendingBackward):
+ (WebCore::SelectionController::modifyMovingLeft):
+ (WebCore::SelectionController::modifyMovingBackward):
+ (WebCore::SelectionController::modify):
+ (WebCore::SelectionController::expandUsingGranularity):
+ (WebCore::SelectionController::xPosForVerticalArrowNavigation):
+ (WebCore::SelectionController::setBase):
+ (WebCore::SelectionController::setExtent):
+ (WebCore::SelectionController::layout):
+ (WebCore::SelectionController::caretRenderer):
+ (WebCore::SelectionController::invalidateCaretRect):
+ (WebCore::SelectionController::paintCaret):
+ (WebCore::SelectionController::debugRenderer):
+ (WebCore::SelectionController::contains):
+ (WebCore::SelectionController::selectAll):
+ (WebCore::SelectionController::formatForDebugger):
+ (WebCore::SelectionController::showTreeForThis):
+ * editing/SelectionController.h:
+ * editing/gtk/SelectionControllerGtk.cpp:
+ (WebCore::SelectionController::notifyAccessibilityForSelectionChange):
+ * editing/mac/SelectionControllerMac.mm:
+ (WebCore::SelectionController::notifyAccessibilityForSelectionChange):
+ Let the script do its thing. Made sure no tests broke.
+
2009-12-21 Carol Szabo <carol.szabo at nokia.com>
Reviewed by Darin Adler.
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index af89ccb..518df45 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -105,13 +105,13 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
if (m_isDragCaretController) {
invalidateCaretRect();
- m_sel = s;
+ m_selection = s;
m_needsLayout = true;
invalidateCaretRect();
return;
}
if (!m_frame) {
- m_sel = s;
+ m_selection = s;
return;
}
@@ -133,12 +133,12 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
if (clearTypingStyle)
m_frame->clearTypingStyle();
- if (m_sel == s)
+ if (m_selection == s)
return;
- VisibleSelection oldSelection = m_sel;
+ VisibleSelection oldSelection = m_selection;
- m_sel = s;
+ m_selection = s;
m_needsLayout = true;
@@ -183,10 +183,10 @@ void SelectionController::nodeWillBeRemoved(Node *node)
if (node && highestAncestor(node)->nodeType() == Node::DOCUMENT_FRAGMENT_NODE)
return;
- bool baseRemoved = removingNodeRemovesPosition(node, m_sel.base());
- bool extentRemoved = removingNodeRemovesPosition(node, m_sel.extent());
- bool startRemoved = removingNodeRemovesPosition(node, m_sel.start());
- bool endRemoved = removingNodeRemovesPosition(node, m_sel.end());
+ bool baseRemoved = removingNodeRemovesPosition(node, m_selection.base());
+ bool extentRemoved = removingNodeRemovesPosition(node, m_selection.extent());
+ bool startRemoved = removingNodeRemovesPosition(node, m_selection.start());
+ bool endRemoved = removingNodeRemovesPosition(node, m_selection.end());
bool clearRenderTreeSelection = false;
bool clearDOMTreeSelection = false;
@@ -200,12 +200,12 @@ void SelectionController::nodeWillBeRemoved(Node *node)
// Change the base and extent to the start and end, but don't re-validate the
// selection, since doing so could move the start and end into the node
// that is about to be removed.
- if (m_sel.isBaseFirst())
- m_sel.setWithoutValidation(m_sel.start(), m_sel.end());
+ if (m_selection.isBaseFirst())
+ m_selection.setWithoutValidation(m_selection.start(), m_selection.end());
else
- m_sel.setWithoutValidation(m_sel.end(), m_sel.start());
+ m_selection.setWithoutValidation(m_selection.end(), m_selection.start());
// FIXME: This could be more efficient if we had an isNodeInRange function on Ranges.
- } else if (comparePositions(m_sel.start(), Position(node, 0)) == -1 && comparePositions(m_sel.end(), Position(node, 0)) == 1) {
+ } else if (comparePositions(m_selection.start(), Position(node, 0)) == -1 && comparePositions(m_selection.end(), Position(node, 0)) == 1) {
// If we did nothing here, when this node's renderer was destroyed, the rect that it
// occupied would be invalidated, but, selection gaps that change as a result of
// the removal wouldn't be invalidated.
@@ -214,7 +214,7 @@ void SelectionController::nodeWillBeRemoved(Node *node)
}
if (clearRenderTreeSelection) {
- RefPtr<Document> document = m_sel.start().node()->document();
+ RefPtr<Document> document = m_selection.start().node()->document();
document->updateStyleIfNeeded();
if (RenderView* view = toRenderView(document->renderer()))
view->clearSelection();
@@ -231,26 +231,26 @@ void SelectionController::willBeModified(EAlteration alter, EDirection direction
if (m_lastChangeWasHorizontalExtension)
return;
- Position start = m_sel.start();
- Position end = m_sel.end();
+ Position start = m_selection.start();
+ Position end = m_selection.end();
// FIXME: This is probably not correct for right and left when the direction is RTL.
switch (direction) {
case RIGHT:
case FORWARD:
- m_sel.setBase(start);
- m_sel.setExtent(end);
+ m_selection.setBase(start);
+ m_selection.setExtent(end);
break;
case LEFT:
case BACKWARD:
- m_sel.setBase(end);
- m_sel.setExtent(start);
+ m_selection.setBase(end);
+ m_selection.setExtent(start);
break;
}
}
TextDirection SelectionController::directionOfEnclosingBlock()
{
- Node* n = m_sel.extent().node();
+ Node* n = m_selection.extent().node();
Node* enclosingBlockNode = enclosingBlock(n);
if (!enclosingBlockNode)
return LTR;
@@ -262,7 +262,7 @@ TextDirection SelectionController::directionOfEnclosingBlock()
VisiblePosition SelectionController::modifyExtendingRight(TextGranularity granularity)
{
- VisiblePosition pos(m_sel.extent(), m_sel.affinity());
+ VisiblePosition pos(m_selection.extent(), m_selection.affinity());
// The difference between modifyExtendingRight and modifyExtendingForward is:
// modifyExtendingForward always extends forward logically.
@@ -297,7 +297,7 @@ VisiblePosition SelectionController::modifyExtendingRight(TextGranularity granul
VisiblePosition SelectionController::modifyExtendingForward(TextGranularity granularity)
{
- VisiblePosition pos(m_sel.extent(), m_sel.affinity());
+ VisiblePosition pos(m_selection.extent(), m_selection.affinity());
switch (granularity) {
case CharacterGranularity:
pos = pos.next(true);
@@ -315,16 +315,16 @@ VisiblePosition SelectionController::modifyExtendingForward(TextGranularity gran
pos = nextParagraphPosition(pos, xPosForVerticalArrowNavigation(EXTENT));
break;
case SentenceBoundary:
- pos = endOfSentence(VisiblePosition(m_sel.end(), m_sel.affinity()));
+ pos = endOfSentence(VisiblePosition(m_selection.end(), m_selection.affinity()));
break;
case LineBoundary:
- pos = logicalEndOfLine(VisiblePosition(m_sel.end(), m_sel.affinity()));
+ pos = logicalEndOfLine(VisiblePosition(m_selection.end(), m_selection.affinity()));
break;
case ParagraphBoundary:
- pos = endOfParagraph(VisiblePosition(m_sel.end(), m_sel.affinity()));
+ pos = endOfParagraph(VisiblePosition(m_selection.end(), m_selection.affinity()));
break;
case DocumentBoundary:
- pos = VisiblePosition(m_sel.end(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.end(), m_selection.affinity());
if (isEditablePosition(pos.deepEquivalent()))
pos = endOfEditableContent(pos);
else
@@ -341,9 +341,9 @@ VisiblePosition SelectionController::modifyMovingRight(TextGranularity granulari
switch (granularity) {
case CharacterGranularity:
if (isRange())
- pos = VisiblePosition(m_sel.end(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.end(), m_selection.affinity());
else
- pos = VisiblePosition(m_sel.extent(), m_sel.affinity()).right(true);
+ pos = VisiblePosition(m_selection.extent(), m_selection.affinity()).right(true);
break;
case WordGranularity:
case SentenceGranularity:
@@ -367,38 +367,38 @@ VisiblePosition SelectionController::modifyMovingForward(TextGranularity granula
switch (granularity) {
case CharacterGranularity:
if (isRange())
- pos = VisiblePosition(m_sel.end(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.end(), m_selection.affinity());
else
- pos = VisiblePosition(m_sel.extent(), m_sel.affinity()).next(true);
+ pos = VisiblePosition(m_selection.extent(), m_selection.affinity()).next(true);
break;
case WordGranularity:
- pos = nextWordPosition(VisiblePosition(m_sel.extent(), m_sel.affinity()));
+ pos = nextWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()));
break;
case SentenceGranularity:
- pos = nextSentencePosition(VisiblePosition(m_sel.extent(), m_sel.affinity()));
+ pos = nextSentencePosition(VisiblePosition(m_selection.extent(), m_selection.affinity()));
break;
case LineGranularity: {
// down-arrowing from a range selection that ends at the start of a line needs
// to leave the selection at that line start (no need to call nextLinePosition!)
- pos = VisiblePosition(m_sel.end(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.end(), m_selection.affinity());
if (!isRange() || !isStartOfLine(pos))
pos = nextLinePosition(pos, xPosForVerticalArrowNavigation(START));
break;
}
case ParagraphGranularity:
- pos = nextParagraphPosition(VisiblePosition(m_sel.end(), m_sel.affinity()), xPosForVerticalArrowNavigation(START));
+ pos = nextParagraphPosition(VisiblePosition(m_selection.end(), m_selection.affinity()), xPosForVerticalArrowNavigation(START));
break;
case SentenceBoundary:
- pos = endOfSentence(VisiblePosition(m_sel.end(), m_sel.affinity()));
+ pos = endOfSentence(VisiblePosition(m_selection.end(), m_selection.affinity()));
break;
case LineBoundary:
- pos = logicalEndOfLine(VisiblePosition(m_sel.end(), m_sel.affinity()));
+ pos = logicalEndOfLine(VisiblePosition(m_selection.end(), m_selection.affinity()));
break;
case ParagraphBoundary:
- pos = endOfParagraph(VisiblePosition(m_sel.end(), m_sel.affinity()));
+ pos = endOfParagraph(VisiblePosition(m_selection.end(), m_selection.affinity()));
break;
case DocumentBoundary:
- pos = VisiblePosition(m_sel.end(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.end(), m_selection.affinity());
if (isEditablePosition(pos.deepEquivalent()))
pos = endOfEditableContent(pos);
else
@@ -411,7 +411,7 @@ VisiblePosition SelectionController::modifyMovingForward(TextGranularity granula
VisiblePosition SelectionController::modifyExtendingLeft(TextGranularity granularity)
{
- VisiblePosition pos(m_sel.extent(), m_sel.affinity());
+ VisiblePosition pos(m_selection.extent(), m_selection.affinity());
// The difference between modifyExtendingLeft and modifyExtendingBackward is:
// modifyExtendingBackward always extends backward logically.
@@ -445,7 +445,7 @@ VisiblePosition SelectionController::modifyExtendingLeft(TextGranularity granula
VisiblePosition SelectionController::modifyExtendingBackward(TextGranularity granularity)
{
- VisiblePosition pos(m_sel.extent(), m_sel.affinity());
+ VisiblePosition pos(m_selection.extent(), m_selection.affinity());
// Extending a selection backward by word or character from just after a table selects
// the table. This "makes sense" from the user perspective, esp. when deleting.
@@ -468,16 +468,16 @@ VisiblePosition SelectionController::modifyExtendingBackward(TextGranularity gra
pos = previousParagraphPosition(pos, xPosForVerticalArrowNavigation(EXTENT));
break;
case SentenceBoundary:
- pos = startOfSentence(VisiblePosition(m_sel.start(), m_sel.affinity()));
+ pos = startOfSentence(VisiblePosition(m_selection.start(), m_selection.affinity()));
break;
case LineBoundary:
- pos = logicalStartOfLine(VisiblePosition(m_sel.start(), m_sel.affinity()));
+ pos = logicalStartOfLine(VisiblePosition(m_selection.start(), m_selection.affinity()));
break;
case ParagraphBoundary:
- pos = startOfParagraph(VisiblePosition(m_sel.start(), m_sel.affinity()));
+ pos = startOfParagraph(VisiblePosition(m_selection.start(), m_selection.affinity()));
break;
case DocumentBoundary:
- pos = VisiblePosition(m_sel.start(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.start(), m_selection.affinity());
if (isEditablePosition(pos.deepEquivalent()))
pos = startOfEditableContent(pos);
else
@@ -493,9 +493,9 @@ VisiblePosition SelectionController::modifyMovingLeft(TextGranularity granularit
switch (granularity) {
case CharacterGranularity:
if (isRange())
- pos = VisiblePosition(m_sel.start(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.start(), m_selection.affinity());
else
- pos = VisiblePosition(m_sel.extent(), m_sel.affinity()).left(true);
+ pos = VisiblePosition(m_selection.extent(), m_selection.affinity()).left(true);
break;
case WordGranularity:
case SentenceGranularity:
@@ -518,33 +518,33 @@ VisiblePosition SelectionController::modifyMovingBackward(TextGranularity granul
switch (granularity) {
case CharacterGranularity:
if (isRange())
- pos = VisiblePosition(m_sel.start(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.start(), m_selection.affinity());
else
- pos = VisiblePosition(m_sel.extent(), m_sel.affinity()).previous(true);
+ pos = VisiblePosition(m_selection.extent(), m_selection.affinity()).previous(true);
break;
case WordGranularity:
- pos = previousWordPosition(VisiblePosition(m_sel.extent(), m_sel.affinity()));
+ pos = previousWordPosition(VisiblePosition(m_selection.extent(), m_selection.affinity()));
break;
case SentenceGranularity:
- pos = previousSentencePosition(VisiblePosition(m_sel.extent(), m_sel.affinity()));
+ pos = previousSentencePosition(VisiblePosition(m_selection.extent(), m_selection.affinity()));
break;
case LineGranularity:
- pos = previousLinePosition(VisiblePosition(m_sel.start(), m_sel.affinity()), xPosForVerticalArrowNavigation(START));
+ pos = previousLinePosition(VisiblePosition(m_selection.start(), m_selection.affinity()), xPosForVerticalArrowNavigation(START));
break;
case ParagraphGranularity:
- pos = previousParagraphPosition(VisiblePosition(m_sel.start(), m_sel.affinity()), xPosForVerticalArrowNavigation(START));
+ pos = previousParagraphPosition(VisiblePosition(m_selection.start(), m_selection.affinity()), xPosForVerticalArrowNavigation(START));
break;
case SentenceBoundary:
- pos = startOfSentence(VisiblePosition(m_sel.start(), m_sel.affinity()));
+ pos = startOfSentence(VisiblePosition(m_selection.start(), m_selection.affinity()));
break;
case LineBoundary:
- pos = logicalStartOfLine(VisiblePosition(m_sel.start(), m_sel.affinity()));
+ pos = logicalStartOfLine(VisiblePosition(m_selection.start(), m_selection.affinity()));
break;
case ParagraphBoundary:
- pos = startOfParagraph(VisiblePosition(m_sel.start(), m_sel.affinity()));
+ pos = startOfParagraph(VisiblePosition(m_selection.start(), m_selection.affinity()));
break;
case DocumentBoundary:
- pos = VisiblePosition(m_sel.start(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.start(), m_selection.affinity());
if (isEditablePosition(pos.deepEquivalent()))
pos = startOfEditableContent(pos);
else
@@ -558,7 +558,7 @@ bool SelectionController::modify(EAlteration alter, EDirection dir, TextGranular
{
if (userTriggered) {
SelectionController trialSelectionController;
- trialSelectionController.setSelection(m_sel);
+ trialSelectionController.setSelection(m_selection);
trialSelectionController.setLastChangeWasHorizontalExtension(m_lastChangeWasHorizontalExtension);
trialSelectionController.modify(alter, dir, granularity, false);
@@ -654,7 +654,7 @@ bool SelectionController::modify(EAlteration alter, int verticalDistance, bool u
if (userTriggered) {
SelectionController trialSelectionController;
- trialSelectionController.setSelection(m_sel);
+ trialSelectionController.setSelection(m_selection);
trialSelectionController.setLastChangeWasHorizontalExtension(m_lastChangeWasHorizontalExtension);
trialSelectionController.modify(alter, verticalDistance, false);
@@ -673,14 +673,14 @@ bool SelectionController::modify(EAlteration alter, int verticalDistance, bool u
int xPos = 0;
switch (alter) {
case MOVE:
- pos = VisiblePosition(up ? m_sel.start() : m_sel.end(), m_sel.affinity());
+ pos = VisiblePosition(up ? m_selection.start() : m_selection.end(), m_selection.affinity());
xPos = xPosForVerticalArrowNavigation(up ? START : END);
- m_sel.setAffinity(up ? UPSTREAM : DOWNSTREAM);
+ m_selection.setAffinity(up ? UPSTREAM : DOWNSTREAM);
break;
case EXTEND:
- pos = VisiblePosition(m_sel.extent(), m_sel.affinity());
+ pos = VisiblePosition(m_selection.extent(), m_selection.affinity());
xPos = xPosForVerticalArrowNavigation(EXTENT);
- m_sel.setAffinity(DOWNSTREAM);
+ m_selection.setAffinity(DOWNSTREAM);
break;
}
@@ -735,7 +735,7 @@ bool SelectionController::expandUsingGranularity(TextGranularity granularity)
if (isNone())
return false;
- m_sel.expandUsingGranularity(granularity);
+ m_selection.expandUsingGranularity(granularity);
m_needsLayout = true;
return true;
}
@@ -750,16 +750,16 @@ int SelectionController::xPosForVerticalArrowNavigation(EPositionType type)
Position pos;
switch (type) {
case START:
- pos = m_sel.start();
+ pos = m_selection.start();
break;
case END:
- pos = m_sel.end();
+ pos = m_selection.end();
break;
case BASE:
- pos = m_sel.base();
+ pos = m_selection.base();
break;
case EXTENT:
- pos = m_sel.extent();
+ pos = m_selection.extent();
break;
}
@@ -768,7 +768,7 @@ int SelectionController::xPosForVerticalArrowNavigation(EPositionType type)
return x;
if (m_xPosForVerticalArrowNavigation == NoXPosForVerticalArrowNavigation) {
- VisiblePosition visiblePosition(pos, m_sel.affinity());
+ VisiblePosition visiblePosition(pos, m_selection.affinity());
// VisiblePosition creation can fail here if a node containing the selection becomes visibility:hidden
// after the selection is created and before this function is called.
x = visiblePosition.isNotNull() ? visiblePosition.xOffsetForVerticalNavigation() : 0;
@@ -787,22 +787,22 @@ void SelectionController::clear()
void SelectionController::setBase(const VisiblePosition &pos, bool userTriggered)
{
- setSelection(VisibleSelection(pos.deepEquivalent(), m_sel.extent(), pos.affinity()), true, true, userTriggered);
+ setSelection(VisibleSelection(pos.deepEquivalent(), m_selection.extent(), pos.affinity()), true, true, userTriggered);
}
void SelectionController::setExtent(const VisiblePosition &pos, bool userTriggered)
{
- setSelection(VisibleSelection(m_sel.base(), pos.deepEquivalent(), pos.affinity()), true, true, userTriggered);
+ setSelection(VisibleSelection(m_selection.base(), pos.deepEquivalent(), pos.affinity()), true, true, userTriggered);
}
void SelectionController::setBase(const Position &pos, EAffinity affinity, bool userTriggered)
{
- setSelection(VisibleSelection(pos, m_sel.extent(), affinity), true, true, userTriggered);
+ setSelection(VisibleSelection(pos, m_selection.extent(), affinity), true, true, userTriggered);
}
void SelectionController::setExtent(const Position &pos, EAffinity affinity, bool userTriggered)
{
- setSelection(VisibleSelection(m_sel.base(), pos, affinity), true, true, userTriggered);
+ setSelection(VisibleSelection(m_selection.base(), pos, affinity), true, true, userTriggered);
}
void SelectionController::setNeedsLayout(bool flag)
@@ -812,17 +812,17 @@ void SelectionController::setNeedsLayout(bool flag)
void SelectionController::layout()
{
- if (isNone() || !m_sel.start().node()->inDocument() || !m_sel.end().node()->inDocument()) {
+ if (isNone() || !m_selection.start().node()->inDocument() || !m_selection.end().node()->inDocument()) {
m_caretRect = IntRect();
return;
}
- m_sel.start().node()->document()->updateStyleIfNeeded();
+ m_selection.start().node()->document()->updateStyleIfNeeded();
m_caretRect = IntRect();
if (isCaret()) {
- VisiblePosition pos(m_sel.start(), m_sel.affinity());
+ VisiblePosition pos(m_selection.start(), m_selection.affinity());
if (pos.isNotNull()) {
ASSERT(pos.deepEquivalent().node()->renderer());
@@ -862,7 +862,7 @@ void SelectionController::layout()
RenderObject* SelectionController::caretRenderer() const
{
- Node* node = m_sel.start().node();
+ Node* node = m_selection.start().node();
if (!node)
return 0;
@@ -956,7 +956,7 @@ void SelectionController::invalidateCaretRect()
if (!isCaret())
return;
- Document* d = m_sel.start().node()->document();
+ Document* d = m_selection.start().node()->document();
// recomputeCaretRect will always return false for the drag caret,
// because its m_frame is always 0.
@@ -983,7 +983,7 @@ void SelectionController::invalidateCaretRect()
void SelectionController::paintCaret(GraphicsContext* p, int tx, int ty, const IntRect& clipRect)
{
- if (! m_sel.isCaret())
+ if (! m_selection.isCaret())
return;
if (m_needsLayout)
@@ -1023,10 +1023,10 @@ void SelectionController::debugRenderer(RenderObject *r, bool selected) const
int textLength = text.length();
if (selected) {
int offset = 0;
- if (r->node() == m_sel.start().node())
- offset = m_sel.start().deprecatedEditingOffset();
- else if (r->node() == m_sel.end().node())
- offset = m_sel.end().deprecatedEditingOffset();
+ if (r->node() == m_selection.start().node())
+ offset = m_selection.start().deprecatedEditingOffset();
+ else if (r->node() == m_selection.end().node())
+ offset = m_selection.end().deprecatedEditingOffset();
int pos;
InlineTextBox *box = textRenderer->findNextInlineTextBox(offset, pos);
@@ -1100,11 +1100,11 @@ bool SelectionController::contains(const IntPoint& point)
if (visiblePos.isNull())
return false;
- if (m_sel.visibleStart().isNull() || m_sel.visibleEnd().isNull())
+ if (m_selection.visibleStart().isNull() || m_selection.visibleEnd().isNull())
return false;
- Position start(m_sel.visibleStart().deepEquivalent());
- Position end(m_sel.visibleEnd().deepEquivalent());
+ Position start(m_selection.visibleStart().deepEquivalent());
+ Position end(m_selection.visibleEnd().deepEquivalent());
Position p(visiblePos.deepEquivalent());
return comparePositions(start, p) <= 0 && comparePositions(p, end) <= 0;
@@ -1170,7 +1170,7 @@ void SelectionController::selectAll()
Node* root = 0;
if (isContentEditable())
- root = highestEditableRoot(m_sel.start());
+ root = highestEditableRoot(m_selection.start());
else {
root = shadowTreeRootNode();
if (!root)
@@ -1305,12 +1305,12 @@ bool SelectionController::isFocusedAndActive() const
void SelectionController::formatForDebugger(char* buffer, unsigned length) const
{
- m_sel.formatForDebugger(buffer, length);
+ m_selection.formatForDebugger(buffer, length);
}
void SelectionController::showTreeForThis() const
{
- m_sel.showTreeForThis();
+ m_selection.showTreeForThis();
}
#endif
diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h
index 4a13a30..d03df52 100644
--- a/WebCore/editing/SelectionController.h
+++ b/WebCore/editing/SelectionController.h
@@ -45,10 +45,10 @@ public:
SelectionController(Frame* = 0, bool isDragCaretController = false);
- Element* rootEditableElement() const { return m_sel.rootEditableElement(); }
- bool isContentEditable() const { return m_sel.isContentEditable(); }
- bool isContentRichlyEditable() const { return m_sel.isContentRichlyEditable(); }
- Node* shadowTreeRootNode() const { return m_sel.shadowTreeRootNode(); }
+ Element* rootEditableElement() const { return m_selection.rootEditableElement(); }
+ bool isContentEditable() const { return m_selection.isContentEditable(); }
+ bool isContentRichlyEditable() const { return m_selection.isContentRichlyEditable(); }
+ Node* shadowTreeRootNode() const { return m_selection.shadowTreeRootNode(); }
void moveTo(const Range*, EAffinity, bool userTriggered = false);
void moveTo(const VisiblePosition&, bool userTriggered = false);
@@ -56,7 +56,7 @@ public:
void moveTo(const Position&, EAffinity, bool userTriggered = false);
void moveTo(const Position&, const Position&, EAffinity, bool userTriggered = false);
- const VisibleSelection& selection() const { return m_sel; }
+ const VisibleSelection& selection() const { return m_selection; }
void setSelection(const VisibleSelection&, bool closeTyping = true, bool clearTypingStyle = true, bool userTriggered = false);
bool setSelectedRange(Range*, EAffinity, bool closeTyping);
void selectAll();
@@ -67,9 +67,9 @@ public:
bool contains(const IntPoint&);
- VisibleSelection::SelectionType selectionType() const { return m_sel.selectionType(); }
+ VisibleSelection::SelectionType selectionType() const { return m_selection.selectionType(); }
- EAffinity affinity() const { return m_sel.affinity(); }
+ EAffinity affinity() const { return m_selection.affinity(); }
bool modify(EAlteration, EDirection, TextGranularity, bool userTriggered = false);
bool modify(EAlteration, int verticalDistance, bool userTriggered = false);
@@ -80,10 +80,10 @@ public:
void setExtent(const VisiblePosition&, bool userTriggered = false);
void setExtent(const Position&, EAffinity, bool userTriggered = false);
- Position base() const { return m_sel.base(); }
- Position extent() const { return m_sel.extent(); }
- Position start() const { return m_sel.start(); }
- Position end() const { return m_sel.end(); }
+ Position base() const { return m_selection.base(); }
+ Position extent() const { return m_selection.extent(); }
+ Position start() const { return m_selection.start(); }
+ Position end() const { return m_selection.end(); }
// Return the renderer that is responsible for painting the caret (in the selection start node)
RenderObject* caretRenderer() const;
@@ -97,14 +97,14 @@ public:
void setLastChangeWasHorizontalExtension(bool b) { m_lastChangeWasHorizontalExtension = b; }
void willBeModified(EAlteration, EDirection);
- bool isNone() const { return m_sel.isNone(); }
- bool isCaret() const { return m_sel.isCaret(); }
- bool isRange() const { return m_sel.isRange(); }
- bool isCaretOrRange() const { return m_sel.isCaretOrRange(); }
+ bool isNone() const { return m_selection.isNone(); }
+ bool isCaret() const { return m_selection.isCaret(); }
+ bool isRange() const { return m_selection.isRange(); }
+ bool isCaretOrRange() const { return m_selection.isCaretOrRange(); }
bool isInPasswordField() const;
- bool isAll(StayInEditableContent stayInEditableContent = MustStayInEditableContent) const { return m_sel.isAll(stayInEditableContent); }
+ bool isAll(StayInEditableContent stayInEditableContent = MustStayInEditableContent) const { return m_selection.isAll(stayInEditableContent); }
- PassRefPtr<Range> toNormalizedRange() const { return m_sel.toNormalizedRange(); }
+ PassRefPtr<Range> toNormalizedRange() const { return m_selection.toNormalizedRange(); }
void debugRenderer(RenderObject*, bool selected) const;
@@ -162,7 +162,7 @@ private:
Frame* m_frame;
int m_xPosForVerticalArrowNavigation;
- VisibleSelection m_sel;
+ VisibleSelection m_selection;
IntRect m_caretRect; // caret rect in coords local to the renderer responsible for painting the caret
IntRect m_absCaretBounds; // absolute bounding rect for the caret
diff --git a/WebCore/editing/gtk/SelectionControllerGtk.cpp b/WebCore/editing/gtk/SelectionControllerGtk.cpp
index f3bd4bc..168c297 100644
--- a/WebCore/editing/gtk/SelectionControllerGtk.cpp
+++ b/WebCore/editing/gtk/SelectionControllerGtk.cpp
@@ -29,14 +29,14 @@ namespace WebCore {
void SelectionController::notifyAccessibilityForSelectionChange()
{
- if (AXObjectCache::accessibilityEnabled() && m_sel.start().isNotNull() && m_sel.end().isNotNull()) {
- RenderObject* focusedNode = m_sel.end().node()->renderer();
+ if (AXObjectCache::accessibilityEnabled() && m_selection.start().isNotNull() && m_selection.end().isNotNull()) {
+ RenderObject* focusedNode = m_selection.end().node()->renderer();
AccessibilityObject* accessibilityObject = m_frame->document()->axObjectCache()->getOrCreate(focusedNode);
AtkObject* wrapper = accessibilityObject->wrapper();
if (ATK_IS_TEXT(wrapper)) {
- g_signal_emit_by_name(wrapper, "text-caret-moved", m_sel.end().computeOffsetInContainerNode());
+ g_signal_emit_by_name(wrapper, "text-caret-moved", m_selection.end().computeOffsetInContainerNode());
- if (m_sel.isRange())
+ if (m_selection.isRange())
g_signal_emit_by_name(wrapper, "text-selection-changed");
}
}
diff --git a/WebCore/editing/mac/SelectionControllerMac.mm b/WebCore/editing/mac/SelectionControllerMac.mm
index 47fb434..730eb60 100644
--- a/WebCore/editing/mac/SelectionControllerMac.mm
+++ b/WebCore/editing/mac/SelectionControllerMac.mm
@@ -37,11 +37,11 @@ void SelectionController::notifyAccessibilityForSelectionChange()
{
Document* document = m_frame->document();
- if (AXObjectCache::accessibilityEnabled() && m_sel.start().isNotNull() && m_sel.end().isNotNull())
- document->axObjectCache()->postNotification(m_sel.start().node()->renderer(), AXObjectCache::AXSelectedTextChanged, false);
+ if (AXObjectCache::accessibilityEnabled() && m_selection.start().isNotNull() && m_selection.end().isNotNull())
+ document->axObjectCache()->postNotification(m_selection.start().node()->renderer(), AXObjectCache::AXSelectedTextChanged, false);
// if zoom feature is enabled, insertion point changes should update the zoom
- if (!UAZoomEnabled() || !m_sel.isCaret())
+ if (!UAZoomEnabled() || !m_selection.isCaret())
return;
RenderView* renderView = document->renderView();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list