2010-12-13 Benjamin Kalman <kalman@chromium.org>

        Reviewed by Ojan Vafai.

        Shift-End does not select to the end of the line
        https://bugs.webkit.org/show_bug.cgi?id=50610

        * editing/selection/extend-to-line-boundary-expected.txt: Added.
        * editing/selection/extend-to-line-boundary.html: Added.
2010-12-13  Benjamin Kalman  <kalman@chromium.org>

        Reviewed by Ojan Vafai.

        Shift-End does not select to the end of the line
        https://bugs.webkit.org/show_bug.cgi?id=50610

        Test: editing/selection/extend-to-line-boundary.html

        * editing/SelectionController.cpp:
        (WebCore::SelectionController::positionForPlatform): Use visibleStart/visibleEnd rather than
        start/end.
        (WebCore::SelectionController::modifyExtendingForward):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 01eaecaf
2010-12-13 Benjamin Kalman <kalman@chromium.org>
Reviewed by Ojan Vafai.
Shift-End does not select to the end of the line
https://bugs.webkit.org/show_bug.cgi?id=50610
* editing/selection/extend-to-line-boundary-expected.txt: Added.
* editing/selection/extend-to-line-boundary.html: Added.
2010-12-13 Pavel Feldman <pfeldman@chromium.org>
Not reviewed: rebaseline xss tests for window.onerror.
......
Tests selecting from the start of a line to the end using lineboundary
| "
Lorem ipsum dolor sit amet, <#selection-anchor>consectetur adipisicing elit, sed <#selection-focus>do eiusmod tempor incididunt ut labore et dolore magna aliqua.
"
<!DOCTYPE html>
<style>
#textContainer {
width: 200px;
}
</style>
<div contenteditable id="textContainer">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
textContainer = document.getElementById("textContainer");
text = textContainer.childNodes[0];
getSelection().setBaseAndExtent(text, 0);
getSelection().modify("move", "forward", "line");
getSelection().modify("extend", "forward", "lineboundary");
Markup.description("Tests selecting from the start of a line to the end using lineboundary");
Markup.dump(textContainer);
</script>
2010-12-13 Benjamin Kalman <kalman@chromium.org>
Reviewed by Ojan Vafai.
Shift-End does not select to the end of the line
https://bugs.webkit.org/show_bug.cgi?id=50610
Test: editing/selection/extend-to-line-boundary.html
* editing/SelectionController.cpp:
(WebCore::SelectionController::positionForPlatform): Use visibleStart/visibleEnd rather than
start/end.
(WebCore::SelectionController::modifyExtendingForward):
2010-12-13 Adam Roben <aroben@apple.com>
Windows build fix after r73914
......
......@@ -302,19 +302,17 @@ TextDirection SelectionController::directionOfEnclosingBlock()
VisiblePosition SelectionController::positionForPlatform(bool isGetStart) const
{
Position pos;
Settings* settings = m_frame ? m_frame->settings() : 0;
if (settings && settings->editingBehaviorType() == EditingMacBehavior)
pos = isGetStart ? m_selection.start() : m_selection.end();
return isGetStart ? m_selection.visibleStart() : m_selection.visibleEnd();
else {
// Linux and Windows always extend selections from the extent endpoint.
// FIXME: VisibleSelection should be fixed to ensure as an invariant that
// base/extent always point to the same nodes as start/end, but which points
// to which depends on the value of isBaseFirst. Then this can be changed
// to just return m_sel.extent().
pos = m_selection.isBaseFirst() ? m_selection.end() : m_selection.start();
return m_selection.isBaseFirst() ? m_selection.visibleEnd() : m_selection.visibleStart();
}
return VisiblePosition(pos, m_selection.affinity());
}
VisiblePosition SelectionController::startForPlatform() const
......@@ -385,9 +383,7 @@ VisiblePosition SelectionController::modifyExtendingForward(TextGranularity gran
pos = endOfSentence(endForPlatform());
break;
case LineBoundary:
pos = endForPlatform();
pos.setAffinity(UPSTREAM);
pos = logicalEndOfLine(pos);
pos = logicalEndOfLine(endForPlatform());
break;
case ParagraphBoundary:
pos = endOfParagraph(endForPlatform());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment