[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:36:12 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 852ea3a26f93cc729517a0d9616a5c2a54e99879
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Apr 22 17:54:34 2004 +0000

    Tests:
    
            Reviewed by John
    
            * Blot/BlotDocument.m:
            (-[BlotDocument webView:didFinishLoadForFrame:]): Send along selection
            affinity in call to set selection.
    
    WebCore:
    
            Reviewed by John
    
            Adds the notion of selection affinity to the editing API, bringing it up to
            date with the latest proposal.
    
            * khtml/xml/dom_selection.cpp:
            (DOM::Selection::Selection): Adds support for selection affinity member variable.
            (DOM::Selection::init): Ditto.
            (DOM::Selection::operator=): Ditto.
            (DOM::Selection::setAffinity): New function.
            (DOM::Selection::layoutCaret): Added comment to indicate that we need to enhance this
            function to handle selection affinity.
            * khtml/xml/dom_selection.h: Added EAffinity enum and m_affinity member variable.
            (DOM::Selection::): Moved the enums above the constructors. No code change.
            (DOM::Selection::affinity): New accessor.
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm: Add selection affinity to API declarations as needed.
            (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
            (-[WebCoreBridge selectedDOMRange]): Ditto.
            (-[WebCoreBridge selectionAffinity]): Ditto.
    
    WebKit:
    
            Reviewed by John
    
            Adds the notion of selection affinity to the editing API, bringing it up to
            date with the latest proposal.
    
            * WebView.subproj/WebView.m:
            (-[WebView _alterCurrentSelection:direction:granularity:]): Pass selection affinity
            to the delegate. We can just pass the current one since this does not change with arrow keys.
            (-[WebView setSelectedDOMRange:affinity:]): Set the affinity on the selection.
            (-[WebView selectionAffinity]): New accessor.
            (-[WebView insertNode:replacingDOMRange:]): Change to pass selection affinity to call
            to set selection. This is just to get the code to compile for now, since this method
            will soon be removed in place of a similar one from the latest proposal that always
            works on the current selection.
            (-[WebView insertText:replacingDOMRange:]): Ditto.
            (-[WebView insertMarkupString:replacingDOMRange:]): Ditto.
            (-[WebView insertWebArchive:replacingDOMRange:]): Ditto.
            (-[WebView deleteDOMRange:]): Ditto.
            (-[WebView applyStyle:toElementsInDOMRange:]): Ditto.
            * WebView.subproj/WebViewPrivate.h: Add selection affinity to API declarations as needed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6455 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4fcfb39..33956b8 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,26 @@
+2004-04-22  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by John
+
+        Adds the notion of selection affinity to the editing API, bringing it up to
+        date with the latest proposal.
+
+        * khtml/xml/dom_selection.cpp:
+        (DOM::Selection::Selection): Adds support for selection affinity member variable.
+        (DOM::Selection::init): Ditto.
+        (DOM::Selection::operator=): Ditto.
+        (DOM::Selection::setAffinity): New function.
+        (DOM::Selection::layoutCaret): Added comment to indicate that we need to enhance this
+        function to handle selection affinity.
+        * khtml/xml/dom_selection.h: Added EAffinity enum and m_affinity member variable.
+        (DOM::Selection::): Moved the enums above the constructors. No code change.
+        (DOM::Selection::affinity): New accessor.
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm: Add selection affinity to API declarations as needed.
+        (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
+        (-[WebCoreBridge selectedDOMRange]): Ditto.
+        (-[WebCoreBridge selectionAffinity]): Ditto.
+
 2004-04-21  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebCore/khtml/editing/SelectionController.cpp b/WebCore/khtml/editing/SelectionController.cpp
index 8bc9a20..6f1774f 100644
--- a/WebCore/khtml/editing/SelectionController.cpp
+++ b/WebCore/khtml/editing/SelectionController.cpp
@@ -96,6 +96,7 @@ Selection::Selection(const Selection &o)
 	assignStartAndEnd(o.start(), o.end());
 
     m_state = o.m_state;
+    m_affinity = o.m_affinity;
 
     m_baseIsStart = o.m_baseIsStart;
     m_needsCaretLayout = o.m_needsCaretLayout;
@@ -123,6 +124,7 @@ void Selection::init()
     m_baseIsStart = true;
     m_needsCaretLayout = true;
     m_modifyBiasSet = false;
+    m_affinity = DOWNSTREAM;
 }
 
 Selection &Selection::operator=(const Selection &o)
@@ -131,6 +133,7 @@ Selection &Selection::operator=(const Selection &o)
 	assignStartAndEnd(o.start(), o.end());
 
     m_state = o.m_state;
+    m_affinity = o.m_affinity;
 
     m_baseIsStart = o.m_baseIsStart;
     m_needsCaretLayout = o.m_needsCaretLayout;
@@ -150,6 +153,15 @@ Selection &Selection::operator=(const Selection &o)
     return *this;
 }
 
+void Selection::setAffinity(EAffinity affinity)
+{
+    if (affinity == m_affinity)
+        return;
+        
+    m_affinity = affinity;
+    setNeedsLayout();
+}
+
 void Selection::moveTo(const Range &r)
 {
     Position start(r.startContainer().handle(), r.startOffset());
@@ -384,6 +396,8 @@ void Selection::layoutCaret()
         m_caretX = m_caretY = m_caretSize = 0;
     }
     else {
+        // EDIT FIXME: Enhance call to pass along selection 
+        // upstream/downstream affinity to get the right position.
         int w;
         start().node()->renderer()->caretPos(start().offset(), true, m_caretX, m_caretY, w, m_caretSize);
     }
diff --git a/WebCore/khtml/editing/SelectionController.h b/WebCore/khtml/editing/SelectionController.h
index ed287cb..8d963c2 100644
--- a/WebCore/khtml/editing/SelectionController.h
+++ b/WebCore/khtml/editing/SelectionController.h
@@ -45,18 +45,26 @@ class Range;
 class Selection
 {
 public:
+	enum EState { NONE, CARET, RANGE };
+	enum EAlter { MOVE, EXTEND };
+	enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT, UP, DOWN };
+	enum ETextGranularity { CHARACTER, WORD, LINE };
+
+    // These match the AppKit values for these concepts.
+    // From NSTextView.h:
+    // NSSelectionAffinityUpstream = 0
+    // NSSelectionAffinityUpstream = 1
+    enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 };
+
     Selection();
     Selection(const Position &);
     Selection(const Position &, const Position &);
     Selection(const Selection &);
     ~Selection() {}
 
-	enum EState { NONE, CARET, RANGE };
-	enum EAlter { MOVE, EXTEND };
-	enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT, UP, DOWN };
-	enum ETextGranularity { CHARACTER, WORD, LINE };
-
 	EState state() const { return m_state; }
+	EAffinity affinity() const { return m_affinity; }
+    void setAffinity(EAffinity);
 
     void moveTo(const Range &);
     void moveTo(const Selection &);
@@ -123,6 +131,7 @@ private:
     Position m_end;               // end position for the selection
 
 	EState m_state;               // the state of the selection
+	EAffinity m_affinity;         // the upstream/downstream affinity of the selection
 
 	int m_caretX;                 // caret coordinates and size
 	int m_caretY;
diff --git a/WebCore/khtml/editing/selection.cpp b/WebCore/khtml/editing/selection.cpp
index 8bc9a20..6f1774f 100644
--- a/WebCore/khtml/editing/selection.cpp
+++ b/WebCore/khtml/editing/selection.cpp
@@ -96,6 +96,7 @@ Selection::Selection(const Selection &o)
 	assignStartAndEnd(o.start(), o.end());
 
     m_state = o.m_state;
+    m_affinity = o.m_affinity;
 
     m_baseIsStart = o.m_baseIsStart;
     m_needsCaretLayout = o.m_needsCaretLayout;
@@ -123,6 +124,7 @@ void Selection::init()
     m_baseIsStart = true;
     m_needsCaretLayout = true;
     m_modifyBiasSet = false;
+    m_affinity = DOWNSTREAM;
 }
 
 Selection &Selection::operator=(const Selection &o)
@@ -131,6 +133,7 @@ Selection &Selection::operator=(const Selection &o)
 	assignStartAndEnd(o.start(), o.end());
 
     m_state = o.m_state;
+    m_affinity = o.m_affinity;
 
     m_baseIsStart = o.m_baseIsStart;
     m_needsCaretLayout = o.m_needsCaretLayout;
@@ -150,6 +153,15 @@ Selection &Selection::operator=(const Selection &o)
     return *this;
 }
 
+void Selection::setAffinity(EAffinity affinity)
+{
+    if (affinity == m_affinity)
+        return;
+        
+    m_affinity = affinity;
+    setNeedsLayout();
+}
+
 void Selection::moveTo(const Range &r)
 {
     Position start(r.startContainer().handle(), r.startOffset());
@@ -384,6 +396,8 @@ void Selection::layoutCaret()
         m_caretX = m_caretY = m_caretSize = 0;
     }
     else {
+        // EDIT FIXME: Enhance call to pass along selection 
+        // upstream/downstream affinity to get the right position.
         int w;
         start().node()->renderer()->caretPos(start().offset(), true, m_caretX, m_caretY, w, m_caretSize);
     }
diff --git a/WebCore/khtml/editing/selection.h b/WebCore/khtml/editing/selection.h
index ed287cb..8d963c2 100644
--- a/WebCore/khtml/editing/selection.h
+++ b/WebCore/khtml/editing/selection.h
@@ -45,18 +45,26 @@ class Range;
 class Selection
 {
 public:
+	enum EState { NONE, CARET, RANGE };
+	enum EAlter { MOVE, EXTEND };
+	enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT, UP, DOWN };
+	enum ETextGranularity { CHARACTER, WORD, LINE };
+
+    // These match the AppKit values for these concepts.
+    // From NSTextView.h:
+    // NSSelectionAffinityUpstream = 0
+    // NSSelectionAffinityUpstream = 1
+    enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 };
+
     Selection();
     Selection(const Position &);
     Selection(const Position &, const Position &);
     Selection(const Selection &);
     ~Selection() {}
 
-	enum EState { NONE, CARET, RANGE };
-	enum EAlter { MOVE, EXTEND };
-	enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT, UP, DOWN };
-	enum ETextGranularity { CHARACTER, WORD, LINE };
-
 	EState state() const { return m_state; }
+	EAffinity affinity() const { return m_affinity; }
+    void setAffinity(EAffinity);
 
     void moveTo(const Range &);
     void moveTo(const Selection &);
@@ -123,6 +131,7 @@ private:
     Position m_end;               // end position for the selection
 
 	EState m_state;               // the state of the selection
+	EAffinity m_affinity;         // the upstream/downstream affinity of the selection
 
 	int m_caretX;                 // caret coordinates and size
 	int m_caretY;
diff --git a/WebCore/khtml/xml/dom_selection.cpp b/WebCore/khtml/xml/dom_selection.cpp
index 8bc9a20..6f1774f 100644
--- a/WebCore/khtml/xml/dom_selection.cpp
+++ b/WebCore/khtml/xml/dom_selection.cpp
@@ -96,6 +96,7 @@ Selection::Selection(const Selection &o)
 	assignStartAndEnd(o.start(), o.end());
 
     m_state = o.m_state;
+    m_affinity = o.m_affinity;
 
     m_baseIsStart = o.m_baseIsStart;
     m_needsCaretLayout = o.m_needsCaretLayout;
@@ -123,6 +124,7 @@ void Selection::init()
     m_baseIsStart = true;
     m_needsCaretLayout = true;
     m_modifyBiasSet = false;
+    m_affinity = DOWNSTREAM;
 }
 
 Selection &Selection::operator=(const Selection &o)
@@ -131,6 +133,7 @@ Selection &Selection::operator=(const Selection &o)
 	assignStartAndEnd(o.start(), o.end());
 
     m_state = o.m_state;
+    m_affinity = o.m_affinity;
 
     m_baseIsStart = o.m_baseIsStart;
     m_needsCaretLayout = o.m_needsCaretLayout;
@@ -150,6 +153,15 @@ Selection &Selection::operator=(const Selection &o)
     return *this;
 }
 
+void Selection::setAffinity(EAffinity affinity)
+{
+    if (affinity == m_affinity)
+        return;
+        
+    m_affinity = affinity;
+    setNeedsLayout();
+}
+
 void Selection::moveTo(const Range &r)
 {
     Position start(r.startContainer().handle(), r.startOffset());
@@ -384,6 +396,8 @@ void Selection::layoutCaret()
         m_caretX = m_caretY = m_caretSize = 0;
     }
     else {
+        // EDIT FIXME: Enhance call to pass along selection 
+        // upstream/downstream affinity to get the right position.
         int w;
         start().node()->renderer()->caretPos(start().offset(), true, m_caretX, m_caretY, w, m_caretSize);
     }
diff --git a/WebCore/khtml/xml/dom_selection.h b/WebCore/khtml/xml/dom_selection.h
index ed287cb..8d963c2 100644
--- a/WebCore/khtml/xml/dom_selection.h
+++ b/WebCore/khtml/xml/dom_selection.h
@@ -45,18 +45,26 @@ class Range;
 class Selection
 {
 public:
+	enum EState { NONE, CARET, RANGE };
+	enum EAlter { MOVE, EXTEND };
+	enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT, UP, DOWN };
+	enum ETextGranularity { CHARACTER, WORD, LINE };
+
+    // These match the AppKit values for these concepts.
+    // From NSTextView.h:
+    // NSSelectionAffinityUpstream = 0
+    // NSSelectionAffinityUpstream = 1
+    enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 };
+
     Selection();
     Selection(const Position &);
     Selection(const Position &, const Position &);
     Selection(const Selection &);
     ~Selection() {}
 
-	enum EState { NONE, CARET, RANGE };
-	enum EAlter { MOVE, EXTEND };
-	enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT, UP, DOWN };
-	enum ETextGranularity { CHARACTER, WORD, LINE };
-
 	EState state() const { return m_state; }
+	EAffinity affinity() const { return m_affinity; }
+    void setAffinity(EAffinity);
 
     void moveTo(const Range &);
     void moveTo(const Selection &);
@@ -123,6 +131,7 @@ private:
     Position m_end;               // end position for the selection
 
 	EState m_state;               // the state of the selection
+	EAffinity m_affinity;         // the upstream/downstream affinity of the selection
 
 	int m_caretX;                 // caret coordinates and size
 	int m_caretY;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index dad4db9..3f35d7c 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -253,8 +253,9 @@ typedef enum {
 - (int)selectionStartOffset;
 - (DOMNode *)selectionEnd;
 - (int)selectionEndOffset;
-- (void)setSelectedDOMRange:(DOMRange *)range;
+- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity;
 - (DOMRange *)selectedDOMRange;
+- (NSSelectionAffinity)selectionAffinity;
 
 - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
 
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 1de6dfd..5efb6e6 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -1355,7 +1355,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
         _part->setXPosForVerticalArrowNavigation(xPos);
 }
 
-- (void)setSelectedDOMRange:(DOMRange *)range
+- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity
 {
     NodeImpl *startContainer = [[range startContainer] _nodeImpl];
     NodeImpl *endContainer = [[range endContainer] _nodeImpl];
@@ -1367,6 +1367,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     DocumentImpl *doc = startContainer->getDocument();
     doc->updateLayout();
     Selection selection(Position(startContainer, [range startOffset]), Position(endContainer, [range endOffset]));
+    selection.setAffinity(static_cast<Selection::EAffinity>(selectionAffinity));
     _part->setSelection(selection);
 }
 
@@ -1375,6 +1376,11 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     return [DOMRange _rangeWithImpl:_part->selection().toRange().handle()];
 }
 
+- (NSSelectionAffinity)selectionAffinity
+{
+    return static_cast<NSSelectionAffinity>(_part->selection().affinity());
+}
+
 - (void)replaceSelectionWithNode:(DOMNode *)node
 {
     ERROR("unimplemented");
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index e2f0906..ead11fc 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,28 @@
 2004-04-22  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by John
+
+        Adds the notion of selection affinity to the editing API, bringing it up to
+        date with the latest proposal.
+
+        * WebView.subproj/WebView.m:
+        (-[WebView _alterCurrentSelection:direction:granularity:]): Pass selection affinity
+        to the delegate. We can just pass the current one since this does not change with arrow keys.
+        (-[WebView setSelectedDOMRange:affinity:]): Set the affinity on the selection.
+        (-[WebView selectionAffinity]): New accessor.
+        (-[WebView insertNode:replacingDOMRange:]): Change to pass selection affinity to call
+        to set selection. This is just to get the code to compile for now, since this method
+        will soon be removed in place of a similar one from the latest proposal that always
+        works on the current selection.
+        (-[WebView insertText:replacingDOMRange:]): Ditto.
+        (-[WebView insertMarkupString:replacingDOMRange:]): Ditto.
+        (-[WebView insertWebArchive:replacingDOMRange:]): Ditto.
+        (-[WebView deleteDOMRange:]): Ditto.
+        (-[WebView applyStyle:toElementsInDOMRange:]): Ditto.
+        * WebView.subproj/WebViewPrivate.h: Add selection affinity to API declarations as needed.
+
+2004-04-22  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by Darin
 
         Work around this bug:
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 08219b6..1e36d84 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -2051,7 +2051,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 {
     WebBridge *bridge = [self _bridgeForCurrentSelection];
     DOMRange *proposedRange = [bridge rangeByAlteringCurrentSelection:alteration direction:direction granularity:granularity];
-    if ([[self _editingDelegateForwarder] webView:self shouldChangeSelectedDOMRange:[self selectedDOMRange] toDOMRange:proposedRange stillSelecting:NO]) {
+    if ([[self _editingDelegateForwarder] webView:self shouldChangeSelectedDOMRange:[self selectedDOMRange] toDOMRange:proposedRange affinity:[bridge selectionAffinity] stillSelecting:NO]) {
         [bridge alterCurrentSelection:alteration direction:direction granularity:granularity];
         [bridge ensureCaretVisible];
     }
@@ -2092,9 +2092,9 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     [self interpretKeyEvents:[NSArray arrayWithObject:event]];
 }
 
-- (void)setSelectedDOMRange:(DOMRange *)range
+- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity
 {
-    [[self _bridgeForCurrentSelection] setSelectedDOMRange:range];
+    [[self _bridgeForCurrentSelection] setSelectedDOMRange:range affinity:selectionAffinity];
 }
 
 - (DOMRange *)selectedDOMRange
@@ -2102,6 +2102,11 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     return [[self _bridgeForCurrentSelection] selectedDOMRange];
 }
 
+- (NSSelectionAffinity)selectionAffinity
+{
+    return [[self _bridgeForCurrentSelection] selectionAffinity];
+}
+
 - (void)setEditable:(BOOL)flag
 {
     _private->editable = flag;
@@ -2182,7 +2187,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         return;
         
     WebBridge *bridge = [self _bridgeForCurrentSelection];
-    [bridge setSelectedDOMRange:range];
+    [bridge setSelectedDOMRange:range affinity:[bridge selectionAffinity]];
     [bridge replaceSelectionWithNode:node];
 }    
 
@@ -2192,7 +2197,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         return;
 
     WebBridge *bridge = [self _bridgeForCurrentSelection];
-    [bridge setSelectedDOMRange:range];
+    [bridge setSelectedDOMRange:range affinity:[bridge selectionAffinity]];
     [bridge replaceSelectionWithText:text];
 }
 
@@ -2202,7 +2207,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         return;
 
     WebBridge *bridge = [self _bridgeForCurrentSelection];
-    [bridge setSelectedDOMRange:range];
+    [bridge setSelectedDOMRange:range affinity:[bridge selectionAffinity]];
     [bridge replaceSelectionWithMarkupString:markupString baseURLString:nil];
 }
 
@@ -2212,7 +2217,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         return;
 
     WebBridge *bridge = [self _bridgeForCurrentSelection];
-    [bridge setSelectedDOMRange:range];
+    [bridge setSelectedDOMRange:range affinity:[bridge selectionAffinity]];
     [[[bridge webFrame] dataSource] _replaceSelectionWithWebArchive:archive];
 }
 
@@ -2222,7 +2227,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         return;
 
     WebBridge *bridge = [self _bridgeForCurrentSelection];
-    [bridge setSelectedDOMRange:range];
+    [bridge setSelectedDOMRange:range affinity:[bridge selectionAffinity]];
     [bridge deleteSelection];
 }
     
@@ -2232,7 +2237,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         return;
 
     WebBridge *bridge = [self _bridgeForCurrentSelection];
-    [bridge setSelectedDOMRange:range];
+    [bridge setSelectedDOMRange:range affinity:[bridge selectionAffinity]];
     [bridge applyStyle:style toElementsInDOMRange:range];
 }
 
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 397939d..efa274f 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -324,7 +324,7 @@ typedef enum {
 @end
 
 @interface WebView (WebViewEditing)
-- (void)setSelectedDOMRange:(DOMRange *)range;
+- (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity;
 - (DOMRange *)selectedDOMRange;
 - (void)setEditable:(BOOL)flag;
 - (BOOL)isEditable;
@@ -361,7 +361,7 @@ extern NSString * const WebViewDidChangeSelectionNotification;
 - (BOOL)webView:(WebView *)webView shouldInsertNode:(DOMNode *)node replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
 - (BOOL)webView:(WebView *)webView shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action;
 - (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range;
-- (BOOL)webView:(WebView *)webView shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange stillSelecting:(BOOL)flag;
+- (BOOL)webView:(WebView *)webView shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
 - (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range;
 - (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle;
 - (BOOL)webView:(WebView *)webView doCommandBySelector:(SEL)selector;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list