break;
len++;
}
- while (mBuffer[len] == '\\' || mBuffer[len] == '"')
+ while (len > 0 && mBuffer[len - 1] == '\\')
+ len--;
+ while (mBuffer[len] == '"')
len++;
}
const char* prefix = mPrefix;
} 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;
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},");
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) {
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);