[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.0/kdelibs/khtml/xml
From:       Harri Porten <porten () kde ! org>
Date:       2008-03-16 13:11:03
Message-ID: 1205673063.165992.24914.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 786233 by porten:

Fields with a negative tabindex property are supposed to be skipped
during tabbing.

Lost the ability to cover the full range up to 32767 now. What happens
on overflows needs to be investigated either way.


 M  +7 -7      dom_docimpl.cpp  
 M  +3 -3      dom_nodeimpl.h  


--- branches/KDE/4.0/kdelibs/khtml/xml/dom_docimpl.cpp #786232:786233
@@ -1458,13 +1458,13 @@
 
 NodeImpl *DocumentImpl::nextFocusNode(NodeImpl *fromNode)
 {
-    unsigned short fromTabIndex;
+    short fromTabIndex;
 
     if (!fromNode) {
 	// No starting node supplied; begin with the top of the document
 	NodeImpl *n;
 
-	int lowestTabIndex = 65535;
+	int lowestTabIndex = SHRT_MAX + 1;
 	for (n = this; n != 0; n = n->traverseNextNode()) {
 	    if (n->isTabFocusable()) {
 		if ((n->tabIndex() > 0) && (n->tabIndex() < lowestTabIndex))
@@ -1472,7 +1472,7 @@
 	    }
 	}
 
-	if (lowestTabIndex == 65535)
+	if (lowestTabIndex == SHRT_MAX + 1)
 	    lowestTabIndex = 0;
 
 	// Go to the first node in the document that has the desired tab index
@@ -1499,7 +1499,7 @@
 	// tab index. For nodes with the same tab index as fromNode, we are only interested \
in those that come after  // fromNode in document order.
 	// If we don't find a suitable tab index, the next focus node will be one with a \
                tab index of 0.
-	unsigned short lowestSuitableTabIndex = 65535;
+	int lowestSuitableTabIndex = SHRT_MAX + 1;
 	NodeImpl *n;
 
 	bool reachedFromNode = false;
@@ -1519,7 +1519,7 @@
 		reachedFromNode = true;
 	}
 
-	if (lowestSuitableTabIndex == 65535) {
+	if (lowestSuitableTabIndex == SHRT_MAX + 1) {
 	    // No next node with a tab index -> just take first node with tab index of 0
 	    NodeImpl *n = this;
 	    while (n && !(n->isTabFocusable() && n->tabIndex() == 0))
@@ -1573,7 +1573,7 @@
 	return 0;
     }
     else {
-	unsigned short fromTabIndex = fromNode->tabIndex();
+	short fromTabIndex = fromNode->tabIndex();
 
 	if (fromTabIndex == 0) {
 	    // Find the previous selectable node before fromNode (in document order) that \
doesn't have a tab index @@ -1606,7 +1606,7 @@
 	    // tab index. For nodes with the same tab index as fromNode, we are only \
interested in those before  // fromNode.
 	    // If we don't find a suitable tab index, then there will be no previous focus \
                node.
-	    unsigned short highestSuitableTabIndex = 0;
+	    short highestSuitableTabIndex = 0;
 	    NodeImpl *n;
 
 	    bool reachedFromNode = false;
--- branches/KDE/4.0/kdelibs/khtml/xml/dom_nodeimpl.h #786232:786233
@@ -252,8 +252,8 @@
     bool hasClassList() const { return m_hasClassList; }
     void setHasClassList(bool b) { m_hasClassList = b; }
 
-    unsigned short tabIndex() const { return m_tabIndex; }
-    void setTabIndex(unsigned short _tabIndex) { m_tabIndex = _tabIndex; }
+    short tabIndex() const { return m_tabIndex; }
+    void setTabIndex(short _tabIndex) { m_tabIndex = _tabIndex; }
 
     virtual bool isFocusable() const { return false; }
     virtual bool isMouseFocusable() const { return isFocusable(); }
@@ -470,7 +470,7 @@
     khtml::RenderObject *m_render;
     RegisteredListenerList m_regdListeners;
 
-    unsigned short m_tabIndex : 15;
+    signed m_tabIndex : 15; // ### needs one bit more
 
     bool m_hasId : 1;
     bool m_attached : 1;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic