Back to index

lightning-sunbird  0.9+nobinonly
nsFrameList.cpp File Reference
#include "nsFrameList.h"
#include "nsVoidArray.h"
#include "nsLayoutUtils.h"

Go to the source code of this file.


static int PR_CALLBACK CompareByContentOrder (const void *aF1, const void *aF2, void *aDummy)

Function Documentation

static int PR_CALLBACK CompareByContentOrder ( const void aF1,
const void aF2,
void aDummy 
) [static]

Definition at line 424 of file nsFrameList.cpp.

  const nsIFrame* f1 = NS_STATIC_CAST(const nsIFrame*, aF1);
  const nsIFrame* f2 = NS_STATIC_CAST(const nsIFrame*, aF2);
  if (f1->GetContent() != f2->GetContent()) {
    return nsLayoutUtils::CompareTreePosition(f1->GetContent(), f2->GetContent());

  if (f1 == f2) {
    return 0;

  const nsIFrame* f;
  for (f = f2; f; f = f->GetPrevInFlow()) {
    if (f == f1) {
      // f1 comes before f2 in the flow
      return -1;
  for (f = f1; f; f = f->GetPrevInFlow()) {
    if (f == f2) {
      // f1 comes after f2 in the flow
      return 1;

  NS_ASSERTION(PR_FALSE, "Frames for same content but not in relative flow order");
  return 0;

Here is the call graph for this function:

Here is the caller graph for this function: