Closed
Bug 2327
Opened 26 years ago
Closed 26 years ago
form lays out twice
Categories
(Core :: Layout, defect, P2)
Tracking
()
VERIFIED
FIXED
People
(Reporter: morse, Assigned: vidur)
References
()
Details
With the following code sequence I should visit each form entry exactly once.
However I am visiting the entries in the first form on the netcenter page
(i.e. the search form) twice. This is not really a bug but more of an
inefficiency. Also it's hard to demonstrate. But Vidur is familiar with it
and asked that I assign this bug to him.
nsIPresShell* shell;
shell = nsnull;
shell = GetPresShell();
if (nsnull != shell) {
nsIDocument* doc = nsnull;
doc = shell->GetDocument();
if (nsnull != doc) {
nsIDOMHTMLDocument* htmldoc = nsnull;
nsresult result =
doc->QueryInterface(kIDOMHTMLDocumentIID, (void**)&htmldoc);
if ((NS_OK == result) && (nsnull != htmldoc)) {
nsIDOMHTMLCollection* forms = nsnull;
htmldoc->GetForms(&forms);
if (nsnull != forms) {
PRUint32 numForms;
forms->GetLength(&numForms);
for (PRUint32 formX = 0; formX < numForms; formX++) {
nsIDOMNode* node = nsnull;
forms->Item(formX, &node);
if (nsnull != node) {
nsIDOMHTMLFormElement* formElement = nsnull;
result =
node->QueryInterface
(kIDOMHTMLFormElementIID, (void**)&formElement);
if ((NS_OK == result) && (nsnull != formElement)) {
nsIDOMHTMLCollection* elements = nsnull;
result = formElement->GetElements(&elements);
if ((NS_OK == result) && (nsnull != elements)) {
PRUint32 numElements;
elements->GetLength(&numElements);
for (PRUint32 elementX = 0; elementX<numElements; elementX++) {
nsIDOMNode* node2 = nsnull;
elements->Item(elementX, &node2);
if (nsnull != node2) {
nsIDOMHTMLInputElement* inputElement;
result =
node2->QueryInterface
(kIDOMHTMLInputElementIID, (void**)&inputElement);
if ((NS_OK == result) && (nsnull != inputElement)) {
nsAutoString type;
result = inputElement->GetType(type);
if ((NS_OK == result) &&
((type =="") ||
(type.Compare("text", PR_TRUE) == 0))) {
nsAutoString name;
result = inputElement->GetName(name);
if (NS_OK == result) {
nsAutoString value;
result = inputElement->GetValue(value);
if (NS_OK == result) {
fprintf(stdout,"%c %s, %s, %s (proceed?)",
'\007',
type.ToNewCString(),
name.ToNewCString(),
value.ToNewCString());
for (;;) {
char c;
c = getchar();
if (tolower(c) == 'y') {
fprintf(stdout,"OK\n");
break;
}
}
}
}
}
NS_RELEASE(inputElement);
}
NS_RELEASE(node2);
}
}
NS_RELEASE(elements);
}
NS_RELEASE(formElement);
}
NS_RELEASE(node);
}
}
NS_RELEASE(forms);
}
NS_RELEASE(htmldoc);
}
NS_RELEASE(doc);
}
NS_RELEASE(shell);
}
Assignee | ||
Updated•26 years ago
|
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 1•26 years ago
|
||
Fixed on 1/17/1999.
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 3•26 years ago
|
||
Using 2/11 build, verified fixed.
You need to log in
before you can comment on or make changes to this bug.
Description
•