Status

()

Core
Layout
P2
normal
VERIFIED FIXED
20 years ago
11 years ago

People

(Reporter: Stephen P. Morse, Assigned: vidur (gone))

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

20 years ago
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

20 years ago
Status: NEW → RESOLVED
Last Resolved: 20 years ago
Resolution: --- → FIXED
(Assignee)

Comment 1

20 years ago
Fixed on 1/17/1999.

Updated

20 years ago
QA Contact: 4110

Comment 2

20 years ago
setting qa_assign field.

Updated

20 years ago
Status: RESOLVED → VERIFIED

Comment 3

20 years ago
Using 2/11 build, verified fixed.
You need to log in before you can comment on or make changes to this bug.