[webkit-changes] cvs commit: WebKit/WebView.subproj WebHTMLView.m
Darin
darin at opensource.apple.com
Fri Sep 23 18:19:16 PDT 2005
darin 05/09/23 18:19:16
Modified: . ChangeLog
WebCore.xcodeproj project.pbxproj
khtml khtml_part.cpp khtml_part.h khtmlpart_p.h
khtml/ecma kjs_window.cpp
khtml/editing SelectionController.cpp SelectionController.h
apply_style_command.cpp
break_blockquote_command.cpp
composite_edit_command.cpp composite_edit_command.h
delete_selection_command.cpp
delete_selection_command.h edit_command.cpp
edit_command.h htmlediting.h
insert_line_break_command.cpp
insert_paragraph_separator_command.cpp
insert_text_command.cpp jsediting.cpp
move_selection_command.cpp
replace_selection_command.cpp typing_command.cpp
khtml/rendering render_block.cpp
khtml/xml dom_docimpl.cpp dom_nodeimpl.cpp
kwq KWQAccObject.mm KWQKHTMLPart.h KWQKHTMLPart.mm
KWQRenderTreeDebug.cpp WebCoreBridge.h
WebCoreBridge.mm
. ChangeLog
WebView.subproj WebHTMLView.m
Added: ForwardingHeaders/editing SelectionController.h
Removed: ForwardingHeaders/editing selection.h
khtml/editing selection.cpp selection.h
Log:
WebCore:
Reviewed and landed by Darin.
- name changes to prepare for fixing bugzilla bug 4582
Renamed khtml::Selection to khtml::SelectionController since it's far more
than just the selection position itself. Also renamed WebSelectionDirection
WebSelectionGranularity and their constants to have a WebBridge prefix so they
don't collide with possible public enums with a similar purpose.
* ForwardingHeaders/editing/SelectionController.h: Added.
* ForwardingHeaders/editing/selection.h: Removed.
* WebCore.xcodeproj/project.pbxproj: Added new files, removed old files.
* khtml/editing/SelectionController.cpp: New name for selection.cpp, contents renamed.
* khtml/editing/SelectionController.h: New name for selection.h, contents renamed.
* khtml/editing/selection.cpp: Removed.
* khtml/editing/selection.h: Removed.
* khtml/ecma/kjs_window.cpp:
* khtml/editing/apply_style_command.cpp:
* khtml/editing/break_blockquote_command.cpp:
* khtml/editing/composite_edit_command.cpp:
* khtml/editing/composite_edit_command.h:
* khtml/editing/delete_selection_command.cpp:
* khtml/editing/delete_selection_command.h:
* khtml/editing/edit_command.cpp:
* khtml/editing/edit_command.h:
* khtml/editing/htmlediting.h:
* khtml/editing/insert_line_break_command.cpp:
* khtml/editing/insert_paragraph_separator_command.cpp:
* khtml/editing/insert_text_command.cpp:
* khtml/editing/jsediting.cpp:
* khtml/editing/move_selection_command.cpp:
* khtml/editing/replace_selection_command.cpp:
* khtml/editing/typing_command.cpp:
* khtml/khtml_part.cpp:
* khtml/khtml_part.h:
* khtml/khtmlpart_p.h:
* khtml/rendering/render_block.cpp:
* khtml/xml/dom_docimpl.cpp:
* khtml/xml/dom_nodeimpl.cpp:
* kwq/KWQAccObject.mm:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
* kwq/KWQRenderTreeDebug.cpp:
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
Renaming.
WebKit:
Reviewed and landed by Darin.
- name changes to prepare for fixing bugzilla bug 4582
* WebView.subproj/WebHTMLView.m: Changed names to match WebCore changes.
Revision Changes Path
1.152 +52 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- ChangeLog 23 Sep 2005 18:24:57 -0000 1.151
+++ ChangeLog 24 Sep 2005 01:18:46 -0000 1.152
@@ -1,3 +1,55 @@
+2005-09-23 Duncan Wilcox <duncan at mclink.it>
+
+ Reviewed and landed by Darin.
+
+ - name changes to prepare for fixing bugzilla bug 4582
+
+ Renamed khtml::Selection to khtml::SelectionController since it's far more
+ than just the selection position itself. Also renamed WebSelectionDirection
+ WebSelectionGranularity and their constants to have a WebBridge prefix so they
+ don't collide with possible public enums with a similar purpose.
+
+ * ForwardingHeaders/editing/SelectionController.h: Added.
+ * ForwardingHeaders/editing/selection.h: Removed.
+ * WebCore.xcodeproj/project.pbxproj: Added new files, removed old files.
+
+ * khtml/editing/SelectionController.cpp: New name for selection.cpp, contents renamed.
+ * khtml/editing/SelectionController.h: New name for selection.h, contents renamed.
+
+ * khtml/editing/selection.cpp: Removed.
+ * khtml/editing/selection.h: Removed.
+
+ * khtml/ecma/kjs_window.cpp:
+ * khtml/editing/apply_style_command.cpp:
+ * khtml/editing/break_blockquote_command.cpp:
+ * khtml/editing/composite_edit_command.cpp:
+ * khtml/editing/composite_edit_command.h:
+ * khtml/editing/delete_selection_command.cpp:
+ * khtml/editing/delete_selection_command.h:
+ * khtml/editing/edit_command.cpp:
+ * khtml/editing/edit_command.h:
+ * khtml/editing/htmlediting.h:
+ * khtml/editing/insert_line_break_command.cpp:
+ * khtml/editing/insert_paragraph_separator_command.cpp:
+ * khtml/editing/insert_text_command.cpp:
+ * khtml/editing/jsediting.cpp:
+ * khtml/editing/move_selection_command.cpp:
+ * khtml/editing/replace_selection_command.cpp:
+ * khtml/editing/typing_command.cpp:
+ * khtml/khtml_part.cpp:
+ * khtml/khtml_part.h:
+ * khtml/khtmlpart_p.h:
+ * khtml/rendering/render_block.cpp:
+ * khtml/xml/dom_docimpl.cpp:
+ * khtml/xml/dom_nodeimpl.cpp:
+ * kwq/KWQAccObject.mm:
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ * kwq/KWQRenderTreeDebug.cpp:
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ Renaming.
+
2005-09-23 Darin Adler <darin at apple.com>
Reviewed by Eric.
1.1 WebCore/ForwardingHeaders/editing/SelectionController.h
Index: SelectionController.h
===================================================================
#import <SelectionController.h>
1.27 +12 -12 WebCore/WebCore.xcodeproj/project.pbxproj
Index: project.pbxproj
===================================================================
RCS file: /cvs/root/WebCore/WebCore.xcodeproj/project.pbxproj,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- project.pbxproj 23 Sep 2005 03:28:27 -0000 1.26
+++ project.pbxproj 24 Sep 2005 01:18:48 -0000 1.27
@@ -363,7 +363,7 @@
93F199EF08245E59001E9ABC /* KWQFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B641F206E28C5C0055F610 /* KWQFormData.h */; };
93F199F008245E59001E9ABC /* WebCoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = BE855F7F0701E83500239769 /* WebCoreView.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F199F108245E59001E9ABC /* WebDashboardRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 5150C2A10702629000AF642C /* WebDashboardRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F199F208245E59001E9ABC /* selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE067070285F600BD91F9 /* selection.h */; };
+ 93F199F208245E59001E9ABC /* SelectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE067070285F600BD91F9 /* SelectionController.h */; settings = {ATTRIBUTES = (); }; };
93F199F308245E59001E9ABC /* visible_position.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE069070285F600BD91F9 /* visible_position.h */; };
93F199F408245E59001E9ABC /* visible_text.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE06B070285F600BD91F9 /* visible_text.h */; };
93F199F508245E59001E9ABC /* visible_units.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE06D070285F600BD91F9 /* visible_units.h */; };
@@ -608,7 +608,7 @@
93F19B0608245E59001E9ABC /* KWQFormData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93B641F106E28C5C0055F610 /* KWQFormData.mm */; };
93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = BE8560510701F91100239769 /* WebCoreView.m */; };
93F19B0808245E59001E9ABC /* WebDashboardRegion.m in Sources */ = {isa = PBXBuildFile; fileRef = 5150C2A50702629800AF642C /* WebDashboardRegion.m */; };
- 93F19B0908245E59001E9ABC /* selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE066070285F600BD91F9 /* selection.cpp */; };
+ 93F19B0908245E59001E9ABC /* SelectionController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE066070285F600BD91F9 /* SelectionController.cpp */; };
93F19B0A08245E59001E9ABC /* visible_position.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE068070285F600BD91F9 /* visible_position.cpp */; };
93F19B0B08245E59001E9ABC /* visible_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE06A070285F600BD91F9 /* visible_text.cpp */; };
93F19B0C08245E59001E9ABC /* visible_units.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE06C070285F600BD91F9 /* visible_units.cpp */; };
@@ -1173,7 +1173,7 @@
A8212BB508794A2300677359 /* KWQFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B641F206E28C5C0055F610 /* KWQFormData.h */; };
A8212BB608794A2300677359 /* WebCoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = BE855F7F0701E83500239769 /* WebCoreView.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8212BB708794A2300677359 /* WebDashboardRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 5150C2A10702629000AF642C /* WebDashboardRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A8212BB808794A2300677359 /* selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE067070285F600BD91F9 /* selection.h */; };
+ A8212BB808794A2300677359 /* SelectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE067070285F600BD91F9 /* SelectionController.h */; };
A8212BB908794A2300677359 /* visible_position.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE069070285F600BD91F9 /* visible_position.h */; };
A8212BBA08794A2300677359 /* visible_text.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE06B070285F600BD91F9 /* visible_text.h */; };
A8212BBB08794A2300677359 /* visible_units.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABE06D070285F600BD91F9 /* visible_units.h */; };
@@ -1452,7 +1452,7 @@
A8212CD408794A2300677359 /* KWQFormData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93B641F106E28C5C0055F610 /* KWQFormData.mm */; };
A8212CD508794A2300677359 /* WebCoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = BE8560510701F91100239769 /* WebCoreView.m */; };
A8212CD608794A2300677359 /* WebDashboardRegion.m in Sources */ = {isa = PBXBuildFile; fileRef = 5150C2A50702629800AF642C /* WebDashboardRegion.m */; };
- A8212CD708794A2300677359 /* selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE066070285F600BD91F9 /* selection.cpp */; };
+ A8212CD708794A2300677359 /* SelectionController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE066070285F600BD91F9 /* SelectionController.cpp */; };
A8212CD808794A2300677359 /* visible_position.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE068070285F600BD91F9 /* visible_position.cpp */; };
A8212CD908794A2300677359 /* visible_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE06A070285F600BD91F9 /* visible_text.cpp */; };
A8212CDA08794A2300677359 /* visible_units.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABE06C070285F600BD91F9 /* visible_units.cpp */; };
@@ -2525,8 +2525,8 @@
939FF8ED0702B1B100979E5E /* visible_range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visible_range.h; path = editing/visible_range.h; sourceTree = "<group>"; };
93ABCE5D06E1A42E0085925B /* formdata.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = formdata.cpp; sourceTree = "<group>"; };
93ABCE5E06E1A42E0085925B /* formdata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = formdata.h; sourceTree = "<group>"; };
- 93ABE066070285F600BD91F9 /* selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selection.cpp; path = editing/selection.cpp; sourceTree = "<group>"; };
- 93ABE067070285F600BD91F9 /* selection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = selection.h; path = editing/selection.h; sourceTree = "<group>"; };
+ 93ABE066070285F600BD91F9 /* SelectionController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectionController.cpp; path = editing/SelectionController.cpp; sourceTree = "<group>"; };
+ 93ABE067070285F600BD91F9 /* SelectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectionController.h; path = editing/SelectionController.h; sourceTree = "<group>"; };
93ABE068070285F600BD91F9 /* visible_position.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = visible_position.cpp; path = editing/visible_position.cpp; sourceTree = "<group>"; };
93ABE069070285F600BD91F9 /* visible_position.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visible_position.h; path = editing/visible_position.h; sourceTree = "<group>"; };
93ABE06A070285F600BD91F9 /* visible_text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = visible_text.cpp; path = editing/visible_text.cpp; sourceTree = "<group>"; };
@@ -6251,8 +6251,8 @@
BE02D4E7066F908A0076809F /* jsediting.cpp */,
9378D9FA07640A46004B97BF /* markup.h */,
9378D9F907640A46004B97BF /* markup.cpp */,
- 93ABE067070285F600BD91F9 /* selection.h */,
- 93ABE066070285F600BD91F9 /* selection.cpp */,
+ 93ABE067070285F600BD91F9 /* SelectionController.h */,
+ 93ABE066070285F600BD91F9 /* SelectionController.cpp */,
BECE67BD07087B250007C14B /* text_affinity.h */,
932B9834070297DC0032804F /* text_granularity.h */,
93ABE069070285F600BD91F9 /* visible_position.h */,
@@ -7233,7 +7233,7 @@
93F199EF08245E59001E9ABC /* KWQFormData.h in Headers */,
93F199F008245E59001E9ABC /* WebCoreView.h in Headers */,
93F199F108245E59001E9ABC /* WebDashboardRegion.h in Headers */,
- 93F199F208245E59001E9ABC /* selection.h in Headers */,
+ 93F199F208245E59001E9ABC /* SelectionController.h in Headers */,
93F199F308245E59001E9ABC /* visible_position.h in Headers */,
93F199F408245E59001E9ABC /* visible_text.h in Headers */,
93F199F508245E59001E9ABC /* visible_units.h in Headers */,
@@ -7581,7 +7581,7 @@
A8212BB508794A2300677359 /* KWQFormData.h in Headers */,
A8212BB608794A2300677359 /* WebCoreView.h in Headers */,
A8212BB708794A2300677359 /* WebDashboardRegion.h in Headers */,
- A8212BB808794A2300677359 /* selection.h in Headers */,
+ A8212BB808794A2300677359 /* SelectionController.h in Headers */,
A8212BB908794A2300677359 /* visible_position.h in Headers */,
A8212BBA08794A2300677359 /* visible_text.h in Headers */,
A8212BBB08794A2300677359 /* visible_units.h in Headers */,
@@ -9542,7 +9542,7 @@
93F19B0608245E59001E9ABC /* KWQFormData.mm in Sources */,
93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */,
93F19B0808245E59001E9ABC /* WebDashboardRegion.m in Sources */,
- 93F19B0908245E59001E9ABC /* selection.cpp in Sources */,
+ 93F19B0908245E59001E9ABC /* SelectionController.cpp in Sources */,
93F19B0A08245E59001E9ABC /* visible_position.cpp in Sources */,
93F19B0B08245E59001E9ABC /* visible_text.cpp in Sources */,
93F19B0C08245E59001E9ABC /* visible_units.cpp in Sources */,
@@ -9816,7 +9816,7 @@
A8212CD408794A2300677359 /* KWQFormData.mm in Sources */,
A8212CD508794A2300677359 /* WebCoreView.m in Sources */,
A8212CD608794A2300677359 /* WebDashboardRegion.m in Sources */,
- A8212CD708794A2300677359 /* selection.cpp in Sources */,
+ A8212CD708794A2300677359 /* SelectionController.cpp in Sources */,
A8212CD808794A2300677359 /* visible_position.cpp in Sources */,
A8212CD908794A2300677359 /* visible_text.cpp in Sources */,
A8212CDA08794A2300677359 /* visible_units.cpp in Sources */,
1.342 +27 -27 WebCore/khtml/khtml_part.cpp
Index: khtml_part.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
retrieving revision 1.341
retrieving revision 1.342
diff -u -r1.341 -r1.342
--- khtml_part.cpp 23 Sep 2005 03:28:28 -0000 1.341
+++ khtml_part.cpp 24 Sep 2005 01:18:51 -0000 1.342
@@ -42,7 +42,7 @@
#include "dom/dom_string.h"
#include "editing/markup.h"
#include "editing/htmlediting.h"
-#include "editing/selection.h"
+#include "editing/SelectionController.h"
#include "editing/visible_position.h"
#include "editing/visible_text.h"
#include "editing/visible_units.h"
@@ -132,7 +132,7 @@
using khtml::RenderObject;
using khtml::RenderText;
using khtml::RenderWidget;
-using khtml::Selection;
+using khtml::SelectionController;
using khtml::Tokenizer;
using khtml::TypingCommand;
using khtml::VisiblePosition;
@@ -2416,7 +2416,7 @@
d->m_view->setContentsPos(x-50, y-50);
Position p1(d->m_findNode, d->m_findPos);
Position p2(d->m_findNode, d->m_findPos + matchLen);
- Selection sel = Selection(p1, khtml::DOWNSTREAM, p2, khtml::VP_UPSTREAM_IF_POSSIBLE);
+ SelectionController sel = SelectionController(p1, khtml::DOWNSTREAM, p2, khtml::VP_UPSTREAM_IF_POSSIBLE);
if (shouldChangeSelection(sel)) {
setSelection(sel);
}
@@ -2480,7 +2480,7 @@
return d->m_selection.isCaretOrRange();
}
-const Selection &KHTMLPart::selection() const
+const SelectionController &KHTMLPart::selection() const
{
return d->m_selection;
}
@@ -2495,22 +2495,22 @@
d->m_selectionGranularity = granularity;
}
-const Selection &KHTMLPart::dragCaret() const
+const SelectionController &KHTMLPart::dragCaret() const
{
return d->m_dragCaret;
}
-const Selection &KHTMLPart::mark() const
+const SelectionController &KHTMLPart::mark() const
{
return d->m_mark;
}
-void KHTMLPart::setMark(const Selection &s)
+void KHTMLPart::setMark(const SelectionController &s)
{
d->m_mark = s;
}
-void KHTMLPart::setSelection(const Selection &s, bool closeTyping, bool keepTypingStyle)
+void KHTMLPart::setSelection(const SelectionController &s, bool closeTyping, bool keepTypingStyle)
{
if (d->m_selection == s) {
return;
@@ -2519,7 +2519,7 @@
clearCaretRectIfNeeded();
#if APPLE_CHANGES
- Selection oldSelection = d->m_selection;
+ SelectionController oldSelection = d->m_selection;
#endif
d->m_selection = s;
@@ -2545,7 +2545,7 @@
emitSelectionChanged();
}
-void KHTMLPart::setDragCaret(const Selection &dragCaret)
+void KHTMLPart::setDragCaret(const SelectionController &dragCaret)
{
if (d->m_dragCaret != dragCaret) {
d->m_dragCaret.needsCaretRepaint();
@@ -2556,7 +2556,7 @@
void KHTMLPart::clearSelection()
{
- setSelection(Selection());
+ setSelection(SelectionController());
}
void KHTMLPart::invalidateSelection()
@@ -4610,7 +4610,7 @@
void KHTMLPart::selectClosestWordFromMouseEvent(QMouseEvent *mouse, NodeImpl *innerNode, int x, int y)
{
- Selection selection;
+ SelectionController selection;
if (innerNode && innerNode->renderer() && mouseDownMayStartSelect() && innerNode->renderer()->shouldSelect()) {
VisiblePosition pos(innerNode->renderer()->positionForCoordinates(x, y));
@@ -4654,7 +4654,7 @@
if (mouse->button() == LeftButton && innerNode && innerNode->renderer() &&
mouseDownMayStartSelect() && innerNode->renderer()->shouldSelect()) {
- Selection selection;
+ SelectionController selection;
VisiblePosition pos(innerNode->renderer()->positionForCoordinates(event->x(), event->y()));
if (pos.isNotNull()) {
selection.moveTo(pos);
@@ -4680,7 +4680,7 @@
if (mouse->button() == LeftButton) {
if (innerNode && innerNode->renderer() &&
mouseDownMayStartSelect() && innerNode->renderer()->shouldSelect()) {
- Selection sel;
+ SelectionController sel;
// Extend the selection if the Shift key is down, unless the click is in a link.
bool extendSelection = (mouse->state() & ShiftButton) && (event->url().isNull());
@@ -4715,7 +4715,7 @@
}
d->m_beganSelectingText = true;
} else {
- sel = Selection(visiblePos);
+ sel = SelectionController(visiblePos);
d->m_selectionGranularity = CHARACTER;
}
@@ -4921,7 +4921,7 @@
// Restart the selection if this is the first mouse move. This work is usually
// done in khtmlMousePressEvent, but not if the mouse press was on an existing selection.
- Selection sel = selection();
+ SelectionController sel = selection();
sel.clearModifyBias();
if (!d->m_beganSelectingText) {
d->m_beganSelectingText = true;
@@ -5000,7 +5000,7 @@
&& d->m_dragStartPos.x() == event->qmouseEvent()->x()
&& d->m_dragStartPos.y() == event->qmouseEvent()->y()
&& d->m_selection.isRange()) {
- Selection selection;
+ SelectionController selection;
NodeImpl *node = event->innerNode();
if (node && node->isContentEditable() && node->renderer()) {
VisiblePosition pos = node->renderer()->positionForCoordinates(event->x(), event->y());
@@ -5174,14 +5174,14 @@
return;
NodeImpl *de = d->m_doc->documentElement();
int n = de ? de->childNodeCount() : 0;
- Selection sel = Selection(VisiblePosition(de, 0, khtml::DOWNSTREAM), VisiblePosition(de, n, khtml::DOWNSTREAM));
+ SelectionController sel = SelectionController(VisiblePosition(de, 0, khtml::DOWNSTREAM), VisiblePosition(de, n, khtml::DOWNSTREAM));
if (shouldChangeSelection(sel)) {
setSelection(sel);
}
selectFrameElementInParentIfFullySelected();
}
-bool KHTMLPart::shouldChangeSelection(const Selection &newselection) const
+bool KHTMLPart::shouldChangeSelection(const SelectionController &newselection) const
{
#if APPLE_CHANGES
return KWQ(this)->shouldChangeSelection(d->m_selection, newselection, newselection.startAffinity(), false);
@@ -5627,14 +5627,14 @@
void KHTMLPart::applyStyle(CSSStyleDeclarationImpl *style, EditAction editingAction)
{
switch (selection().state()) {
- case Selection::NONE:
+ case SelectionController::NONE:
// do nothing
break;
- case Selection::CARET: {
+ case SelectionController::CARET: {
computeAndSetTypingStyle(style, editingAction);
break;
}
- case Selection::RANGE:
+ case SelectionController::RANGE:
if (xmlDocImpl() && style) {
EditCommandPtr cmd(new ApplyStyleCommand(xmlDocImpl(), style, editingAction));
cmd.apply();
@@ -5646,11 +5646,11 @@
void KHTMLPart::applyParagraphStyle(CSSStyleDeclarationImpl *style, EditAction editingAction)
{
switch (selection().state()) {
- case Selection::NONE:
+ case SelectionController::NONE:
// do nothing
break;
- case Selection::CARET:
- case Selection::RANGE:
+ case SelectionController::CARET:
+ case SelectionController::RANGE:
if (xmlDocImpl() && style) {
EditCommandPtr cmd(new ApplyStyleCommand(xmlDocImpl(), style, editingAction, ApplyStyleCommand::ForceBlockProperties));
cmd.apply();
@@ -6006,9 +6006,9 @@
VisiblePosition afterOwnerElement(VisiblePosition(ownerElementParent, ownerElementNodeIndex + 1, khtml::VP_UPSTREAM_IF_POSSIBLE));
// Focus on the parent frame, and then select from before this element to after.
- if (parent->shouldChangeSelection(Selection(beforeOwnerElement, afterOwnerElement))) {
+ if (parent->shouldChangeSelection(SelectionController(beforeOwnerElement, afterOwnerElement))) {
parentView->setFocus();
- parent->setSelection(Selection(beforeOwnerElement, afterOwnerElement));
+ parent->setSelection(SelectionController(beforeOwnerElement, afterOwnerElement));
}
}
1.138 +9 -9 WebCore/khtml/khtml_part.h
Index: khtml_part.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -r1.137 -r1.138
--- khtml_part.h 16 Sep 2005 22:42:00 -0000 1.137
+++ khtml_part.h 24 Sep 2005 01:18:52 -0000 1.138
@@ -85,7 +85,7 @@
class RenderPart;
class RenderPartObject;
class RenderWidget;
- class Selection;
+ class SelectionController;
class XMLTokenizer;
}
@@ -599,7 +599,7 @@
/**
* Returns the selected part of the HTML.
*/
- const khtml::Selection &selection() const;
+ const khtml::SelectionController &selection() const;
/**
* Returns the granularity of the selection (character, word, line, paragraph).
@@ -614,32 +614,32 @@
/**
* Returns the drag caret of the HTML.
*/
- const khtml::Selection &dragCaret() const;
+ const khtml::SelectionController &dragCaret() const;
/**
* Sets the current selection.
*/
- void setSelection(const khtml::Selection &, bool closeTyping = true, bool keepTypingStyle = false);
+ void setSelection(const khtml::SelectionController &, bool closeTyping = true, bool keepTypingStyle = false);
/**
* Returns whether selection can be changed.
*/
- bool shouldChangeSelection(const khtml::Selection &) const;
+ bool shouldChangeSelection(const khtml::SelectionController &) const;
/**
* Returns a mark, to be used as emacs uses it.
*/
- const khtml::Selection &mark() const;
+ const khtml::SelectionController &mark() const;
/**
* Returns the mark.
*/
- void setMark(const khtml::Selection &);
+ void setMark(const khtml::SelectionController &);
/**
* Sets the current drag cart.
*/
- void setDragCaret(const khtml::Selection &);
+ void setDragCaret(const khtml::SelectionController &);
/**
* Transposes characters either side of caret selection.
@@ -1389,7 +1389,7 @@
KHTMLPartPrivate *d;
friend class KHTMLPartPrivate;
- friend class khtml::Selection;
+ friend class khtml::SelectionController;
#if APPLE_CHANGES
public:
1.59 +4 -4 WebCore/khtml/khtmlpart_p.h
Index: khtmlpart_p.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtmlpart_p.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- khtmlpart_p.h 16 Sep 2005 22:42:00 -0000 1.58
+++ khtmlpart_p.h 24 Sep 2005 01:18:52 -0000 1.59
@@ -46,7 +46,7 @@
#include "ecma/kjs_proxy.h"
#include "css/css_valueimpl.h"
#include "editing/edit_command.h"
-#include "editing/selection.h"
+#include "editing/SelectionController.h"
namespace KIO
{
@@ -372,9 +372,9 @@
QString m_overURLTarget;
#endif
- khtml::Selection m_selection;
- khtml::Selection m_dragCaret;
- khtml::Selection m_mark;
+ khtml::SelectionController m_selection;
+ khtml::SelectionController m_dragCaret;
+ khtml::SelectionController m_mark;
int m_caretBlinkTimer;
bool m_caretVisible:1;
1.180 +16 -16 WebCore/khtml/ecma/kjs_window.cpp
Index: kjs_window.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.cpp,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -r1.179 -r1.180
--- kjs_window.cpp 19 Sep 2005 18:52:11 -0000 1.179
+++ kjs_window.cpp 24 Sep 2005 01:18:53 -0000 1.180
@@ -59,7 +59,7 @@
#include "dom/dom_string.h"
#include "dom/dom_node.h"
#include "editing/htmlediting.h"
-#include "editing/selection.h"
+#include "editing/SelectionController.h"
#include "xml/dom2_eventsimpl.h"
#include "xml/dom2_rangeimpl.h"
#include "xml/dom_docimpl.h"
@@ -2574,11 +2574,11 @@
return Boolean(!m_part->selection().isRange());
case _Type: {
switch (m_part->selection().state()) {
- case khtml::Selection::NONE:
+ case khtml::SelectionController::NONE:
return String("None");
- case khtml::Selection::CARET:
+ case khtml::SelectionController::CARET:
return String("Caret");
- case khtml::Selection::RANGE:
+ case khtml::SelectionController::RANGE:
return String("Range");
}
}
@@ -2620,15 +2620,15 @@
switch (id) {
case Selection::Collapse:
TypingCommand::closeTyping(part->lastEditCommand());
- part->setSelection(khtml::Selection(Position(toNode(args[0]), args[1]->toInt32(exec)), khtml::SEL_DEFAULT_AFFINITY));
+ part->setSelection(khtml::SelectionController(Position(toNode(args[0]), args[1]->toInt32(exec)), khtml::SEL_DEFAULT_AFFINITY));
break;
case Selection::CollapseToEnd:
TypingCommand::closeTyping(part->lastEditCommand());
- part->setSelection(khtml::Selection(part->selection().end(), part->selection().endAffinity()));
+ part->setSelection(khtml::SelectionController(part->selection().end(), part->selection().endAffinity()));
break;
case Selection::CollapseToStart:
TypingCommand::closeTyping(part->lastEditCommand());
- part->setSelection(khtml::Selection(part->selection().start(), part->selection().startAffinity()));
+ part->setSelection(khtml::SelectionController(part->selection().start(), part->selection().startAffinity()));
break;
case Selection::Empty:
TypingCommand::closeTyping(part->lastEditCommand());
@@ -2638,27 +2638,27 @@
TypingCommand::closeTyping(part->lastEditCommand());
Position base(toNode(args[0]), args[1]->toInt32(exec));
Position extent(toNode(args[2]), args[3]->toInt32(exec));
- part->setSelection(khtml::Selection(base, khtml::SEL_DEFAULT_AFFINITY, extent, khtml::SEL_DEFAULT_AFFINITY));
+ part->setSelection(khtml::SelectionController(base, khtml::SEL_DEFAULT_AFFINITY, extent, khtml::SEL_DEFAULT_AFFINITY));
break;
}
case Selection::SetPosition:
TypingCommand::closeTyping(part->lastEditCommand());
- part->setSelection(khtml::Selection(Position(toNode(args[0]), args[1]->toInt32(exec)), khtml::SEL_DEFAULT_AFFINITY));
+ part->setSelection(khtml::SelectionController(Position(toNode(args[0]), args[1]->toInt32(exec)), khtml::SEL_DEFAULT_AFFINITY));
break;
case Selection::Modify: {
TypingCommand::closeTyping(part->lastEditCommand());
- khtml::Selection s(part->selection());
- khtml::Selection::EAlter alter = khtml::Selection::MOVE;
+ khtml::SelectionController s(part->selection());
+ khtml::SelectionController::EAlter alter = khtml::SelectionController::MOVE;
if (args[0]->toString(exec).domString().lower() == "extend")
- alter = khtml::Selection::EXTEND;
+ alter = khtml::SelectionController::EXTEND;
DOMString directionString = args[1]->toString(exec).domString().lower();
- khtml::Selection::EDirection direction = khtml::Selection::FORWARD;
+ khtml::SelectionController::EDirection direction = khtml::SelectionController::FORWARD;
if (directionString == "backward")
- direction = khtml::Selection::BACKWARD;
+ direction = khtml::SelectionController::BACKWARD;
else if (directionString == "left")
- direction = khtml::Selection::LEFT;
+ direction = khtml::SelectionController::LEFT;
if (directionString == "right")
- direction = khtml::Selection::RIGHT;
+ direction = khtml::SelectionController::RIGHT;
khtml::ETextGranularity granularity = khtml::CHARACTER;
DOMString granularityString = args[2]->toString(exec).domString().lower();
if (granularityString == "word")
1.94 +53 -53 WebCore/khtml/editing/SelectionController.cpp
Index: SelectionController.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/SelectionController.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- SelectionController.cpp 16 Sep 2005 22:42:07 -0000 1.93
+++ SelectionController.cpp 24 Sep 2005 01:18:54 -0000 1.94
@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "selection.h"
+#include "SelectionController.h"
#include <qevent.h>
#include <qpainter.h>
@@ -61,47 +61,47 @@
namespace khtml {
-Selection::Selection()
+SelectionController::SelectionController()
{
init(DOWNSTREAM);
}
-Selection::Selection(const Position &pos, EAffinity affinity)
+SelectionController::SelectionController(const Position &pos, EAffinity affinity)
: m_base(pos), m_extent(pos)
{
init(affinity);
validate();
}
-Selection::Selection(const RangeImpl *r, EAffinity baseAffinity, EAffinity extentAffinity)
+SelectionController::SelectionController(const RangeImpl *r, EAffinity baseAffinity, EAffinity extentAffinity)
: m_base(startPosition(r)), m_extent(endPosition(r))
{
init(baseAffinity);
validate();
}
-Selection::Selection(const Position &base, EAffinity baseAffinity, const Position &extent, EAffinity extentAffinity)
+SelectionController::SelectionController(const Position &base, EAffinity baseAffinity, const Position &extent, EAffinity extentAffinity)
: m_base(base), m_extent(extent)
{
init(baseAffinity);
validate();
}
-Selection::Selection(const VisiblePosition &visiblePos)
+SelectionController::SelectionController(const VisiblePosition &visiblePos)
: m_base(visiblePos.position()), m_extent(visiblePos.position())
{
init(visiblePos.affinity());
validate();
}
-Selection::Selection(const VisiblePosition &base, const VisiblePosition &extent)
+SelectionController::SelectionController(const VisiblePosition &base, const VisiblePosition &extent)
: m_base(base.position()), m_extent(extent.position())
{
init(base.affinity());
validate();
}
-Selection::Selection(const Selection &o)
+SelectionController::SelectionController(const SelectionController &o)
: m_base(o.m_base), m_extent(o.m_extent)
, m_start(o.m_start), m_end(o.m_end)
, m_state(o.m_state), m_affinity(o.m_affinity)
@@ -120,7 +120,7 @@
}
}
-void Selection::init(EAffinity affinity)
+void SelectionController::init(EAffinity affinity)
{
// FIXME: set extentAffinity
m_state = NONE;
@@ -130,7 +130,7 @@
m_modifyBiasSet = false;
}
-Selection &Selection::operator=(const Selection &o)
+SelectionController &SelectionController::operator=(const SelectionController &o)
{
m_base = o.m_base;
m_extent = o.m_extent;
@@ -157,7 +157,7 @@
return *this;
}
-void Selection::moveTo(const VisiblePosition &pos)
+void SelectionController::moveTo(const VisiblePosition &pos)
{
// FIXME: use extentAffinity
m_affinity = pos.affinity();
@@ -166,7 +166,7 @@
validate();
}
-void Selection::moveTo(const VisiblePosition &base, const VisiblePosition &extent)
+void SelectionController::moveTo(const VisiblePosition &base, const VisiblePosition &extent)
{
// FIXME: use extentAffinity
m_affinity = base.affinity();
@@ -175,7 +175,7 @@
validate();
}
-void Selection::moveTo(const Selection &o)
+void SelectionController::moveTo(const SelectionController &o)
{
// FIXME: copy extentAffinity
m_affinity = o.m_affinity;
@@ -184,7 +184,7 @@
validate();
}
-void Selection::moveTo(const Position &pos, EAffinity affinity)
+void SelectionController::moveTo(const Position &pos, EAffinity affinity)
{
// FIXME: use extentAffinity
m_affinity = affinity;
@@ -193,7 +193,7 @@
validate();
}
-void Selection::moveTo(const RangeImpl *r, EAffinity baseAffinity, EAffinity extentAffinity)
+void SelectionController::moveTo(const RangeImpl *r, EAffinity baseAffinity, EAffinity extentAffinity)
{
// FIXME: use extentAffinity
m_affinity = baseAffinity;
@@ -202,7 +202,7 @@
validate();
}
-void Selection::moveTo(const Position &base, EAffinity baseAffinity, const Position &extent, EAffinity extentAffinity)
+void SelectionController::moveTo(const Position &base, EAffinity baseAffinity, const Position &extent, EAffinity extentAffinity)
{
// FIXME: use extentAffinity
m_affinity = baseAffinity;
@@ -211,7 +211,7 @@
validate();
}
-void Selection::setModifyBias(EAlter alter, EDirection direction)
+void SelectionController::setModifyBias(EAlter alter, EDirection direction)
{
switch (alter) {
case MOVE:
@@ -238,7 +238,7 @@
}
}
-VisiblePosition Selection::modifyExtendingRightForward(ETextGranularity granularity)
+VisiblePosition SelectionController::modifyExtendingRightForward(ETextGranularity granularity)
{
VisiblePosition pos(m_extent, m_affinity);
switch (granularity) {
@@ -268,7 +268,7 @@
return pos;
}
-VisiblePosition Selection::modifyMovingRightForward(ETextGranularity granularity)
+VisiblePosition SelectionController::modifyMovingRightForward(ETextGranularity granularity)
{
VisiblePosition pos;
switch (granularity) {
@@ -305,7 +305,7 @@
return pos;
}
-VisiblePosition Selection::modifyExtendingLeftBackward(ETextGranularity granularity)
+VisiblePosition SelectionController::modifyExtendingLeftBackward(ETextGranularity granularity)
{
VisiblePosition pos(m_extent, m_affinity);
switch (granularity) {
@@ -334,7 +334,7 @@
return pos;
}
-VisiblePosition Selection::modifyMovingLeftBackward(ETextGranularity granularity)
+VisiblePosition SelectionController::modifyMovingLeftBackward(ETextGranularity granularity)
{
VisiblePosition pos;
switch (granularity) {
@@ -366,7 +366,7 @@
return pos;
}
-bool Selection::modify(EAlter alter, EDirection dir, ETextGranularity granularity)
+bool SelectionController::modify(EAlter alter, EDirection dir, ETextGranularity granularity)
{
setModifyBias(alter, dir);
@@ -423,7 +423,7 @@
return true;
}
-bool Selection::modify(EAlter alter, int verticalDistance)
+bool SelectionController::modify(EAlter alter, int verticalDistance)
{
if (verticalDistance == 0)
return false;
@@ -490,7 +490,7 @@
return true;
}
-bool Selection::expandUsingGranularity(ETextGranularity granularity)
+bool SelectionController::expandUsingGranularity(ETextGranularity granularity)
{
if (isNone())
return false;
@@ -498,7 +498,7 @@
return true;
}
-int Selection::xPosForVerticalArrowNavigation(EPositionType type, bool recalc) const
+int SelectionController::xPosForVerticalArrowNavigation(EPositionType type, bool recalc) const
{
int x = 0;
@@ -543,7 +543,7 @@
return x;
}
-void Selection::clear()
+void SelectionController::clear()
{
m_affinity = SEL_DEFAULT_AFFINITY;
m_base.clear();
@@ -551,21 +551,21 @@
validate();
}
-void Selection::setBase(const VisiblePosition &pos)
+void SelectionController::setBase(const VisiblePosition &pos)
{
m_affinity = pos.affinity();
m_base = pos.deepEquivalent();
validate();
}
-void Selection::setExtent(const VisiblePosition &pos)
+void SelectionController::setExtent(const VisiblePosition &pos)
{
// FIXME: Support extentAffinity
m_extent = pos.deepEquivalent();
validate();
}
-void Selection::setBaseAndExtent(const VisiblePosition &base, const VisiblePosition &extent)
+void SelectionController::setBaseAndExtent(const VisiblePosition &base, const VisiblePosition &extent)
{
// FIXME: Support extentAffinity
m_affinity = base.affinity();
@@ -575,14 +575,14 @@
}
-void Selection::setBase(const Position &pos, EAffinity baseAffinity)
+void SelectionController::setBase(const Position &pos, EAffinity baseAffinity)
{
m_affinity = baseAffinity;
m_base = pos;
validate();
}
-void Selection::setExtent(const Position &pos, EAffinity extentAffinity)
+void SelectionController::setExtent(const Position &pos, EAffinity extentAffinity)
{
// FIXME: Support extentAffinity for real
m_affinity = extentAffinity;
@@ -590,7 +590,7 @@
validate();
}
-void Selection::setBaseAndExtent(const Position &base, EAffinity baseAffinity, const Position &extent, EAffinity extentAffinity)
+void SelectionController::setBaseAndExtent(const Position &base, EAffinity baseAffinity, const Position &extent, EAffinity extentAffinity)
{
// FIXME: extentAffinity
m_affinity = baseAffinity;
@@ -599,12 +599,12 @@
validate();
}
-void Selection::setNeedsLayout(bool flag)
+void SelectionController::setNeedsLayout(bool flag)
{
m_needsLayout = flag;
}
-SharedPtr<RangeImpl> Selection::toRange() const
+SharedPtr<RangeImpl> SelectionController::toRange() const
{
if (isNone())
return SharedPtr<RangeImpl>();
@@ -653,18 +653,18 @@
SharedPtr<RangeImpl> result(new RangeImpl(s.node()->docPtr()));
result->setStart(s.node(), s.offset(), exceptionCode);
if (exceptionCode) {
- ERROR("Exception setting Range start from Selection: %d", exceptionCode);
+ ERROR("Exception setting Range start from SelectionController: %d", exceptionCode);
return SharedPtr<RangeImpl>();
}
result->setEnd(e.node(), e.offset(), exceptionCode);
if (exceptionCode) {
- ERROR("Exception setting Range end from Selection: %d", exceptionCode);
+ ERROR("Exception setting Range end from SelectionController: %d", exceptionCode);
return SharedPtr<RangeImpl>();
}
return result;
}
-void Selection::layout()
+void SelectionController::layout()
{
if (isNone() || !m_start.node()->inDocument() || !m_end.node()->inDocument()) {
m_caretRect = QRect();
@@ -714,25 +714,25 @@
m_needsLayout = false;
}
-QRect Selection::caretRect() const
+QRect SelectionController::caretRect() const
{
if (m_needsLayout) {
- const_cast<Selection *>(this)->layout();
+ const_cast<SelectionController *>(this)->layout();
}
return m_caretRect;
}
-QRect Selection::expectedVisibleRect() const
+QRect SelectionController::expectedVisibleRect() const
{
if (m_needsLayout) {
- const_cast<Selection *>(this)->layout();
+ const_cast<SelectionController *>(this)->layout();
}
return m_expectedVisibleRect;
}
-QRect Selection::caretRepaintRect() const
+QRect SelectionController::caretRepaintRect() const
{
// FIXME: Add one pixel of slop on each side to make sure we don't leave behind artifacts.
QRect r = caretRect();
@@ -741,7 +741,7 @@
return QRect(r.left() - 1, r.top() - 1, r.width() + 2, r.height() + 2);
}
-void Selection::needsCaretRepaint()
+void SelectionController::needsCaretRepaint()
{
if (!isCaret())
return;
@@ -774,7 +774,7 @@
v->updateContents(caretRepaintRect(), false);
}
-void Selection::paintCaret(QPainter *p, const QRect &rect)
+void SelectionController::paintCaret(QPainter *p, const QRect &rect)
{
if (m_state != CARET)
return;
@@ -786,7 +786,7 @@
p->fillRect(m_caretRect & rect, QBrush());
}
-void Selection::validate(ETextGranularity granularity)
+void SelectionController::validate(ETextGranularity granularity)
{
// Move the selection to rendered positions, if possible.
Position originalBase(m_base);
@@ -933,7 +933,7 @@
#endif
}
-void Selection::debugRenderer(RenderObject *r, bool selected) const
+void SelectionController::debugRenderer(RenderObject *r, bool selected) const
{
if (r->node()->isElementNode()) {
ElementImpl *element = static_cast<ElementImpl *>(r->node());
@@ -1006,7 +1006,7 @@
}
}
-void Selection::debugPosition() const
+void SelectionController::debugPosition() const
{
if (!m_start.node())
return;
@@ -1015,18 +1015,18 @@
//RenderObject *r = 0;
- fprintf(stderr, "Selection =================\n");
+ fprintf(stderr, "SelectionController =================\n");
if (m_start == m_end) {
Position pos = m_start;
- fprintf(stderr, "pos: %s %p:%d\n", pos.node()->nodeName().qstring().latin1(), pos.node(), pos.offset());
+ fprintf(stderr, "pos: %s %p:%ld\n", pos.node()->nodeName().qstring().latin1(), pos.node(), pos.offset());
}
else {
Position pos = m_start;
- fprintf(stderr, "start: %s %p:%d\n", pos.node()->nodeName().qstring().latin1(), pos.node(), pos.offset());
+ fprintf(stderr, "start: %s %p:%ld\n", pos.node()->nodeName().qstring().latin1(), pos.node(), pos.offset());
fprintf(stderr, "-----------------------------------\n");
pos = m_end;
- fprintf(stderr, "end: %s %p:%d\n", pos.node()->nodeName().qstring().latin1(), pos.node(), pos.offset());
+ fprintf(stderr, "end: %s %p:%ld\n", pos.node()->nodeName().qstring().latin1(), pos.node(), pos.offset());
fprintf(stderr, "-----------------------------------\n");
}
@@ -1071,7 +1071,7 @@
#ifndef NDEBUG
#define FormatBufferSize 1024
-void Selection::formatForDebugger(char *buffer, unsigned length) const
+void SelectionController::formatForDebugger(char *buffer, unsigned length) const
{
DOMString result;
DOMString s;
@@ -1093,7 +1093,7 @@
}
#undef FormatBufferSize
-void Selection::showTree() const
+void SelectionController::showTree() const
{
if (m_start.node())
m_start.node()->showTreeAndMark(m_start.node(), "S", m_end.node(), "E");
1.41 +13 -13 WebCore/khtml/editing/SelectionController.h
Index: SelectionController.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/SelectionController.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- SelectionController.h 1 Sep 2005 18:03:32 -0000 1.40
+++ SelectionController.h 24 Sep 2005 01:18:54 -0000 1.41
@@ -39,7 +39,7 @@
class RenderObject;
class VisiblePosition;
-class Selection
+class SelectionController
{
public:
enum EState { NONE, CARET, RANGE };
@@ -50,23 +50,23 @@
typedef DOM::Position Position;
typedef DOM::RangeImpl RangeImpl;
- Selection();
- Selection(const RangeImpl *, EAffinity baseAffinity, EAffinity extentAffinity);
- Selection(const VisiblePosition &);
- Selection(const VisiblePosition &, const VisiblePosition &);
- Selection(const Position &, EAffinity affinity);
- Selection(const Position &, EAffinity, const Position &, EAffinity);
- Selection(const Selection &);
+ SelectionController();
+ SelectionController(const RangeImpl *, EAffinity baseAffinity, EAffinity extentAffinity);
+ SelectionController(const VisiblePosition &);
+ SelectionController(const VisiblePosition &, const VisiblePosition &);
+ SelectionController(const Position &, EAffinity affinity);
+ SelectionController(const Position &, EAffinity, const Position &, EAffinity);
+ SelectionController(const SelectionController &);
- Selection &operator=(const Selection &o);
- Selection &operator=(const VisiblePosition &r) { moveTo(r); return *this; }
+ SelectionController &operator=(const SelectionController &o);
+ SelectionController &operator=(const VisiblePosition &r) { moveTo(r); return *this; }
void moveTo(const RangeImpl *, EAffinity baseAffinity, EAffinity extentAffinity);
void moveTo(const VisiblePosition &);
void moveTo(const VisiblePosition &, const VisiblePosition &);
void moveTo(const Position &, EAffinity);
void moveTo(const Position &, EAffinity, const Position &, EAffinity);
- void moveTo(const Selection &);
+ void moveTo(const SelectionController &);
EState state() const { return m_state; }
@@ -153,12 +153,12 @@
// modified with EAlter::EXTEND
};
-inline bool operator==(const Selection &a, const Selection &b)
+inline bool operator==(const SelectionController &a, const SelectionController &b)
{
return a.start() == b.start() && a.end() == b.end() && a.startAffinity() == b.startAffinity();
}
-inline bool operator!=(const Selection &a, const Selection &b)
+inline bool operator!=(const SelectionController &a, const SelectionController &b)
{
return !(a == b);
}
1.14 +9 -9 WebCore/khtml/editing/apply_style_command.cpp
Index: apply_style_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/apply_style_command.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- apply_style_command.cpp 16 Sep 2005 22:42:06 -0000 1.13
+++ apply_style_command.cpp 24 Sep 2005 01:18:54 -0000 1.14
@@ -398,7 +398,7 @@
return;
// Adjust to the positions we want to use for applying style.
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
Position start(selection.start().downstream());
Position end(selection.end().upstream());
if (RangeImpl::compareBoundaryPoints(end, start) < 0) {
@@ -904,7 +904,7 @@
ASSERT(s.node()->inDocument());
ASSERT(e.node()->inDocument());
- setEndingSelection(Selection(s, VP_DEFAULT_AFFINITY, e, VP_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(s, VP_DEFAULT_AFFINITY, e, VP_DEFAULT_AFFINITY));
}
bool ApplyStyleCommand::nodeFullySelected(NodeImpl *node, const Position &start, const Position &end) const
@@ -936,7 +936,7 @@
int endOffsetAdjustment = start.node() == end.node() ? start.offset() : 0;
TextImpl *text = static_cast<TextImpl *>(start.node());
splitTextNode(text, start.offset());
- setEndingSelection(Selection(Position(start.node(), 0), SEL_DEFAULT_AFFINITY, Position(end.node(), end.offset() - endOffsetAdjustment), SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(Position(start.node(), 0), SEL_DEFAULT_AFFINITY, Position(end.node(), end.offset() - endOffsetAdjustment), SEL_DEFAULT_AFFINITY));
return true;
}
return false;
@@ -952,7 +952,7 @@
ASSERT(prevNode);
NodeImpl *startNode = start.node() == end.node() ? prevNode : start.node();
ASSERT(startNode);
- setEndingSelection(Selection(Position(startNode, start.offset()), SEL_DEFAULT_AFFINITY, Position(prevNode, prevNode->caretMaxOffset()), SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(Position(startNode, start.offset()), SEL_DEFAULT_AFFINITY, Position(prevNode, prevNode->caretMaxOffset()), SEL_DEFAULT_AFFINITY));
return true;
}
return false;
@@ -965,7 +965,7 @@
TextImpl *text = static_cast<TextImpl *>(start.node());
splitTextNodeContainingElement(text, start.offset());
- setEndingSelection(Selection(Position(start.node()->parentNode(), start.node()->nodeIndex()), SEL_DEFAULT_AFFINITY, Position(end.node(), end.offset() - endOffsetAdjustment), SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(Position(start.node()->parentNode(), start.node()->nodeIndex()), SEL_DEFAULT_AFFINITY, Position(end.node(), end.offset() - endOffsetAdjustment), SEL_DEFAULT_AFFINITY));
return true;
}
return false;
@@ -981,7 +981,7 @@
ASSERT(prevNode);
NodeImpl *startNode = start.node() == end.node() ? prevNode : start.node();
ASSERT(startNode);
- setEndingSelection(Selection(Position(startNode, start.offset()), SEL_DEFAULT_AFFINITY, Position(prevNode->parent(), prevNode->nodeIndex() + 1), SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(Position(startNode, start.offset()), SEL_DEFAULT_AFFINITY, Position(prevNode->parent(), prevNode->nodeIndex() + 1), SEL_DEFAULT_AFFINITY));
return true;
}
return false;
@@ -1056,7 +1056,7 @@
int startOffsetAdjustment = startChild->nodeIndex();
int endOffsetAdjustment = startNode == end.node() ? startOffsetAdjustment : 0;
- setEndingSelection(Selection(Position(startNode, startOffsetAdjustment), SEL_DEFAULT_AFFINITY,
+ setEndingSelection(SelectionController(Position(startNode, startOffsetAdjustment), SEL_DEFAULT_AFFINITY,
Position(end.node(), end.offset() + endOffsetAdjustment), SEL_DEFAULT_AFFINITY));
return true;
@@ -1099,7 +1099,7 @@
int endOffset = nextChild ? nextChild->nodeIndex() : nextElement->childNodes()->length();
- setEndingSelection(Selection(Position(startNode, start.offset()), SEL_DEFAULT_AFFINITY,
+ setEndingSelection(SelectionController(Position(startNode, start.offset()), SEL_DEFAULT_AFFINITY,
Position(nextElement, endOffset), SEL_DEFAULT_AFFINITY));
return true;
}
@@ -1288,7 +1288,7 @@
}
}
- setEndingSelection(Selection(newStart, SEL_DEFAULT_AFFINITY, newEnd, SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(newStart, SEL_DEFAULT_AFFINITY, newEnd, SEL_DEFAULT_AFFINITY));
}
} // namespace khtml
1.7 +1 -1 WebCore/khtml/editing/break_blockquote_command.cpp
Index: break_blockquote_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/break_blockquote_command.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- break_blockquote_command.cpp 16 Sep 2005 22:42:06 -0000 1.6
+++ break_blockquote_command.cpp 24 Sep 2005 01:18:55 -0000 1.7
@@ -62,7 +62,7 @@
void BreakBlockquoteCommand::doApply()
{
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
if (selection.isNone())
return;
1.12 +2 -2 WebCore/khtml/editing/composite_edit_command.cpp
Index: composite_edit_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/composite_edit_command.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- composite_edit_command.cpp 16 Sep 2005 22:42:06 -0000 1.11
+++ composite_edit_command.cpp 24 Sep 2005 01:18:55 -0000 1.12
@@ -287,7 +287,7 @@
}
}
-void CompositeEditCommand::deleteSelection(const Selection &selection, bool smartDelete, bool mergeBlocksAfterDelete)
+void CompositeEditCommand::deleteSelection(const SelectionController &selection, bool smartDelete, bool mergeBlocksAfterDelete)
{
if (selection.isRange()) {
EditCommandPtr cmd(new DeleteSelectionCommand(document(), selection, smartDelete, mergeBlocksAfterDelete));
@@ -318,7 +318,7 @@
void CompositeEditCommand::rebalanceWhitespace()
{
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
if (selection.isCaretOrRange()) {
EditCommandPtr startCmd(new RebalanceWhitespaceCommand(document(), endingSelection().start()));
applyCommandToComposite(startCmd);
1.4 +1 -1 WebCore/khtml/editing/composite_edit_command.h
Index: composite_edit_command.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/composite_edit_command.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- composite_edit_command.h 16 Sep 2005 22:42:06 -0000 1.3
+++ composite_edit_command.h 24 Sep 2005 01:18:55 -0000 1.4
@@ -55,7 +55,7 @@
void applyStyle(DOM::CSSStyleDeclarationImpl *style, EditAction editingAction=EditActionChangeAttributes);
void deleteKeyPressed();
void deleteSelection(bool smartDelete=false, bool mergeBlocksAfterDelete=true);
- void deleteSelection(const Selection &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
+ void deleteSelection(const SelectionController &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
void deleteTextFromNode(DOM::TextImpl *node, int offset, int count);
void inputText(const DOM::DOMString &text, bool selectInsertedText = false);
void insertNodeAfter(DOM::NodeImpl *insertChild, DOM::NodeImpl *refChild);
1.17 +4 -4 WebCore/khtml/editing/delete_selection_command.cpp
Index: delete_selection_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/delete_selection_command.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- delete_selection_command.cpp 25 Aug 2005 23:13:44 -0000 1.16
+++ delete_selection_command.cpp 24 Sep 2005 01:18:55 -0000 1.17
@@ -135,7 +135,7 @@
{
}
-DeleteSelectionCommand::DeleteSelectionCommand(DocumentImpl *document, const Selection &selection, bool smartDelete, bool mergeBlocksAfterDelete)
+DeleteSelectionCommand::DeleteSelectionCommand(DocumentImpl *document, const SelectionController &selection, bool smartDelete, bool mergeBlocksAfterDelete)
: CompositeEditCommand(document),
m_hasSelectionToDelete(true),
m_smartDelete(smartDelete),
@@ -675,7 +675,7 @@
Position pastPlaceholder(insertedPlaceholder, 1);
- setEndingSelection(Selection(m_endingPosition, m_selectionToDelete.endAffinity(), pastPlaceholder, DOWNSTREAM));
+ setEndingSelection(SelectionController(m_endingPosition, m_selectionToDelete.endAffinity(), pastPlaceholder, DOWNSTREAM));
applyStyle(m_typingStyle, EditActionUnspecified);
@@ -761,7 +761,7 @@
if (handleSpecialCaseBRDelete()) {
calculateTypingStyleAfterDelete(false);
debugPosition("endingPosition ", m_endingPosition);
- setEndingSelection(Selection(m_endingPosition, affinity));
+ setEndingSelection(SelectionController(m_endingPosition, affinity));
clearTransientState();
rebalanceWhitespace();
return;
@@ -790,7 +790,7 @@
calculateTypingStyleAfterDelete(addedPlaceholder);
debugPosition("endingPosition ", m_endingPosition);
- setEndingSelection(Selection(m_endingPosition, affinity));
+ setEndingSelection(SelectionController(m_endingPosition, affinity));
clearTransientState();
rebalanceWhitespace();
}
1.5 +2 -2 WebCore/khtml/editing/delete_selection_command.h
Index: delete_selection_command.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/delete_selection_command.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- delete_selection_command.h 29 Jul 2005 22:50:48 -0000 1.4
+++ delete_selection_command.h 24 Sep 2005 01:18:55 -0000 1.5
@@ -34,7 +34,7 @@
{
public:
DeleteSelectionCommand(DOM::DocumentImpl *document, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
- DeleteSelectionCommand(DOM::DocumentImpl *document, const Selection &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
+ DeleteSelectionCommand(DOM::DocumentImpl *document, const SelectionController &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
virtual void doApply();
virtual EditAction editingAction() const;
@@ -61,7 +61,7 @@
bool m_trailingWhitespaceValid;
// This data is transient and should be cleared at the end of the doApply function.
- Selection m_selectionToDelete;
+ SelectionController m_selectionToDelete;
DOM::Position m_upstreamStart;
DOM::Position m_downstreamStart;
DOM::Position m_upstreamEnd;
1.7 +18 -18 WebCore/khtml/editing/edit_command.cpp
Index: edit_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/edit_command.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- edit_command.cpp 29 Jul 2005 23:42:45 -0000 1.6
+++ edit_command.cpp 24 Sep 2005 01:18:55 -0000 1.7
@@ -24,7 +24,7 @@
*/
#include "edit_command.h"
-#include "selection.h"
+#include "SelectionController.h"
#include "khtml_part.h"
#include "htmlediting.h"
@@ -124,19 +124,19 @@
return get()->document();
}
-Selection EditCommandPtr::startingSelection() const
+SelectionController EditCommandPtr::startingSelection() const
{
- IF_IMPL_NULL_RETURN_ARG(Selection());
+ IF_IMPL_NULL_RETURN_ARG(SelectionController());
return get()->startingSelection();
}
-Selection EditCommandPtr::endingSelection() const
+SelectionController EditCommandPtr::endingSelection() const
{
- IF_IMPL_NULL_RETURN_ARG(Selection());
+ IF_IMPL_NULL_RETURN_ARG(SelectionController());
return get()->endingSelection();
}
-void EditCommandPtr::setStartingSelection(const Selection &s) const
+void EditCommandPtr::setStartingSelection(const SelectionController &s) const
{
IF_IMPL_NULL_RETURN;
get()->setStartingSelection(s);
@@ -151,11 +151,11 @@
void EditCommandPtr::setStartingSelection(const Position &p, EAffinity affinity) const
{
IF_IMPL_NULL_RETURN;
- Selection s = Selection(p, affinity);
+ SelectionController s = SelectionController(p, affinity);
get()->setStartingSelection(s);
}
-void EditCommandPtr::setEndingSelection(const Selection &s) const
+void EditCommandPtr::setEndingSelection(const SelectionController &s) const
{
IF_IMPL_NULL_RETURN;
get()->setEndingSelection(s);
@@ -170,7 +170,7 @@
void EditCommandPtr::setEndingSelection(const Position &p, EAffinity affinity) const
{
IF_IMPL_NULL_RETURN;
- Selection s = Selection(p, affinity);
+ SelectionController s = SelectionController(p, affinity);
get()->setEndingSelection(s);
}
@@ -213,7 +213,7 @@
m_startingSelection = m_document->part()->selection();
m_endingSelection = m_startingSelection;
- m_document->part()->setSelection(Selection(), false, true);
+ m_document->part()->setSelection(SelectionController(), false, true);
}
EditCommand::~EditCommand()
@@ -261,7 +261,7 @@
KHTMLPart *part = m_document->part();
if (topLevel) {
- part->setSelection(Selection(), false, true);
+ part->setSelection(SelectionController(), false, true);
}
ASSERT(part->selection().isNone());
@@ -287,7 +287,7 @@
KHTMLPart *part = m_document->part();
if (topLevel) {
- part->setSelection(Selection(), false, true);
+ part->setSelection(SelectionController(), false, true);
}
ASSERT(part->selection().isNone());
@@ -312,7 +312,7 @@
return EditActionUnspecified;
}
-void EditCommand::setStartingSelection(const Selection &s)
+void EditCommand::setStartingSelection(const SelectionController &s)
{
for (EditCommand *cmd = this; cmd; cmd = cmd->m_parent)
cmd->m_startingSelection = s;
@@ -320,19 +320,19 @@
void EditCommand::setStartingSelection(const VisiblePosition &p)
{
- Selection s = Selection(p);
+ SelectionController s = SelectionController(p);
for (EditCommand *cmd = this; cmd; cmd = cmd->m_parent)
cmd->m_startingSelection = s;
}
void EditCommand::setStartingSelection(const Position &p, EAffinity affinity)
{
- Selection s = Selection(p, affinity);
+ SelectionController s = SelectionController(p, affinity);
for (EditCommand *cmd = this; cmd; cmd = cmd->m_parent)
cmd->m_startingSelection = s;
}
-void EditCommand::setEndingSelection(const Selection &s)
+void EditCommand::setEndingSelection(const SelectionController &s)
{
for (EditCommand *cmd = this; cmd; cmd = cmd->m_parent)
cmd->m_endingSelection = s;
@@ -340,14 +340,14 @@
void EditCommand::setEndingSelection(const VisiblePosition &p)
{
- Selection s = Selection(p);
+ SelectionController s = SelectionController(p);
for (EditCommand *cmd = this; cmd; cmd = cmd->m_parent)
cmd->m_endingSelection = s;
}
void EditCommand::setEndingSelection(const Position &p, EAffinity affinity)
{
- Selection s = Selection(p, affinity);
+ SelectionController s = SelectionController(p, affinity);
for (EditCommand *cmd = this; cmd; cmd = cmd->m_parent)
cmd->m_endingSelection = s;
}
1.3 +11 -11 WebCore/khtml/editing/edit_command.h
Index: edit_command.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/edit_command.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- edit_command.h 12 May 2005 04:00:19 -0000 1.2
+++ edit_command.h 24 Sep 2005 01:18:56 -0000 1.3
@@ -28,7 +28,7 @@
#include "misc/shared.h"
#include "edit_actions.h"
-#include "selection.h"
+#include "SelectionController.h"
namespace DOM {
class CSSMutableStyleDeclarationImpl;
@@ -64,18 +64,18 @@
virtual DOM::DocumentImpl * const document() const { return m_document; }
- Selection startingSelection() const { return m_startingSelection; }
- Selection endingSelection() const { return m_endingSelection; }
+ SelectionController startingSelection() const { return m_startingSelection; }
+ SelectionController endingSelection() const { return m_endingSelection; }
void setEndingSelectionNeedsLayout(bool flag=true) { m_endingSelection.setNeedsLayout(flag); }
ECommandState state() const { return m_state; }
void setState(ECommandState state) { m_state = state; }
- void setStartingSelection(const Selection &s);
+ void setStartingSelection(const SelectionController &s);
void setStartingSelection(const VisiblePosition &p);
void setStartingSelection(const DOM::Position &p, EAffinity affinity);
- void setEndingSelection(const Selection &s);
+ void setEndingSelection(const SelectionController &s);
void setEndingSelection(const VisiblePosition &p);
void setEndingSelection(const DOM::Position &p, EAffinity affinity);
@@ -94,8 +94,8 @@
DOM::DocumentImpl *m_document;
ECommandState m_state;
- Selection m_startingSelection;
- Selection m_endingSelection;
+ SelectionController m_startingSelection;
+ SelectionController m_endingSelection;
DOM::CSSMutableStyleDeclarationImpl *m_typingStyle;
EditCommand *m_parent;
};
@@ -120,13 +120,13 @@
DOM::DocumentImpl * const document() const;
- Selection startingSelection() const;
- Selection endingSelection() const;
+ SelectionController startingSelection() const;
+ SelectionController endingSelection() const;
- void setStartingSelection(const Selection &s) const;
+ void setStartingSelection(const SelectionController &s) const;
void setStartingSelection(const VisiblePosition &p) const;
void setStartingSelection(const DOM::Position &p, EAffinity affinity) const;
- void setEndingSelection(const Selection &s) const;
+ void setEndingSelection(const SelectionController &s) const;
void setEndingSelection(const VisiblePosition &p) const;
void setEndingSelection(const DOM::Position &p, EAffinity affinity) const;
1.111 +0 -1 WebCore/khtml/editing/htmlediting.h
Index: htmlediting.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- htmlediting.h 5 Aug 2005 18:22:43 -0000 1.110
+++ htmlediting.h 24 Sep 2005 01:18:56 -0000 1.111
@@ -39,7 +39,6 @@
#include "qmap.h"
#include "qptrlist.h"
#include "qvaluelist.h"
-#include "selection.h"
#include "shared.h"
#define NON_BREAKING_SPACE 0xa0
1.6 +4 -4 WebCore/khtml/editing/insert_line_break_command.cpp
Index: insert_line_break_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_line_break_command.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- insert_line_break_command.cpp 25 Aug 2005 23:13:44 -0000 1.5
+++ insert_line_break_command.cpp 24 Sep 2005 01:18:56 -0000 1.6
@@ -94,7 +94,7 @@
void InsertLineBreakCommand::doApply()
{
deleteSelection();
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
ElementImpl *breakNode = createBreakElement(document());
NodeImpl *nodeToInsert = breakNode;
@@ -122,7 +122,7 @@
bool hasTrailingBR = next && next->hasTagName(brTag) && pos.node()->enclosingBlockFlowElement() == next->enclosingBlockFlowElement();
insertNodeAfterPosition(nodeToInsert, pos);
if (hasTrailingBR) {
- setEndingSelection(Selection(Position(next, 0), DOWNSTREAM));
+ setEndingSelection(SelectionController(Position(next, 0), DOWNSTREAM));
}
else if (!document()->inStrictMode()) {
// Insert an "extra" BR at the end of the block.
@@ -179,7 +179,7 @@
CSSMutableStyleDeclarationImpl *typingStyle = document()->part()->typingStyle();
if (typingStyle && typingStyle->length() > 0) {
- Selection selectionBeforeStyle = endingSelection();
+ SelectionController selectionBeforeStyle = endingSelection();
DOM::RangeImpl *rangeAroundNode = document()->createRange();
int exception = 0;
@@ -187,7 +187,7 @@
// affinity is not really important since this is a temp selection
// just for calling applyStyle
- setEndingSelection(Selection(rangeAroundNode, khtml::SEL_DEFAULT_AFFINITY, khtml::SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(rangeAroundNode, khtml::SEL_DEFAULT_AFFINITY, khtml::SEL_DEFAULT_AFFINITY));
applyStyle(typingStyle);
setEndingSelection(selectionBeforeStyle);
1.7 +1 -1 WebCore/khtml/editing/insert_paragraph_separator_command.cpp
Index: insert_paragraph_separator_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_paragraph_separator_command.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- insert_paragraph_separator_command.cpp 16 Sep 2005 22:42:06 -0000 1.6
+++ insert_paragraph_separator_command.cpp 24 Sep 2005 01:18:56 -0000 1.7
@@ -112,7 +112,7 @@
void InsertParagraphSeparatorCommand::doApply()
{
bool splitText = false;
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
if (selection.isNone())
return;
1.8 +2 -2 WebCore/khtml/editing/insert_text_command.cpp
Index: insert_text_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_text_command.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- insert_text_command.cpp 16 Sep 2005 22:42:06 -0000 1.7
+++ insert_text_command.cpp 24 Sep 2005 01:18:56 -0000 1.8
@@ -123,7 +123,7 @@
{
assert(text.find('\n') == -1);
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
bool adjustDownstream = isStartOfLine(VisiblePosition(selection.start().downstream(), DOWNSTREAM));
// Delete the current selection, or collapse whitespace, as needed
@@ -194,7 +194,7 @@
}
}
- setEndingSelection(Selection(startPosition, DOWNSTREAM, endPosition, SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(startPosition, DOWNSTREAM, endPosition, SEL_DEFAULT_AFFINITY));
// Handle the case where there is a typing style.
// FIXME: Improve typing style.
1.31 +1 -1 WebCore/khtml/editing/jsediting.cpp
Index: jsediting.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/jsediting.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- jsediting.cpp 29 Aug 2005 21:29:15 -0000 1.30
+++ jsediting.cpp 24 Sep 2005 01:18:56 -0000 1.31
@@ -30,7 +30,7 @@
#include "htmlediting.h"
#include "khtml_part.h"
-#include "selection.h"
+#include "SelectionController.h"
#include "misc/hashmap.h"
#if APPLE_CHANGES
1.3 +1 -1 WebCore/khtml/editing/move_selection_command.cpp
Index: move_selection_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/move_selection_command.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- move_selection_command.cpp 16 Sep 2005 22:42:07 -0000 1.2
+++ move_selection_command.cpp 24 Sep 2005 01:18:57 -0000 1.3
@@ -56,7 +56,7 @@
void MoveSelectionCommand::doApply()
{
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
ASSERT(selection.isRange());
Position pos = m_position;
1.15 +4 -4 WebCore/khtml/editing/replace_selection_command.cpp
Index: replace_selection_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/replace_selection_command.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- replace_selection_command.cpp 16 Sep 2005 22:42:07 -0000 1.14
+++ replace_selection_command.cpp 24 Sep 2005 01:18:57 -0000 1.15
@@ -388,7 +388,7 @@
ASSERT(exceptionCode == 0);
// affinity is not really important since this is a temp selection
// just for calling applyStyle
- setEndingSelection(Selection(rangeAroundNode, SEL_DEFAULT_AFFINITY, SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(rangeAroundNode, SEL_DEFAULT_AFFINITY, SEL_DEFAULT_AFFINITY));
applyStyle(desiredStyle);
rangeAroundNode->deref();
}
@@ -629,7 +629,7 @@
void ReplaceSelectionCommand::doApply()
{
// collect information about the current selection, prior to deleting the selection
- Selection selection = endingSelection();
+ SelectionController selection = endingSelection();
ASSERT(selection.isCaretOrRange());
if (m_matchStyle) {
@@ -1012,7 +1012,7 @@
if (m_matchStyle) {
assert(m_insertionStyle);
- setEndingSelection(Selection(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY));
applyStyle(m_insertionStyle);
}
@@ -1027,7 +1027,7 @@
}
if (m_selectReplacement)
- setEndingSelection(Selection(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY));
+ setEndingSelection(SelectionController(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY));
else
setEndingSelection(end, SEL_DEFAULT_AFFINITY);
1.2 +12 -12 WebCore/khtml/editing/typing_command.cpp
Index: typing_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/typing_command.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- typing_command.cpp 24 May 2005 07:21:47 -0000 1.1
+++ typing_command.cpp 24 Sep 2005 01:18:58 -0000 1.2
@@ -70,7 +70,7 @@
static_cast<TypingCommand *>(lastEditCommand.get())->deleteKeyPressed();
}
else {
- Selection selection = part->selection();
+ SelectionController selection = part->selection();
if (selection.isCaret() && VisiblePosition(selection.start(), selection.startAffinity()).previous().isNull()) {
// do nothing for a delete key at the start of an editable element.
}
@@ -95,7 +95,7 @@
static_cast<TypingCommand *>(lastEditCommand.get())->forwardDeleteKeyPressed();
}
else {
- Selection selection = part->selection();
+ SelectionController selection = part->selection();
if (selection.isCaret() && isEndOfDocument(VisiblePosition(selection.start(), selection.startAffinity()))) {
// do nothing for a delete key at the start of an editable element.
}
@@ -327,13 +327,13 @@
void TypingCommand::deleteKeyPressed()
{
- Selection selectionToDelete;
+ SelectionController selectionToDelete;
switch (endingSelection().state()) {
- case Selection::RANGE:
+ case SelectionController::RANGE:
selectionToDelete = endingSelection();
break;
- case Selection::CARET: {
+ case SelectionController::CARET: {
// Handle delete at beginning-of-block case.
// Do nothing in the case that the caret is at the start of a
// root editable element or at the start of a document.
@@ -341,10 +341,10 @@
Position start = VisiblePosition(pos, endingSelection().startAffinity()).previous().deepEquivalent();
Position end = VisiblePosition(pos, endingSelection().startAffinity()).deepEquivalent();
if (start.isNotNull() && end.isNotNull() && start.node()->rootEditableElement() == end.node()->rootEditableElement())
- selectionToDelete = Selection(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY);
+ selectionToDelete = SelectionController(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY);
break;
}
- case Selection::NONE:
+ case SelectionController::NONE:
ASSERT_NOT_REACHED();
break;
}
@@ -358,13 +358,13 @@
void TypingCommand::forwardDeleteKeyPressed()
{
- Selection selectionToDelete;
+ SelectionController selectionToDelete;
switch (endingSelection().state()) {
- case Selection::RANGE:
+ case SelectionController::RANGE:
selectionToDelete = endingSelection();
break;
- case Selection::CARET: {
+ case SelectionController::CARET: {
// Handle delete at beginning-of-block case.
// Do nothing in the case that the caret is at the start of a
// root editable element or at the start of a document.
@@ -372,10 +372,10 @@
Position start = VisiblePosition(pos, endingSelection().startAffinity()).next().deepEquivalent();
Position end = VisiblePosition(pos, endingSelection().startAffinity()).deepEquivalent();
if (start.isNotNull() && end.isNotNull() && start.node()->rootEditableElement() == end.node()->rootEditableElement())
- selectionToDelete = Selection(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY);
+ selectionToDelete = SelectionController(start, SEL_DEFAULT_AFFINITY, end, SEL_DEFAULT_AFFINITY);
break;
}
- case Selection::NONE:
+ case SelectionController::NONE:
ASSERT_NOT_REACHED();
break;
}
1.205 +2 -2 WebCore/khtml/rendering/render_block.cpp
Index: render_block.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_block.cpp,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -r1.204 -r1.205
--- render_block.cpp 19 Sep 2005 20:54:09 -0000 1.204
+++ render_block.cpp 24 Sep 2005 01:19:01 -0000 1.205
@@ -36,7 +36,7 @@
#include "xml/dom_position.h"
#include "html/html_formimpl.h"
#include "render_block.h"
-#include "editing/selection.h"
+#include "editing/SelectionController.h"
#include "render_theme.h"
#include "khtmlview.h"
@@ -1270,7 +1270,7 @@
void RenderBlock::paintCaret(PaintInfo& i, CaretType type)
{
- const Selection &s = type == CursorCaret ? document()->part()->selection() : document()->part()->dragCaret();
+ const SelectionController &s = type == CursorCaret ? document()->part()->selection() : document()->part()->dragCaret();
NodeImpl *caretNode = s.start().node();
RenderObject *renderer = caretNode ? caretNode->renderer() : 0;
if (renderer && (renderer == this || renderer->containingBlock() == this) && caretNode && caretNode->isContentEditable()) {
1.257 +1 -1 WebCore/khtml/xml/dom_docimpl.cpp
Index: dom_docimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.256
retrieving revision 1.257
diff -u -r1.256 -r1.257
--- dom_docimpl.cpp 23 Sep 2005 03:28:28 -0000 1.256
+++ dom_docimpl.cpp 24 Sep 2005 01:19:02 -0000 1.257
@@ -1227,7 +1227,7 @@
return;
RenderCanvas *canvas = static_cast<RenderCanvas*>(m_render);
- Selection s = part()->selection();
+ SelectionController s = part()->selection();
if (!s.isRange()) {
canvas->clearSelection();
}
1.193 +2 -2 WebCore/khtml/xml/dom_nodeimpl.cpp
Index: dom_nodeimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -r1.192 -r1.193
--- dom_nodeimpl.cpp 20 Sep 2005 23:59:05 -0000 1.192
+++ dom_nodeimpl.cpp 24 Sep 2005 01:19:02 -0000 1.193
@@ -36,7 +36,7 @@
#include "css/csshelper.h"
#include "css/cssstyleselector.h"
#include "editing/html_interchange.h"
-#include "editing/selection.h"
+#include "editing/SelectionController.h"
#include <kglobal.h>
#include <kdebug.h>
@@ -2344,7 +2344,7 @@
// FIXME: Move to ElementImpl
if (received && isEditableBlock() && !hasChildNodes()) {
- getDocument()->part()->setSelection(Selection(Position(this, 0), DOWNSTREAM));
+ getDocument()->part()->setSelection(SelectionController(Position(this, 0), DOWNSTREAM));
}
// note that we need to recalc the style
1.82 +13 -13 WebCore/kwq/KWQAccObject.mm
Index: KWQAccObject.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQAccObject.mm,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- KWQAccObject.mm 15 Sep 2005 00:57:26 -0000 1.81
+++ KWQAccObject.mm 24 Sep 2005 01:19:03 -0000 1.82
@@ -56,7 +56,7 @@
#import "render_style.h"
#import "render_text.h"
#import "render_theme.h"
-#import "selection.h"
+#import "SelectionController.h"
#import "kjs_html.h"
#import "text_granularity.h"
#import "visible_position.h"
@@ -96,7 +96,7 @@
using khtml::RenderStyle;
using khtml::RenderText;
using khtml::RenderWidget;
-using khtml::Selection;
+using khtml::SelectionController;
using khtml::TextIterator;
using khtml::VisiblePosition;
@@ -914,7 +914,7 @@
// NOTE: BUG support nested WebAreas, like in <http://webcourses.niu.edu/>
// (there is a web archive of this page attached to <rdar://problem/3888973>)
// Trouble is we need to know which document view to ask.
- Selection sel = [self topView]->part()->selection();
+ SelectionController sel = [self topView]->part()->selection();
if (sel.isNone()) {
sel = m_renderer->document()->renderer()->canvas()->view()->part()->selection();
if (sel.isNone())
@@ -1042,8 +1042,8 @@
// NOTE: ignores results of sel.modify because it returns false when
// starting at an empty line. The resulting selection in that case
// will be a caret at visiblePos.
- Selection sel = Selection(visiblePos, visiblePos);
- (void)sel.modify(Selection::EXTEND, Selection::RIGHT, khtml::LINE_BOUNDARY);
+ SelectionController sel = SelectionController(visiblePos, visiblePos);
+ (void)sel.modify(SelectionController::EXTEND, SelectionController::RIGHT, khtml::LINE_BOUNDARY);
// return a marker range for the selection start to end
VisiblePosition startPosition = VisiblePosition(sel.start(), sel.startAffinity());
@@ -1129,9 +1129,9 @@
if (endVisiblePosition.isNull())
return nil;
- // use the Selection class to help calculate the corresponding rectangle
- QRect rect1 = Selection(startVisiblePosition, startVisiblePosition).caretRect();
- QRect rect2 = Selection(endVisiblePosition, endVisiblePosition).caretRect();
+ // use the SelectionController class to help calculate the corresponding rectangle
+ QRect rect1 = SelectionController(startVisiblePosition, startVisiblePosition).caretRect();
+ QRect rect2 = SelectionController(endVisiblePosition, endVisiblePosition).caretRect();
QRect ourrect = rect1.unite(rect2);
// try to use the document view from the selection, so that nested WebAreas work,
@@ -1426,11 +1426,11 @@
if (visiblePos1.isNull() || visiblePos2.isNull())
return nil;
- // use the Selection class to do the ordering
- // NOTE: Perhaps we could add a Selection method to indicate direction, based on m_baseIsStart
+ // use the SelectionController class to do the ordering
+ // NOTE: Perhaps we could add a SelectionController method to indicate direction, based on m_baseIsStart
WebCoreTextMarker *startTextMarker;
WebCoreTextMarker *endTextMarker;
- Selection sel(visiblePos1, visiblePos2);
+ SelectionController sel(visiblePos1, visiblePos2);
if (sel.base() == sel.start()) {
startTextMarker = textMarker1;
endTextMarker = textMarker2;
@@ -1439,7 +1439,7 @@
endTextMarker = textMarker1;
}
- // return a range based on the Selection verdict
+ // return a range based on the SelectionController verdict
return (id) [self textMarkerRangeFromMarkers: startTextMarker andEndMarker:endTextMarker];
}
@@ -1898,7 +1898,7 @@
// make selection and tell the document to use it
// NOTE: BUG support nested WebAreas
- Selection sel = Selection(startVisiblePosition, endVisiblePosition);
+ SelectionController sel = SelectionController(startVisiblePosition, endVisiblePosition);
[self topDocument]->part()->setSelection(sel);
}
1.228 +3 -3 WebCore/kwq/KWQKHTMLPart.h
Index: KWQKHTMLPart.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.h,v
retrieving revision 1.227
retrieving revision 1.228
diff -u -r1.227 -r1.228
--- KWQKHTMLPart.h 31 Aug 2005 04:38:43 -0000 1.227
+++ KWQKHTMLPart.h 24 Sep 2005 01:19:04 -0000 1.228
@@ -243,7 +243,7 @@
NSWritingDirection baseWritingDirectionForSelectionStart() const;
void markMisspellingsInAdjacentWords(const khtml::VisiblePosition &);
- void markMisspellings(const khtml::Selection &);
+ void markMisspellings(const khtml::SelectionController &);
NSFileWrapper *fileWrapperForElement(DOM::ElementImpl *);
NSAttributedString *attributedString(DOM::NodeImpl *startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset);
@@ -342,10 +342,10 @@
void issuePasteCommand();
void issuePasteAndMatchStyleCommand();
void issueTransposeCommand();
- void respondToChangedSelection(const khtml::Selection &oldSelection, bool closeTyping);
+ void respondToChangedSelection(const khtml::SelectionController &oldSelection, bool closeTyping);
void respondToChangedContents();
virtual bool isContentEditable() const;
- virtual bool shouldChangeSelection(const khtml::Selection &oldSelection, const khtml::Selection &newSelection, khtml::EAffinity affinity, bool stillSelecting) const;
+ virtual bool shouldChangeSelection(const khtml::SelectionController &oldSelection, const khtml::SelectionController &newSelection, khtml::EAffinity affinity, bool stillSelecting) const;
virtual bool shouldBeginEditing(const DOM::RangeImpl *) const;
virtual bool shouldEndEditing(const DOM::RangeImpl *) const;
1.674 +14 -14 WebCore/kwq/KWQKHTMLPart.mm
Index: KWQKHTMLPart.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
retrieving revision 1.673
retrieving revision 1.674
diff -u -r1.673 -r1.674
--- KWQKHTMLPart.mm 19 Sep 2005 18:52:12 -0000 1.673
+++ KWQKHTMLPart.mm 24 Sep 2005 01:19:04 -0000 1.674
@@ -70,7 +70,7 @@
#import "render_table.h"
#import "render_text.h"
#import "render_theme.h"
-#import "selection.h"
+#import "SelectionController.h"
#import "visible_position.h"
#import "visible_text.h"
#import "visible_units.h"
@@ -140,7 +140,7 @@
using khtml::theme;
using khtml::RenderWidget;
using khtml::RightWordIfOnBoundary;
-using khtml::Selection;
+using khtml::SelectionController;
using khtml::SELECT_IGNORE;
using khtml::setEnd;
using khtml::setStart;
@@ -656,7 +656,7 @@
return false;
}
- setSelection(Selection(resultRange.get(), DOWNSTREAM, VP_UPSTREAM_IF_POSSIBLE));
+ setSelection(SelectionController(resultRange.get(), DOWNSTREAM, VP_UPSTREAM_IF_POSSIBLE));
jumpToSelection();
return true;
}
@@ -1023,7 +1023,7 @@
QString result = chars.string(misspelling.length);
misspellingRange->setEnd(chars.range()->startContainer(exception), chars.range()->startOffset(exception), exception);
- setSelection(Selection(misspellingRange.get(), DOWNSTREAM, VP_UPSTREAM_IF_POSSIBLE));
+ setSelection(SelectionController(misspellingRange.get(), DOWNSTREAM, VP_UPSTREAM_IF_POSSIBLE));
jumpToSelection();
// Mark misspelling in document.
xmlDocImpl()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
@@ -3375,15 +3375,15 @@
void KWQKHTMLPart::centerSelectionInVisibleArea() const
{
switch (selection().state()) {
- case Selection::NONE:
+ case SelectionController::NONE:
break;
- case Selection::CARET: {
+ case SelectionController::CARET: {
if (view())
// passing true forces centering even if selection is already exposed
view()->ensureRectVisibleCentered(selection().caretRect(), true);
break;
}
- case Selection::RANGE:
+ case SelectionController::RANGE:
if (view())
// passing true forces centering even if selection is already exposed
view()->ensureRectVisibleCentered(selectionRect(), true);
@@ -3713,7 +3713,7 @@
node = node->traverseNextNode();
}
if (node)
- setSelection(Selection(Position(node, 0), DOWNSTREAM));
+ setSelection(SelectionController(Position(node, 0), DOWNSTREAM));
}
}
@@ -4012,10 +4012,10 @@
{
if (![_bridge isContinuousSpellCheckingEnabled])
return;
- markMisspellings(Selection(startOfWord(p, LeftWordIfOnBoundary), endOfWord(p, RightWordIfOnBoundary)));
+ markMisspellings(SelectionController(startOfWord(p, LeftWordIfOnBoundary), endOfWord(p, RightWordIfOnBoundary)));
}
-void KWQKHTMLPart::markMisspellings(const Selection &selection)
+void KWQKHTMLPart::markMisspellings(const SelectionController &selection)
{
// This function is called with a selection already expanded to word boundaries.
// Might be nice to assert that here.
@@ -4073,15 +4073,15 @@
}
}
-void KWQKHTMLPart::respondToChangedSelection(const Selection &oldSelection, bool closeTyping)
+void KWQKHTMLPart::respondToChangedSelection(const SelectionController &oldSelection, bool closeTyping)
{
if (xmlDocImpl()) {
if ([_bridge isContinuousSpellCheckingEnabled]) {
VisiblePosition oldStart(oldSelection.start(), oldSelection.startAffinity());
- Selection oldAdjacentWords(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
+ SelectionController oldAdjacentWords(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
VisiblePosition newStart(selection().start(), selection().startAffinity());
- Selection newAdjacentWords(startOfWord(newStart, LeftWordIfOnBoundary), endOfWord(newStart, RightWordIfOnBoundary));
+ SelectionController newAdjacentWords(startOfWord(newStart, LeftWordIfOnBoundary), endOfWord(newStart, RightWordIfOnBoundary));
if (oldAdjacentWords != newAdjacentWords) {
// Mark misspellings in the portion that was previously unmarked because of
@@ -4109,7 +4109,7 @@
[_bridge respondToChangedSelection];
}
-bool KWQKHTMLPart::shouldChangeSelection(const Selection &oldSelection, const Selection &newSelection, khtml::EAffinity affinity, bool stillSelecting) const
+bool KWQKHTMLPart::shouldChangeSelection(const SelectionController &oldSelection, const SelectionController &newSelection, khtml::EAffinity affinity, bool stillSelecting) const
{
return [_bridge shouldChangeSelectedDOMRange:[DOMRange _rangeWithImpl:oldSelection.toRange().get()]
toDOMRange:[DOMRange _rangeWithImpl:newSelection.toRange().get()]
1.45 +3 -3 WebCore/kwq/KWQRenderTreeDebug.cpp
Index: KWQRenderTreeDebug.cpp
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQRenderTreeDebug.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- KWQRenderTreeDebug.cpp 25 Aug 2005 17:47:25 -0000 1.44
+++ KWQRenderTreeDebug.cpp 24 Sep 2005 01:19:05 -0000 1.45
@@ -34,7 +34,7 @@
#include "render_table.h"
#include "render_text.h"
#include "render_br.h"
-#include "selection.h"
+#include "SelectionController.h"
#include "KWQKHTMLPart.h"
#include "KWQTextStream.h"
@@ -54,7 +54,7 @@
using khtml::RenderText;
using khtml::RenderCanvas;
using khtml::RenderBR;
-using khtml::Selection;
+using khtml::SelectionController;
using khtml::transparentColor;
using khtml::UPSTREAM;
@@ -391,7 +391,7 @@
if (!part)
return;
- Selection selection = part->selection();
+ SelectionController selection = part->selection();
if (selection.isCaret()) {
ts << "caret: position " << selection.start().offset() << " of " << nodePosition(selection.start().node());
if (selection.startAffinity() == UPSTREAM)
1.348 +17 -17 WebCore/kwq/WebCoreBridge.h
Index: WebCoreBridge.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.h,v
retrieving revision 1.347
retrieving revision 1.348
diff -u -r1.347 -r1.348
--- WebCoreBridge.h 20 Sep 2005 08:31:48 -0000 1.347
+++ WebCoreBridge.h 24 Sep 2005 01:19:05 -0000 1.348
@@ -102,21 +102,21 @@
} WebSelectionAlteration;
typedef enum {
- WebSelectForward,
- WebSelectBackward,
- WebSelectRight,
- WebSelectLeft
-} WebSelectionDirection;
+ WebBridgeSelectForward,
+ WebBridgeSelectBackward,
+ WebBridgeSelectRight,
+ WebBridgeSelectLeft
+} WebBridgeSelectionDirection;
typedef enum {
- WebSelectByCharacter,
- WebSelectByWord,
- WebSelectByLine,
- WebSelectByParagraph,
- WebSelectToLineBoundary,
- WebSelectToParagraphBoundary,
- WebSelectToDocumentBoundary
-} WebSelectionGranularity;
+ WebBridgeSelectByCharacter,
+ WebBridgeSelectByWord,
+ WebBridgeSelectByLine,
+ WebBridgeSelectByParagraph,
+ WebBridgeSelectToLineBoundary,
+ WebBridgeSelectToParagraphBoundary,
+ WebBridgeSelectToDocumentBoundary
+} WebBridgeSelectionGranularity;
typedef enum {
WebScrollUp,
@@ -381,13 +381,13 @@
- (void)undoEditing:(id)arg;
- (void)redoEditing:(id)arg;
-- (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebSelectionGranularity)granularity;
+- (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebBridgeSelectionGranularity)granularity;
- (DOMRange *)rangeOfCharactersAroundCaret;
-- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
-- (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
+- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity;
+- (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity;
- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
- (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
-- (WebSelectionGranularity)selectionGranularity;
+- (WebBridgeSelectionGranularity)selectionGranularity;
- (DOMRange *)smartDeleteRangeForProposedRange:(DOMRange *)proposedCharRange;
- (void)smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
- (BOOL)canDeleteRange:(DOMRange *)range;
1.417 +42 -42 WebCore/kwq/WebCoreBridge.mm
Index: WebCoreBridge.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
retrieving revision 1.416
retrieving revision 1.417
diff -u -r1.416 -r1.417
--- WebCoreBridge.mm 20 Sep 2005 08:31:48 -0000 1.416
+++ WebCoreBridge.mm 24 Sep 2005 01:19:06 -0000 1.417
@@ -50,7 +50,7 @@
#import "render_object.h"
#import "render_replaced.h"
#import "render_style.h"
-#import "selection.h"
+#import "SelectionController.h"
#import "visible_position.h"
#import "visible_text.h"
#import "visible_units.h"
@@ -123,7 +123,7 @@
using khtml::RenderStyle;
using khtml::RenderWidget;
using khtml::ReplaceSelectionCommand;
-using khtml::Selection;
+using khtml::SelectionController;
using khtml::SharedPtr;
using khtml::Tokenizer;
using khtml::TextIterator;
@@ -560,11 +560,11 @@
- (WebSelectionState)selectionState
{
switch (_part->selection().state()) {
- case Selection::NONE:
+ case SelectionController::NONE:
return WebSelectionStateNone;
- case Selection::CARET:
+ case SelectionController::CARET:
return WebSelectionStateCaret;
- case Selection::RANGE:
+ case SelectionController::RANGE:
return WebSelectionStateRange;
}
@@ -1493,53 +1493,53 @@
[arg command]->reapply();
}
-- (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebSelectionGranularity)granularity
+- (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebBridgeSelectionGranularity)granularity
{
if (!partHasSelection(self))
return nil;
- // NOTE: The enums *must* match the very similar ones declared in ktml_selection.h
- Selection selection(_part->selection());
+ // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
+ SelectionController selection(_part->selection());
selection.expandUsingGranularity(static_cast<ETextGranularity>(granularity));
return [DOMRange _rangeWithImpl:selection.toRange().get()];
}
-- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity
+- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity
{
if (!partHasSelection(self))
return nil;
- // NOTE: The enums *must* match the very similar ones declared in ktml_selection.h
- Selection selection(_part->selection());
- selection.modify(static_cast<Selection::EAlter>(alteration),
- static_cast<Selection::EDirection>(direction),
+ // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
+ SelectionController selection(_part->selection());
+ selection.modify(static_cast<SelectionController::EAlter>(alteration),
+ static_cast<SelectionController::EDirection>(direction),
static_cast<ETextGranularity>(granularity));
return [DOMRange _rangeWithImpl:selection.toRange().get()];
}
-- (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity
+- (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity
{
if (!partHasSelection(self))
return;
- // NOTE: The enums *must* match the very similar ones declared in dom_selection.h
- Selection selection(_part->selection());
- selection.modify(static_cast<Selection::EAlter>(alteration),
- static_cast<Selection::EDirection>(direction),
+ // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
+ SelectionController selection(_part->selection());
+ selection.modify(static_cast<SelectionController::EAlter>(alteration),
+ static_cast<SelectionController::EDirection>(direction),
static_cast<ETextGranularity>(granularity));
// save vertical navigation x position if necessary; many types of motion blow it away
int xPos = KHTMLPart::NoXPosForVerticalArrowNavigation;
switch (granularity) {
- case WebSelectByLine:
- case WebSelectByParagraph:
+ case WebBridgeSelectByLine:
+ case WebBridgeSelectByParagraph:
xPos = _part->xPosForVerticalArrowNavigation();
break;
- case WebSelectByCharacter:
- case WebSelectByWord:
- case WebSelectToLineBoundary:
- case WebSelectToParagraphBoundary:
- case WebSelectToDocumentBoundary:
+ case WebBridgeSelectByCharacter:
+ case WebBridgeSelectByWord:
+ case WebBridgeSelectToLineBoundary:
+ case WebBridgeSelectToParagraphBoundary:
+ case WebBridgeSelectToDocumentBoundary:
break;
}
@@ -1552,8 +1552,8 @@
// to preserve smart delete behavior when extending by word. e.g. double-click,
// then shift-option-rightarrow, then delete needs to smart delete, per TextEdit.
if (!((alteration == WebSelectByExtending) &&
- (granularity == WebSelectByWord) && (_part->selectionGranularity() == khtml::WORD)))
- _part->setSelectionGranularity(static_cast<ETextGranularity>(WebSelectByCharacter));
+ (granularity == WebBridgeSelectByWord) && (_part->selectionGranularity() == khtml::WORD)))
+ _part->setSelectionGranularity(static_cast<ETextGranularity>(WebBridgeSelectByCharacter));
// restore vertical navigation x position if necessary
if (xPos != KHTMLPart::NoXPosForVerticalArrowNavigation)
@@ -1569,8 +1569,8 @@
if (!partHasSelection(self))
return nil;
- Selection selection(_part->selection());
- selection.modify(static_cast<Selection::EAlter>(alteration), static_cast<int>(verticalDistance));
+ SelectionController selection(_part->selection());
+ selection.modify(static_cast<SelectionController::EAlter>(alteration), static_cast<int>(verticalDistance));
return [DOMRange _rangeWithImpl:selection.toRange().get()];
}
@@ -1579,13 +1579,13 @@
if (!partHasSelection(self))
return;
- Selection selection(_part->selection());
- selection.modify(static_cast<Selection::EAlter>(alteration), static_cast<int>(verticalDistance));
+ SelectionController selection(_part->selection());
+ selection.modify(static_cast<SelectionController::EAlter>(alteration), static_cast<int>(verticalDistance));
// setting the selection always clears saved vertical navigation x position, so preserve it
int xPos = _part->xPosForVerticalArrowNavigation();
_part->setSelection(selection);
- _part->setSelectionGranularity(static_cast<ETextGranularity>(WebSelectByCharacter));
+ _part->setSelectionGranularity(static_cast<ETextGranularity>(WebBridgeSelectByCharacter));
_part->setXPosForVerticalArrowNavigation(xPos);
_part->selectFrameElementInParentIfFullySelected();
@@ -1593,10 +1593,10 @@
[self ensureSelectionVisible];
}
-- (WebSelectionGranularity)selectionGranularity
+- (WebBridgeSelectionGranularity)selectionGranularity
{
- // NOTE: The enums *must* match the very similar ones declared in dom_selection.h
- return static_cast<WebSelectionGranularity>(_part->selectionGranularity());
+ // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
+ return static_cast<WebBridgeSelectionGranularity>(_part->selectionGranularity());
}
- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping
@@ -1620,7 +1620,7 @@
// FIXME: Can we provide extentAffinity?
VisiblePosition visibleStart(startContainer, [range startOffset], affinity);
VisiblePosition visibleEnd(endContainer, [range endOffset], khtml::SEL_DEFAULT_AFFINITY);
- Selection selection(visibleStart, visibleEnd);
+ SelectionController selection(visibleStart, visibleEnd);
_part->setSelection(selection, closeTyping);
}
@@ -1659,7 +1659,7 @@
- (void)selectNSRange:(NSRange)range
{
- _part->setSelection(Selection([self convertToDOMRange:range], khtml::SEL_DEFAULT_AFFINITY, khtml::SEL_DEFAULT_AFFINITY));
+ _part->setSelection(SelectionController([self convertToDOMRange:range], khtml::SEL_DEFAULT_AFFINITY, khtml::SEL_DEFAULT_AFFINITY));
}
- (NSRange)selectedNSRange
@@ -1674,7 +1674,7 @@
- (void)setMarkDOMRange:(DOMRange *)range
{
- _part->setMark(Selection([range _rangeImpl], khtml::SEL_DEFAULT_AFFINITY, khtml::SEL_DEFAULT_AFFINITY));
+ _part->setMark(SelectionController([range _rangeImpl], khtml::SEL_DEFAULT_AFFINITY, khtml::SEL_DEFAULT_AFFINITY));
}
- (DOMRange *)markDOMRange
@@ -1937,13 +1937,13 @@
- (void)moveDragCaretToPoint:(NSPoint)point
{
- Selection dragCaret([self _visiblePositionForPoint:point]);
+ SelectionController dragCaret([self _visiblePositionForPoint:point]);
_part->setDragCaret(dragCaret);
}
- (void)removeDragCaret
{
- _part->setDragCaret(Selection());
+ _part->setDragCaret(SelectionController());
}
- (DOMRange *)dragCaretDOMRange
@@ -1954,7 +1954,7 @@
- (DOMRange *)editableDOMRangeForPoint:(NSPoint)point
{
VisiblePosition position = [self _visiblePositionForPoint:point];
- return position.isNull() ? nil : [DOMRange _rangeWithImpl:Selection(position).toRange().get()];
+ return position.isNull() ? nil : [DOMRange _rangeWithImpl:SelectionController(position).toRange().get()];
}
- (void)deleteSelectionWithSmartDelete:(BOOL)smartDelete
@@ -2256,7 +2256,7 @@
if (!_part)
return nil;
- Selection selection(_part->selection());
+ SelectionController selection(_part->selection());
if (!selection.isCaret())
return nil;
1.3328 +8 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3327
retrieving revision 1.3328
diff -u -r1.3327 -r1.3328
--- ChangeLog 20 Sep 2005 22:30:59 -0000 1.3327
+++ ChangeLog 24 Sep 2005 01:19:08 -0000 1.3328
@@ -1,3 +1,11 @@
+2005-09-23 Duncan Wilcox <duncan at mclink.it>
+
+ Reviewed and landed by Darin.
+
+ - name changes to prepare for fixing bugzilla bug 4582
+
+ * WebView.subproj/WebHTMLView.m: Changed names to match WebCore changes.
+
2005-09-20 John Sullivan <sullivan at apple.com>
Reviewed by Tim Omernick.
1.470 +57 -57 WebKit/WebView.subproj/WebHTMLView.m
Index: WebHTMLView.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebHTMLView.m,v
retrieving revision 1.469
retrieving revision 1.470
diff -u -r1.469 -r1.470
--- WebHTMLView.m 20 Sep 2005 22:31:05 -0000 1.469
+++ WebHTMLView.m 24 Sep 2005 01:19:14 -0000 1.470
@@ -2809,7 +2809,7 @@
if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:[bridge dragCaretDOMRange] givenAction:WebViewInsertActionDropped]) {
[[webView _UIDelegateForwarder] webView:webView willPerformDragDestinationAction:WebDragDestinationActionEdit forDraggingInfo:draggingInfo];
if ([self _isMoveDrag]) {
- BOOL smartMove = [[self _bridge] selectionGranularity] == WebSelectByWord && [self _canSmartReplaceWithPasteboard:pasteboard];
+ BOOL smartMove = [[self _bridge] selectionGranularity] == WebBridgeSelectByWord && [self _canSmartReplaceWithPasteboard:pasteboard];
[bridge moveSelectionToDragCaret:fragment smartMove:smartMove];
} else {
[bridge setSelectionToDragCaret];
@@ -3308,7 +3308,7 @@
[[self _bridge] centerSelectionInVisibleArea];
}
-- (void)_alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity
+- (void)_alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity
{
WebBridge *bridge = [self _bridge];
DOMRange *proposedRange = [bridge rangeByAlteringCurrentSelection:alteration direction:direction granularity:granularity];
@@ -3330,172 +3330,172 @@
- (void)moveBackward:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectBackward granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectByCharacter];
}
- (void)moveBackwardAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByCharacter];
}
- (void)moveDown:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectForward granularity:WebSelectByLine];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectByLine];
}
- (void)moveDownAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectByLine];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByLine];
}
- (void)moveForward:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectForward granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter];
}
- (void)moveForwardAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter];
}
- (void)moveLeft:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectLeft granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectLeft granularity:WebBridgeSelectByCharacter];
}
- (void)moveLeftAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectLeft granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectLeft granularity:WebBridgeSelectByCharacter];
}
- (void)moveRight:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectRight granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectRight granularity:WebBridgeSelectByCharacter];
}
- (void)moveRightAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectRight granularity:WebSelectByCharacter];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectRight granularity:WebBridgeSelectByCharacter];
}
- (void)moveToBeginningOfDocument:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectBackward granularity:WebSelectToDocumentBoundary];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToDocumentBoundary];
}
- (void)moveToBeginningOfDocumentAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectToDocumentBoundary];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToDocumentBoundary];
}
- (void)moveToBeginningOfLine:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectBackward granularity:WebSelectToLineBoundary];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToLineBoundary];
}
- (void)moveToBeginningOfLineAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectToLineBoundary];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToLineBoundary];
}
- (void)moveToBeginningOfParagraph:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectBackward granularity:WebSelectToParagraphBoundary];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToParagraphBoundary];
}
- (void)moveToBeginningOfParagraphAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectToParagraphBoundary];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToParagraphBoundary];
}
- (void)moveToEndOfDocument:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectForward granularity:WebSelectToDocumentBoundary];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToDocumentBoundary];
}
- (void)moveToEndOfDocumentAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectToDocumentBoundary];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToDocumentBoundary];
}
- (void)moveToEndOfLine:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectForward granularity:WebSelectToLineBoundary];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary];
}
- (void)moveToEndOfLineAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectToLineBoundary];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary];
}
- (void)moveToEndOfParagraph:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectForward granularity:WebSelectToParagraphBoundary];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToParagraphBoundary];
}
- (void)moveToEndOfParagraphAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectToParagraphBoundary];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToParagraphBoundary];
}
- (void)moveParagraphBackwardAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectByParagraph];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByParagraph];
}
- (void)moveParagraphForwardAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectByParagraph];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByParagraph];
}
- (void)moveUp:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectBackward granularity:WebSelectByLine];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectByLine];
}
- (void)moveUpAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectByLine];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByLine];
}
- (void)moveWordBackward:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectBackward granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
}
- (void)moveWordBackwardAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectBackward granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
}
- (void)moveWordForward:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectForward granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectByWord];
}
- (void)moveWordForwardAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectForward granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByWord];
}
- (void)moveWordLeft:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectLeft granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectLeft granularity:WebBridgeSelectByWord];
}
- (void)moveWordLeftAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectLeft granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectLeft granularity:WebBridgeSelectByWord];
}
- (void)moveWordRight:(id)sender
{
- [self _alterCurrentSelection:WebSelectByMoving direction:WebSelectRight granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectRight granularity:WebBridgeSelectByWord];
}
- (void)moveWordRightAndModifySelection:(id)sender
{
- [self _alterCurrentSelection:WebSelectByExtending direction:WebSelectRight granularity:WebSelectByWord];
+ [self _alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectRight granularity:WebBridgeSelectByWord];
}
- (void)pageUp:(id)sender
@@ -3530,7 +3530,7 @@
[self _alterCurrentSelection:WebSelectByExtending verticalDistance:[frameView _verticalPageScrollDistance]];
}
-- (void)_expandSelectionToGranularity:(WebSelectionGranularity)granularity
+- (void)_expandSelectionToGranularity:(WebBridgeSelectionGranularity)granularity
{
WebBridge *bridge = [self _bridge];
DOMRange *range = [bridge rangeByExpandingSelectionWithGranularity:granularity];
@@ -3544,17 +3544,17 @@
- (void)selectParagraph:(id)sender
{
- [self _expandSelectionToGranularity:WebSelectByParagraph];
+ [self _expandSelectionToGranularity:WebBridgeSelectByParagraph];
}
- (void)selectLine:(id)sender
{
- [self _expandSelectionToGranularity:WebSelectByLine];
+ [self _expandSelectionToGranularity:WebBridgeSelectByLine];
}
- (void)selectWord:(id)sender
{
- [self _expandSelectionToGranularity:WebSelectByWord];
+ [self _expandSelectionToGranularity:WebBridgeSelectByWord];
}
- (void)copy:(id)sender
@@ -4240,7 +4240,7 @@
[self _changeWordCaseWithSelector:@selector(capitalizedString)];
}
-- (BOOL)_deleteWithDirection:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity killRing:(BOOL)killRing isTypingAction:(BOOL)isTypingAction
+- (BOOL)_deleteWithDirection:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity killRing:(BOOL)killRing isTypingAction:(BOOL)isTypingAction
{
// Delete the selection, if there is one.
// If not, make a selection using the passed-in direction and granularity.
@@ -4259,12 +4259,12 @@
range = [[self _bridge] rangeByAlteringCurrentSelection:WebSelectByExtending direction:direction granularity:granularity];
if (isTypingAction)
switch (direction) {
- case WebSelectForward:
- case WebSelectRight:
+ case WebBridgeSelectForward:
+ case WebBridgeSelectRight:
deletionAction = forwardDeleteKeyAction;
break;
- case WebSelectBackward:
- case WebSelectLeft:
+ case WebBridgeSelectBackward:
+ case WebBridgeSelectLeft:
deletionAction = deleteKeyAction;
break;
}
@@ -4280,14 +4280,14 @@
{
if (![self _isEditable])
return;
- [self _deleteWithDirection:WebSelectForward granularity:WebSelectByCharacter killRing:NO isTypingAction:YES];
+ [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:NO isTypingAction:YES];
}
- (void)deleteBackward:(id)sender
{
if (![self _isEditable])
return;
- [self _deleteWithDirection:WebSelectBackward granularity:WebSelectByCharacter killRing:NO isTypingAction:YES];
+ [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectByCharacter killRing:NO isTypingAction:YES];
}
- (void)deleteBackwardByDecomposingPreviousCharacter:(id)sender
@@ -4298,38 +4298,38 @@
- (void)deleteWordForward:(id)sender
{
- [self _deleteWithDirection:WebSelectForward granularity:WebSelectByWord killRing:YES isTypingAction:NO];
+ [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByWord killRing:YES isTypingAction:NO];
}
- (void)deleteWordBackward:(id)sender
{
- [self _deleteWithDirection:WebSelectBackward granularity:WebSelectByWord killRing:YES isTypingAction:NO];
+ [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectByWord killRing:YES isTypingAction:NO];
}
- (void)deleteToBeginningOfLine:(id)sender
{
- [self _deleteWithDirection:WebSelectBackward granularity:WebSelectToLineBoundary killRing:YES isTypingAction:NO];
+ [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectToLineBoundary killRing:YES isTypingAction:NO];
}
- (void)deleteToEndOfLine:(id)sender
{
// To match NSTextView, this command should delete the newline at the end of
// a paragraph if you are at the end of a paragraph (like deleteToEndOfParagraph does below).
- if(![self _deleteWithDirection:WebSelectForward granularity:WebSelectToLineBoundary killRing:YES isTypingAction:NO])
- [self _deleteWithDirection:WebSelectForward granularity:WebSelectByCharacter killRing:YES isTypingAction:NO];
+ if(![self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary killRing:YES isTypingAction:NO])
+ [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:YES isTypingAction:NO];
}
- (void)deleteToBeginningOfParagraph:(id)sender
{
- [self _deleteWithDirection:WebSelectBackward granularity:WebSelectToParagraphBoundary killRing:YES isTypingAction:NO];
+ [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectToParagraphBoundary killRing:YES isTypingAction:NO];
}
- (void)deleteToEndOfParagraph:(id)sender
{
// Despite the name of the method, this should delete the newline if the caret is at the end of a paragraph.
// If deletion to the end of the paragraph fails, we delete one character forward, which will delete the newline.
- if (![self _deleteWithDirection:WebSelectForward granularity:WebSelectToParagraphBoundary killRing:YES isTypingAction:NO])
- [self _deleteWithDirection:WebSelectForward granularity:WebSelectByCharacter killRing:YES isTypingAction:NO];
+ if (![self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectToParagraphBoundary killRing:YES isTypingAction:NO])
+ [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:YES isTypingAction:NO];
}
- (void)complete:(id)sender
@@ -4847,7 +4847,7 @@
- (BOOL)_canSmartCopyOrDelete
{
- return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WebSelectByWord;
+ return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WebBridgeSelectByWord;
}
- (DOMRange *)_smartDeleteRangeForProposedRange:(DOMRange *)proposedRange
@@ -5298,7 +5298,7 @@
// Get preceeding word stem
WebBridge *bridge = [_view _bridge];
DOMRange *selection = [bridge selectedDOMRange];
- DOMRange *wholeWord = [bridge rangeByExpandingSelectionWithGranularity:WebSelectByWord];
+ DOMRange *wholeWord = [bridge rangeByExpandingSelectionWithGranularity:WebBridgeSelectByWord];
DOMRange *prefix = [wholeWord cloneRange];
[prefix setEnd:[selection startContainer] :[selection startOffset]];
More information about the webkit-changes
mailing list