[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/khtml/xml
From: Germain Garand <germain () ebooksfrance ! org>
Date: 2009-11-08 19:28:33
Message-ID: 1257708513.320886.9217.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1046452 by ggarand:
migrate tabIndex to the rare data mechanism,
frees 15 bits of the NodeImpl bitfield.
M +15 -1 dom_elementimpl.cpp
M +3 -0 dom_elementimpl.h
M +0 -1 dom_nodeimpl.cpp
M +4 -5 dom_nodeimpl.h
--- trunk/KDE/kdelibs/khtml/xml/dom_elementimpl.cpp #1046451:1046452
@@ -366,7 +366,11 @@
public:
ElementRareDataImpl();
void resetComputedStyle();
+ short tabIndex() const { return m_tabIndex; }
+ void setTabIndex(short _tabIndex) { m_tabIndex = _tabIndex; }
+
RenderStyle* m_computedStyle;
+ signed short m_tabIndex;
};
typedef WTF::HashMap<const ElementImpl*, ElementRareDataImpl*> ElementRareDataMap;
@@ -383,7 +387,7 @@
}
inline ElementRareDataImpl::ElementRareDataImpl()
- : m_computedStyle(0)
+ : m_computedStyle(0), m_tabIndex(0)
{}
void ElementRareDataImpl::resetComputedStyle()
@@ -796,6 +800,16 @@
m_prefix = PrefixName::fromString(_prefix);
}
+short ElementImpl::tabIndex() const
+{
+ return m_elementHasRareData ? rareData()->tabIndex() : 0;
+}
+
+void ElementImpl::setTabIndex(short _tabIndex)
+{
+ createRareData()->setTabIndex(_tabIndex);
+}
+
void ElementImpl::defaultEventHandler(EventImpl *e)
{
if (!e->defaultHandled() && document()->part() && e->id() == \
EventImpl::KEYPRESS_EVENT && e->isKeyRelatedEvent()) {
--- trunk/KDE/kdelibs/khtml/xml/dom_elementimpl.h #1046451:1046452
@@ -234,6 +234,9 @@
virtual DOMString namespaceURI() const;
inline const PrefixName& prefixName() const { return m_prefix; }
+ virtual short tabIndex() const;
+ void setTabIndex(short _tabIndex);
+
// DOM methods overridden from parent classes
virtual DOMString tagName() const;
virtual DOMString localName() const;
--- trunk/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp #1046451:1046452
@@ -70,7 +70,6 @@
m_previous(0),
m_next(0),
m_render(0),
- m_tabIndex( 0 ),
m_hasId( false ),
m_attached(false),
m_closed(false),
--- trunk/KDE/kdelibs/khtml/xml/dom_nodeimpl.h #1046451:1046452
@@ -290,10 +290,9 @@
// for descending restyle when ID or CLASS changes
bool changedAscendentAttribute() const { return m_changedAscendentAttribute; }
void setChangedAscendentAttribute(bool b) { m_changedAscendentAttribute = b; }
+
+ virtual short tabIndex() const { return 0; }
- 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(); }
virtual bool isTabFocusable() const { return isFocusable(); }
@@ -520,8 +519,6 @@
khtml::RenderObject *m_render;
RegisteredListenerList m_regdListeners;
- signed m_tabIndex : 15; // ### needs one bit more
-
bool m_hasId : 1;
bool m_attached : 1;
bool m_closed : 1;
@@ -540,6 +537,8 @@
bool m_hasClass : 1; // true if element has a class property, as relevant to \
CSS
bool m_hasCombinedStyle : 1; // true if element has inline styles and \
presentational styles
bool m_hasHoverDependency : 1; // true if element has hover dependency on itself
+
+ // 15 bits left
};
// this is the full Node Implementation with parents and children.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic