summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-30 12:39:07 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-30 12:39:07 -0800
commit39e2da62da0cbe8b66815b72ea0a2a3e13bda40b (patch)
treef96584c869d23289149a8621ae2ccf160d47efcf /WebKit
parentdf52d1194a5c266d0d20b5f65e24fd93edd34618 (diff)
parentb72d8281f4bbdb36f2d4a57c71fd266c41399c21 (diff)
downloadexternal_webkit-39e2da62da0cbe8b66815b72ea0a2a3e13bda40b.zip
external_webkit-39e2da62da0cbe8b66815b72ea0a2a3e13bda40b.tar.gz
external_webkit-39e2da62da0cbe8b66815b72ea0a2a3e13bda40b.tar.bz2
Merge change Ib72d8281 into eclair-mr2
* changes: fix bugs in nav cache dump
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp14
-rw-r--r--WebKit/android/nav/CachedNode.cpp14
2 files changed, 20 insertions, 8 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 4682620..37bdc9a 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -141,7 +141,9 @@ void CacheBuilder::Debug::flush() {
break;
len++;
}
- while (mBuffer[len] == '\\' || mBuffer[len] == '"')
+ while (len > 0 && mBuffer[len - 1] == '\\')
+ len--;
+ while (mBuffer[len] == '"')
len++;
}
const char* prefix = mPrefix;
@@ -347,8 +349,11 @@ void CacheBuilder::Debug::groups() {
} while ((node = node->traverseNextNode()) != NULL);
int focusIndex = -1;
if (atLeastOne == false) {
- DUMP_NAV_LOGD("#define TEST%s_RECTS NULL\n", name);
- DUMP_NAV_LOGD("static int TEST%s_RECT_COUNT = 0; // no focusable nodes\n", name);
+ DUMP_NAV_LOGD("static DebugTestNode TEST%s_RECTS[] = {\n"
+ "{{0, 0, 0, 0}, \"\", 0, -1, \"\", {0, 0, 0, 0}, false, 0}\n"
+ "};\n\n", name);
+ DUMP_NAV_LOGD("static int TEST%s_RECT_COUNT = 1;"
+ " // no focusable nodes\n", name);
DUMP_NAV_LOGD("#define TEST%s_RECTPARTS NULL\n", name);
} else {
node = doc;
@@ -433,6 +438,7 @@ void CacheBuilder::Debug::groups() {
snprintf(scratch, sizeof(scratch), ", {%d, %d, %d, %d}, %s"
", %d},",absB.x(), absB.y(), absB.width(), absB.height(),
renderer->hasOverflowClip() ? "true" : "false", tabindex);
+ // TODO: add renderer->style()->visibility()
print(scratch);
} else
print(", {0, 0, 0, 0}, false, 0},");
@@ -545,7 +551,7 @@ void CacheBuilder::Debug::groups() {
int contentsHeight = layer->height();
DUMP_NAV_LOGD("static int TEST%s_FOCUS = %d;\n", name, focusIndex);
DUMP_NAV_LOGD("static int TEST%s_WIDTH = %d;\n", name, contentsWidth);
- DUMP_NAV_LOGD("static int TEST%s_HEIGHT = %d;\n", name, contentsHeight);
+ DUMP_NAV_LOGD("static int TEST%s_HEIGHT = %d;\n\n", name, contentsHeight);
}
bool CacheBuilder::Debug::isFocusable(Node* node) {
diff --git a/WebKit/android/nav/CachedNode.cpp b/WebKit/android/nav/CachedNode.cpp
index c8938ab..7ac39ea 100644
--- a/WebKit/android/nav/CachedNode.cpp
+++ b/WebKit/android/nav/CachedNode.cpp
@@ -316,13 +316,19 @@ void CachedNode::Debug::print() const
char scratch[256];
size_t index = snprintf(scratch, sizeof(scratch), "// char* mExport=\"");
const UChar* ch = b->mExport.characters();
- while (ch && *ch && index < sizeof(scratch))
- scratch[index++] = *ch++;
+ while (ch && *ch && index < sizeof(scratch)) {
+ UChar c = *ch++;
+ if (c < ' ' || c >= 0x7f) c = ' ';
+ scratch[index++] = c;
+ }
DUMP_NAV_LOGD("%.*s\"\n", index, scratch);
index = snprintf(scratch, sizeof(scratch), "// char* mName=\"");
ch = b->mName.characters();
- while (ch && *ch && index < sizeof(scratch))
- scratch[index++] = *ch++;
+ while (ch && *ch && index < sizeof(scratch)) {
+ UChar c = *ch++;
+ if (c < ' ' || c >= 0x7f) c = ' ';
+ scratch[index++] = c;
+ }
DUMP_NAV_LOGD("%.*s\"\n", index, scratch);
DEBUG_PRINT_RECT(mBounds);
DEBUG_PRINT_RECT(mHitBounds);