diff options
| author | Cary Clark <cary@android.com> | 2009-10-21 13:59:54 -0400 |
|---|---|---|
| committer | Cary Clark <cary@android.com> | 2009-10-21 13:59:54 -0400 |
| commit | 3efa919a7f16fdb717e393f501c50d4844ffaed5 (patch) | |
| tree | 0a41b8c8f4cbd79115e56060b4c827720fc8d29f /WebKit/android/nav | |
| parent | b2b357d86298bbd50e3dee2bc7cc1f48ce6d57a0 (diff) | |
| download | external_webkit-3efa919a7f16fdb717e393f501c50d4844ffaed5.zip external_webkit-3efa919a7f16fdb717e393f501c50d4844ffaed5.tar.gz external_webkit-3efa919a7f16fdb717e393f501c50d4844ffaed5.tar.bz2 | |
fix multiple text areas, and text areas without focus rings
Separate nodes that are hidden from nodes that disable
drawing the focus ring. If a node draws its own focus state,
other than not drawing the ring, it should be indistinguishable
from other focusable nodes.
Fix the nav cache dump to be in line with the latest webkit.
fixes http://b/issue?id=2201049
Diffstat (limited to 'WebKit/android/nav')
| -rw-r--r-- | WebKit/android/nav/CacheBuilder.cpp | 13 | ||||
| -rw-r--r-- | WebKit/android/nav/CachedNode.h | 3 | ||||
| -rw-r--r-- | WebKit/android/nav/WebView.cpp | 11 |
3 files changed, 12 insertions, 15 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index b7a650b..39f0053 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -94,14 +94,11 @@ Frame* CacheBuilder::FrameAnd(const CacheBuilder* cacheBuilder) { #if DUMP_NAV_CACHE static bool hasEventListener(Node* node, const AtomicString& eventType) { - const RegisteredEventListenerVector& listeners = node->eventListeners(); - size_t size = listeners.size(); - for (size_t i = 0; i < size; ++i) { - const RegisteredEventListener& r = *listeners[i]; - if (r.eventType() == eventType) - return true; - } - return false; + if (!node->isElementNode()) + return false; + Element* element = static_cast<Element*>(node); + EventListener* listener = element->getAttributeEventListener(eventType); + return 0 != listener; } #define DEBUG_BUFFER_SIZE 256 diff --git a/WebKit/android/nav/CachedNode.h b/WebKit/android/nav/CachedNode.h index 540ba49..f5f5787 100644 --- a/WebKit/android/nav/CachedNode.h +++ b/WebKit/android/nav/CachedNode.h @@ -102,7 +102,7 @@ public: const WebCore::IntRect& getBounds() const { return mBounds; } void getBounds(WebCore::IntRect* bounds) const { *bounds = mBounds; } const WebCore::String& getExport() const { return mExport; } - bool hasCursorRing() const { return !mIsHidden && mHasCursorRing; } + bool hasCursorRing() const { return mHasCursorRing; } bool hasMouseOver() const { return mHasMouseOver; } void hideCursor(CachedFrame* ); const WebCore::IntRect& hitBounds() const { return mHitBounds; } @@ -113,6 +113,7 @@ public: bool isArea() const { return mIsArea; } bool isFocus() const { return mIsFocus; } bool isFrame() const { return mChildFrameIndex >= 0 ; } + bool isHidden() const { return mIsHidden; } bool isNavable(const WebCore::IntRect& clip) const { return clip.intersects(mBounds); } diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 0b1a4cf..9793ed4 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -437,8 +437,8 @@ void drawCursorRing(SkCanvas* canvas) resetCursorRing(); return; } - if (!node->hasCursorRing()) { - DBG_NAV_LOG("!node->hasCursorRing()"); + if (node->isHidden()) { + DBG_NAV_LOG("node->isHidden()"); m_viewImpl->m_hasCursorBounds = false; return; } @@ -486,13 +486,12 @@ void drawCursorRing(SkCanvas* canvas) setPluginReceivesEvents(false); return; } + if (!node->hasCursorRing() || (m_pluginReceivesEvents && node->isPlugin())) + return; CursorRing::Flavor flavor = CursorRing::NORMAL_FLAVOR; if (!isButton) { flavor = node->type() != NORMAL_CACHEDNODETYPE ? CursorRing::FAKE_FLAVOR : CursorRing::NORMAL_FLAVOR; - if (m_pluginReceivesEvents && node->isPlugin()) { - return; - } if (m_followedLink) { flavor = static_cast<CursorRing::Flavor> (flavor + CursorRing::NORMAL_ANIMATING); @@ -737,7 +736,7 @@ void updateCursorBounds(const CachedRoot* root, const CachedFrame* cachedFrame, LOG_ASSERT(cachedNode, "updateCursorBounds: cachedNode cannot be null"); LOG_ASSERT(cachedFrame, "updateCursorBounds: cachedFrame cannot be null"); m_viewImpl->gCursorBoundsMutex.lock(); - m_viewImpl->m_hasCursorBounds = cachedNode->hasCursorRing(); + m_viewImpl->m_hasCursorBounds = !cachedNode->isHidden(); // If m_viewImpl->m_hasCursorBounds is false, we never look at the other // values, so do not bother setting them. if (m_viewImpl->m_hasCursorBounds) { |
