diff options
Diffstat (limited to 'WebKit/android/nav/CachedNode.h')
| -rw-r--r-- | WebKit/android/nav/CachedNode.h | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/WebKit/android/nav/CachedNode.h b/WebKit/android/nav/CachedNode.h index aa64982..2efbaf7 100644 --- a/WebKit/android/nav/CachedNode.h +++ b/WebKit/android/nav/CachedNode.h @@ -40,6 +40,7 @@ namespace WebCore { namespace android { class CachedFrame; +class CachedRoot; class CachedNode { public: @@ -53,10 +54,10 @@ public: BUTTED_UP, CENTER_FURTHER, CLOSER, - CLOSER_IN_FOCUS, + CLOSER_IN_CURSOR, CLOSER_OVERLAP, CLOSER_TOP, - FOCUSABLE, + NAVABLE, FURTHER, IN_UMBRA, IN_WORKING, @@ -70,11 +71,10 @@ public: CHILD, DISABLED, HIGHER_TAB_INDEX, - IN_FOCUS, - IN_FOCUS_CHILDREN, - NOT_ENCLOSING_FOCUS, - // NOT_FOCUS_CHILD, - NOT_FOCUS_NODE, + IN_CURSOR, + IN_CURSOR_CHILDREN, + NOT_ENCLOSING_CURSOR, + NOT_CURSOR_NODE, OUTSIDE_OF_BEST, // containership OUTSIDE_OF_ORIGINAL, // containership CONDITION_SIZE // FIXME: test that CONDITION_SIZE fits in mCondition @@ -88,41 +88,43 @@ public: WebCore::IntRect* boundsPtr() { return &mBounds; } int childFrameIndex() const { return mChildFrameIndex; } void clearCondition() const { mCondition = NOT_REJECTED; } - void clearFocus(CachedFrame* ); + void clearCursor(CachedFrame* ); static bool Clip(const WebCore::IntRect& outer, WebCore::IntRect* inner, WTF::Vector<WebCore::IntRect>* rings); bool clip(const WebCore::IntRect& ); bool clippedOut() { return mClippedOut; } + void cursorRingBounds(WebCore::IntRect* ) const; bool disabled() const { return mDisabled; } const CachedNode* document() const { return &this[-mIndex]; } - void fixUpFocusRects(); - void focusRingBounds(WebCore::IntRect* ) const; - WTF::Vector<WebCore::IntRect>& focusRings() { return mFocusRing; } - const WTF::Vector<WebCore::IntRect>& focusRings() const { return mFocusRing; } + void fixUpCursorRects(const CachedRoot* root); + WTF::Vector<WebCore::IntRect>& cursorRings() { return mCursorRing; } + const WTF::Vector<WebCore::IntRect>& cursorRings() const { return mCursorRing; } const WebCore::IntRect& getBounds() const { return mBounds; } void getBounds(WebCore::IntRect* bounds) const { *bounds = mBounds; } const WebCore::String& getExport() const { return mExport; } - bool hasFocusRing() const { return mHasFocusRing; } + bool hasCursorRing() const { return !mIsHidden && mHasCursorRing; } bool hasMouseOver() const { return mHasMouseOver; } + void hideCursor(CachedFrame* ); const WebCore::IntRect& hitBounds() const { return mHitBounds; } int index() const { return mIndex; } void init(WebCore::Node* node); bool isAnchor() const { return mIsAnchor; } + bool isCursor() const { return mIsCursor; } bool isArea() const { return mIsArea; } bool isFocus() const { return mIsFocus; } - bool isFocusable(const WebCore::IntRect& clip) const { + bool isFrame() const { return mChildFrameIndex >= 0 ; } + bool isNavable(const WebCore::IntRect& clip) const { return clip.intersects(mBounds); } - bool isFrame() const { return mChildFrameIndex >= 0 ; } - bool isInput() const { return mIsInput; } bool isPassword() const { return mIsPassword; } + bool isPlugin() const { + return mWantsKeyEvents && !mIsTextArea && !mIsTextField; + } bool isRtlText() const { return mIsRtlText; } bool isTextArea() const { return mIsTextArea; } bool isTextField() const { return mIsTextField; } bool isTransparent() const { return mIsTransparent; } bool isUnclipped() const { return mIsUnclipped; } - bool isWantsKeyEvents() const { return mWantsKeyEvents; } - int maxLength() const { return mMaxLength; }; void move(int x, int y); const WebCore::String& name() const { return mName; } @@ -140,14 +142,14 @@ public: void setCondition(Condition condition) const { mCondition = condition; } void setDisabled(bool disabled) { mDisabled = disabled; } void setExport(const WebCore::String& exported) { mExport = exported; } - void setHasFocusRing(bool hasFocusRing) { mHasFocusRing = hasFocusRing; } + void setHasCursorRing(bool hasRing) { mHasCursorRing = hasRing; } void setHasMouseOver(bool hasMouseOver) { mHasMouseOver = hasMouseOver; } void setHitBounds(const WebCore::IntRect& bounds) { mHitBounds = bounds; } void setIndex(int index) { mIndex = index; } void setIsAnchor(bool isAnchor) { mIsAnchor = isAnchor; } void setIsArea(bool isArea) { mIsArea = isArea; } + void setIsCursor(bool isCursor) { mIsCursor = isCursor; } void setIsFocus(bool isFocus) { mIsFocus = isFocus; } - void setIsInput(bool isInput) { mIsInput = isInput; } void setIsParentAnchor(bool isAnchor) { mIsParentAnchor = isAnchor; } void setIsPassword(bool isPassword) { mIsPassword = isPassword; } void setIsRtlText(bool isRtlText) { mIsRtlText = isRtlText; } @@ -158,23 +160,27 @@ public: void setLast() { mLast = true; } void setMaxLength(int maxLength) { mMaxLength = maxLength; } void setName(const WebCore::String& name) { mName = name; } - void setNavableRects() { mNavableRects = mFocusRing.size(); } + void setNavableRects() { mNavableRects = mCursorRing.size(); } void setParentGroup(void* group) { mParentGroup = group; } void setParentIndex(int parent) { mParentIndex = parent; } void setTabIndex(int index) { mTabIndex = index; } void setTextSize(int textSize) { mTextSize = textSize; } void setType(CachedNodeType type) { mType = type; } void setWantsKeyEvents(bool wantsKeys) { mWantsKeyEvents = wantsKeys; } + void show() { mIsHidden = false; } int tabIndex() const { return mTabIndex; } const CachedNode* traverseNextNode() const { return mLast ? NULL : &this[1]; } int textSize() const { return mTextSize; } CachedNodeType type() const { return mType; } + bool useBounds() const { return mUseBounds; } + bool useHitBounds() const { return mUseHitBounds; } + bool wantsKeyEvents() const { return mWantsKeyEvents; } private: WebCore::String mExport; WebCore::String mName; WebCore::IntRect mBounds; WebCore::IntRect mHitBounds; - WTF::Vector<WebCore::IntRect> mFocusRing; + WTF::Vector<WebCore::IntRect> mCursorRing; void* mNode; // WebCore::Node*, only used to match pointers void* mParentGroup; // WebCore::Node*, only used to match pointers int mChildFrameIndex; // set to -1 if node is not a frame @@ -188,13 +194,14 @@ private: CachedNodeType mType : 3; bool mClippedOut : 1; bool mDisabled : 1; - bool mFixedUpFocusRects : 1; - bool mHasFocusRing : 1; + bool mFixedUpCursorRects : 1; + bool mHasCursorRing : 1; bool mHasMouseOver : 1; bool mIsAnchor : 1; bool mIsArea : 1; + bool mIsCursor : 1; bool mIsFocus : 1; - bool mIsInput : 1; + bool mIsHidden : 1; bool mIsParentAnchor : 1; bool mIsPassword : 1; bool mIsRtlText : 1; @@ -203,6 +210,8 @@ private: bool mIsTransparent : 1; bool mIsUnclipped : 1; bool mLast : 1; // true if this is the last node in a group + bool mUseBounds : 1; + bool mUseHitBounds : 1; bool mWantsKeyEvents : 1; // true for nodes like plugins #ifdef BROWSER_DEBUG public: |
