From 88c81ae2263ae20fe63c346d9237d285cc12e84b Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Fri, 2 Jul 2010 10:35:08 -0400 Subject: don't walk off the end of the DOM when looking for text Also, fix a couple of minor changes in debugging code to stay sync'd with webkit. Change-Id: If4263bab97715e2a2d12f06f2359554740bf5dbc http://b/2816549 --- WebKit/android/nav/CacheBuilder.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'WebKit/android') diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index 9ad9b71..1c8af5e 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -412,7 +412,7 @@ void CacheBuilder::Debug::groups() { comma(scratch); Element* element = static_cast(node); if (node->isElementNode() && element->hasID()) - wideString(element->getIDAttribute()); + wideString(element->getIdAttribute()); else if (node->isTextNode()) { #if 01 // set to one to abbreviate text that can be omitted from the address detection code if (rect.isEmpty() && node->textContent().length() > 100) { @@ -475,7 +475,7 @@ void CacheBuilder::Debug::groups() { " visibility=%s hasBackGround=%d" " tapHighlightColor().alpha()=0x%02x", style->visibility() == HIDDEN ? "HIDDEN" : "VISIBLE", - style->hasBackground(), style->tapHighlightColor().alpha()); + renderer->hasBackground(), style->tapHighlightColor().alpha()); newLine(); print(scratch); RenderBlock* renderBlock = static_cast(renderer); @@ -2709,7 +2709,8 @@ bool CacheBuilder::isFocusableText(NodeWalk* walk, bool more, Node* node, do { do { do { - node = node->traverseNextNode(); + if (node) + node = node->traverseNextNode(); if (node == NULL || node->hasTagName(HTMLNames::aTag) || node->hasTagName(HTMLNames::inputTag) || node->hasTagName(HTMLNames::textareaTag)) { -- cgit v1.1