Reviewed by John
* khtml/xml/dom_selection.cpp:
(DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
position.
(DOM::Selection::modifyMovingRightForward): Ditto
(DOM::Selection::modifyExtendingLeftBackward): Ditto
(DOM::Selection::modifyMovingLeftBackward): Ditto
* khtml/xml/dom_selection.h:
(DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
behavior which AppKit binds to cmd+left/right arrow keys.
* kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
WebKit:
Reviewed by John
Add implementations for these methods. Formerly, they logged an error.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView moveToBeginningOfLine:]):
(-[WebHTMLView moveToBeginningOfLineAndModifySelection:]):
(-[WebHTMLView moveToEndOfLine:]):
(-[WebHTMLView moveToEndOfLineAndModifySelection:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7086
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2004-07-21 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ * khtml/xml/dom_selection.cpp:
+ (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
+ function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
+ position.
+ (DOM::Selection::modifyMovingRightForward): Ditto
+ (DOM::Selection::modifyExtendingLeftBackward): Ditto
+ (DOM::Selection::modifyMovingLeftBackward): Ditto
+ * khtml/xml/dom_selection.h:
+ (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
+ specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
+ behavior which AppKit binds to cmd+left/right arrow keys.
+ * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
+
2004-07-20 David Hyatt <hyatt@apple.com>
Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
case LINE:
pos = pos.nextLinePosition(xPosForVerticalArrowNavigation(EXTENT));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(end().node(), end().offset(), selection);
+ pos = selection.end();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = end().nextLinePosition(xPosForVerticalArrowNavigation(END, state() == RANGE));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(end().node(), end().offset(), selection);
+ pos = selection.end();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = pos.previousLinePosition(xPosForVerticalArrowNavigation(EXTENT));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(start().node(), start().offset(), selection);
+ pos = selection.start();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = start().previousLinePosition(xPosForVerticalArrowNavigation(START, state() == RANGE));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(start().node(), start().offset(), selection);
+ pos = selection.start();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
enum EState { NONE, CARET, RANGE };
enum EAlter { MOVE, EXTEND };
enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT };
- enum ETextGranularity { CHARACTER, WORD, LINE, PARAGRAPH };
+ enum ETextGranularity { CHARACTER, WORD, LINE, PARAGRAPH, LINE_BOUNDARY };
Selection();
Selection(const Range &);
case LINE:
pos = pos.nextLinePosition(xPosForVerticalArrowNavigation(EXTENT));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(end().node(), end().offset(), selection);
+ pos = selection.end();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = end().nextLinePosition(xPosForVerticalArrowNavigation(END, state() == RANGE));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(end().node(), end().offset(), selection);
+ pos = selection.end();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = pos.previousLinePosition(xPosForVerticalArrowNavigation(EXTENT));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(start().node(), start().offset(), selection);
+ pos = selection.start();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = start().previousLinePosition(xPosForVerticalArrowNavigation(START, state() == RANGE));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(start().node(), start().offset(), selection);
+ pos = selection.start();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
enum EState { NONE, CARET, RANGE };
enum EAlter { MOVE, EXTEND };
enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT };
- enum ETextGranularity { CHARACTER, WORD, LINE, PARAGRAPH };
+ enum ETextGranularity { CHARACTER, WORD, LINE, PARAGRAPH, LINE_BOUNDARY };
Selection();
Selection(const Range &);
case LINE:
pos = pos.nextLinePosition(xPosForVerticalArrowNavigation(EXTENT));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(end().node(), end().offset(), selection);
+ pos = selection.end();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = end().nextLinePosition(xPosForVerticalArrowNavigation(END, state() == RANGE));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(end().node(), end().offset(), selection);
+ pos = selection.end();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = pos.previousLinePosition(xPosForVerticalArrowNavigation(EXTENT));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(start().node(), start().offset(), selection);
+ pos = selection.start();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
case LINE:
pos = start().previousLinePosition(xPosForVerticalArrowNavigation(START, state() == RANGE));
break;
+ case LINE_BOUNDARY: {
+ Selection selection;
+ startAndEndLineNodesIncludingNode(start().node(), start().offset(), selection);
+ pos = selection.start();
+ break;
+ }
case PARAGRAPH:
// not implemented
break;
enum EState { NONE, CARET, RANGE };
enum EAlter { MOVE, EXTEND };
enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT };
- enum ETextGranularity { CHARACTER, WORD, LINE, PARAGRAPH };
+ enum ETextGranularity { CHARACTER, WORD, LINE, PARAGRAPH, LINE_BOUNDARY };
Selection();
Selection(const Range &);
WebSelectByCharacter,
WebSelectByWord,
WebSelectByLine,
- WebSelectByParagraph
+ WebSelectByParagraph,
+ WebSelectToLineBoundary,
} WebSelectionGranularity;
+2004-07-21 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ Add implementations for these methods. Formerly, they logged an error.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView moveToBeginningOfLine:]):
+ (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]):
+ (-[WebHTMLView moveToEndOfLine:]):
+ (-[WebHTMLView moveToEndOfLineAndModifySelection:]):
+
2004-07-21 Ken Kocienda <kocienda@apple.com>
Reviewed by John
- (void)moveToBeginningOfLine:(id)sender
{
- ERROR("unimplemented");
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectLeft granularity:WebSelectToLineBoundary];
}
- (void)moveToBeginningOfLineAndModifySelection:(id)sender
{
- ERROR("unimplemented");
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectLeft granularity:WebSelectToLineBoundary];
}
- (void)moveToBeginningOfParagraph:(id)sender
- (void)moveToEndOfLine:(id)sender
{
- ERROR("unimplemented");
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectRight granularity:WebSelectToLineBoundary];
}
- (void)moveToEndOfLineAndModifySelection:(id)sender
{
- ERROR("unimplemented");
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectRight granularity:WebSelectToLineBoundary];
}
- (void)moveToEndOfParagraph:(id)sender