Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
nsContentSink Class Reference

#include <nsContentSink.h>

Inheritance diagram for nsContentSink:
Inheritance graph
[legend]
Collaboration diagram for nsContentSink:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void scriptAvailable (in nsresult aResult, in nsIScriptElement aElement, in boolean aIsInline, in boolean aWasPending, in nsIURI aURI, in PRInt32 aLineNo, in AString aScript)
 The script is available for evaluation.
void scriptEvaluated (in nsresult aResult, in nsIScriptElement aElement, in boolean aIsInline, in boolean aWasPending)
 The script has been evaluated.

Protected Member Functions

 nsContentSink ()
virtual ~nsContentSink ()
nsresult Init (nsIDocument *aDoc, nsIURI *aURI, nsISupports *aContainer, nsIChannel *aChannel)
nsresult ProcessHTTPHeaders (nsIChannel *aChannel)
nsresult ProcessHeaderData (nsIAtom *aHeader, const nsAString &aValue, nsIContent *aContent=nsnull)
nsresult ProcessLinkHeader (nsIContent *aElement, const nsAString &aLinkData)
nsresult ProcessLink (nsIContent *aElement, const nsSubstring &aHref, const nsSubstring &aRel, const nsSubstring &aTitle, const nsSubstring &aType, const nsSubstring &aMedia)
virtual nsresult ProcessStyleLink (nsIContent *aElement, const nsSubstring &aHref, PRBool aAlternate, const nsSubstring &aTitle, const nsSubstring &aType, const nsSubstring &aMedia)
nsresult ProcessMETATag (nsIContent *aContent)
void PrefetchHref (const nsAString &aHref, PRBool aExplicit)
PRBool ScrollToRef (PRBool aReallyScroll)
nsresult RefreshIfEnabled (nsIViewManager *vm)
void StartLayout (PRBool aIsFrameset)
virtual void PreEvaluateScript ()
virtual void PostEvaluateScript ()

Protected Attributes

nsCOMPtr< nsIDocumentmDocument
nsCOMPtr< nsIParsermParser
nsCOMPtr< nsIURImDocumentURI
nsCOMPtr< nsIURImDocumentBaseURI
nsCOMPtr< nsIDocShellmDocShell
nsCOMPtr< nsICSSLoadermCSSLoader
nsRefPtr< nsNodeInfoManagermNodeInfoManager
nsCOMArray< nsIScriptElementmScriptElements
nsCString mRef
PRBool mNeedToBlockParser

Private Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSISCRIPTLOADEROBSERVER
NS_IMETHOD 
StyleSheetLoaded (nsICSSStyleSheet *aSheet, PRBool aNotify)

Detailed Description

Definition at line 66 of file nsContentSink.h.


Constructor & Destructor Documentation

nsContentSink::~nsContentSink ( ) [protected, virtual]

Definition at line 151 of file nsContentSink.cpp.

{
}

Member Function Documentation

nsresult nsContentSink::Init ( nsIDocument aDoc,
nsIURI aURI,
nsISupports *  aContainer,
nsIChannel aChannel 
) [protected]

Reimplemented in HTMLContentSink, and nsXMLContentSink.

Definition at line 156 of file nsContentSink.cpp.

{
  NS_PRECONDITION(aDoc, "null ptr");
  NS_PRECONDITION(aURI, "null ptr");

  if (!aDoc || !aURI) {
    return NS_ERROR_NULL_POINTER;
  }

  mDocument = aDoc;

  mDocumentURI = aURI;
  mDocumentBaseURI = aURI;
  mDocShell = do_QueryInterface(aContainer);

  // use this to avoid a circular reference sink->document->scriptloader->sink
  nsCOMPtr<nsIScriptLoaderObserver> proxy =
      new nsScriptLoaderObserverProxy(this);
  NS_ENSURE_TRUE(proxy, NS_ERROR_OUT_OF_MEMORY);

  nsIScriptLoader *loader = mDocument->GetScriptLoader();
  NS_ENSURE_TRUE(loader, NS_ERROR_FAILURE);
  nsresult rv = loader->AddObserver(proxy);
  NS_ENSURE_SUCCESS(rv, rv);

  mCSSLoader = aDoc->CSSLoader();

  ProcessHTTPHeaders(aChannel);

  mNodeInfoManager = aDoc->NodeInfoManager();
  return NS_OK;

}

Here is the call graph for this function:

virtual void nsContentSink::PostEvaluateScript ( ) [inline, protected, virtual]

Reimplemented in HTMLContentSink.

Definition at line 109 of file nsContentSink.h.

{return;}
virtual void nsContentSink::PreEvaluateScript ( ) [inline, protected, virtual]

Reimplemented in HTMLContentSink.

Definition at line 108 of file nsContentSink.h.

{return;}
void nsContentSink::PrefetchHref ( const nsAString &  aHref,
PRBool  aExplicit 
) [protected]

Definition at line 717 of file nsContentSink.cpp.

{
  //
  // SECURITY CHECK: disable prefetching from mailnews!
  //
  // walk up the docshell tree to see if any containing
  // docshell are of type MAIL.
  //
  if (!mDocShell)
    return;

  nsCOMPtr<nsIDocShell> docshell = mDocShell;

  nsCOMPtr<nsIDocShellTreeItem> treeItem, parentItem;
  do {
    PRUint32 appType = 0;
    nsresult rv = docshell->GetAppType(&appType);
    if (NS_FAILED(rv) || appType == nsIDocShell::APP_TYPE_MAIL)
      return; // do not prefetch from mailnews
    if (treeItem = do_QueryInterface(docshell)) {
      treeItem->GetParent(getter_AddRefs(parentItem));
      if (parentItem) {
        treeItem = parentItem;
        docshell = do_QueryInterface(treeItem);
        if (!docshell) {
          NS_ERROR("cannot get a docshell from a treeItem!");
          return;
        }
      }
    }
  } while (parentItem);
  
  // OK, we passed the security check...
  
  nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
  if (prefetchService) {
    // construct URI using document charset
    const nsACString &charset = mDocument->GetDocumentCharacterSet();
    nsCOMPtr<nsIURI> uri;
    NS_NewURI(getter_AddRefs(uri), aHref,
              charset.IsEmpty() ? nsnull : PromiseFlatCString(charset).get(),
              mDocumentBaseURI);
    if (uri) {
      prefetchService->PrefetchURI(uri, mDocumentURI, aExplicit);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsContentSink::ProcessHeaderData ( nsIAtom aHeader,
const nsAString &  aValue,
nsIContent aContent = nsnull 
) [protected]

Definition at line 307 of file nsContentSink.cpp.

{
  nsresult rv = NS_OK;
  // necko doesn't process headers coming in from the parser

  mDocument->SetHeaderData(aHeader, aValue);

  if (aHeader == nsHTMLAtoms::setcookie) {
    // Note: Necko already handles cookies set via the channel.  We can't just
    // call SetCookie on the channel because we want to do some security checks
    // here and want to use the prompt associated to our current window, not
    // the window where the channel was dispatched.
    nsCOMPtr<nsICookieService> cookieServ =
      do_GetService(NS_COOKIESERVICE_CONTRACTID, &rv);
    if (NS_FAILED(rv)) {
      return rv;
    }

    // Get a URI from the document principal

    // We use the original codebase in case the codebase was changed
    // by SetDomain

    nsIPrincipal *docPrincipal = mDocument->GetPrincipal();
    if (!docPrincipal) {
      return NS_ERROR_FAILURE;
    }

    nsCOMPtr<nsIPrincipal> systemPrincipal;
    nsContentUtils::GetSecurityManager()->
      GetSystemPrincipal(getter_AddRefs(systemPrincipal));
    NS_ASSERTION(systemPrincipal, "No system principal");
    
    if (docPrincipal == systemPrincipal) {
      // Document's principal is not a codebase, so we can't set cookies
      return NS_OK;
    }

    nsCOMPtr<nsIURI> codebaseURI;
    rv = docPrincipal->GetURI(getter_AddRefs(codebaseURI));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIPrompt> prompt;
    nsCOMPtr<nsIDOMWindowInternal> window (do_QueryInterface(mDocument->GetScriptGlobalObject()));
    if (window) {
      window->GetPrompter(getter_AddRefs(prompt));
    }

    nsCOMPtr<nsIChannel> channel;
    if (mParser) {
      mParser->GetChannel(getter_AddRefs(channel));
    }

    rv = cookieServ->SetCookieString(codebaseURI,
                                     prompt,
                                     NS_ConvertUCS2toUTF8(aValue).get(),
                                     channel);
    if (NS_FAILED(rv)) {
      return rv;
    }
  }
  else if (aHeader == nsHTMLAtoms::link) {
    rv = ProcessLinkHeader(aContent, aValue);
  }
  else if (aHeader == nsHTMLAtoms::msthemecompatible) {
    // Disable theming for the presshell if the value is no.
    // XXXbz don't we want to support this as an HTTP header too?
    nsAutoString value(aValue);
    if (value.LowerCaseEqualsLiteral("no")) {
      nsIPresShell* shell = mDocument->GetShellAt(0);
      if (shell) {
        shell->DisableThemeSupport();
      }
    }
  }
  // Don't report "refresh" headers back to necko, since our document handles
  // them
  else if (aHeader != nsHTMLAtoms::refresh && mParser) {
    // we also need to report back HTTP-EQUIV headers to the channel
    // so that it can process things like pragma: no-cache or other
    // cache-control headers. Ideally this should also be the way for
    // cookies to be set! But we'll worry about that in the next
    // iteration
    nsCOMPtr<nsIChannel> channel;
    if (NS_SUCCEEDED(mParser->GetChannel(getter_AddRefs(channel)))) {
      nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
      if (httpChannel) {
        const char* header;
        (void)aHeader->GetUTF8String(&header);
        (void)httpChannel->SetResponseHeader(nsDependentCString(header),
                                             NS_ConvertUCS2toUTF8(aValue),
                                             PR_TRUE);
      }
    }
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 283 of file nsContentSink.cpp.

{
  nsCOMPtr<nsIHttpChannel> httpchannel(do_QueryInterface(aChannel));
  
  if (!httpchannel) {
    return NS_OK;
  }

  // Note that the only header we care about is the "link" header, since we
  // have all the infrastructure for kicking off stylesheet loads.
  
  nsCAutoString linkHeader;
  
  nsresult rv = httpchannel->GetResponseHeader(NS_LITERAL_CSTRING("link"),
                                               linkHeader);
  if (NS_SUCCEEDED(rv) && !linkHeader.IsEmpty()) {
    ProcessHeaderData(nsHTMLAtoms::link,
                      NS_ConvertASCIItoUTF16(linkHeader));
  }
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsContentSink::ProcessLink ( nsIContent aElement,
const nsSubstring aHref,
const nsSubstring aRel,
const nsSubstring aTitle,
const nsSubstring aType,
const nsSubstring aMedia 
) [protected]

Definition at line 593 of file nsContentSink.cpp.

{
  // XXX seems overkill to generate this string array
  nsStringArray linkTypes;
  nsStyleLinkElement::ParseLinkTypes(aRel, linkTypes);

  PRBool hasPrefetch = (linkTypes.IndexOf(NS_LITERAL_STRING("prefetch")) != -1);
  // prefetch href if relation is "next" or "prefetch"
  if (hasPrefetch || linkTypes.IndexOf(NS_LITERAL_STRING("next")) != -1) {
    PrefetchHref(aHref, hasPrefetch);
  }

  // is it a stylesheet link?
  if (linkTypes.IndexOf(NS_LITERAL_STRING("stylesheet")) == -1) {
    return NS_OK;
  }

  PRBool isAlternate = linkTypes.IndexOf(NS_LITERAL_STRING("alternate")) != -1;
  return ProcessStyleLink(aElement, aHref, isAlternate, aTitle, aType,
                          aMedia);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsContentSink::ProcessLinkHeader ( nsIContent aElement,
const nsAString &  aLinkData 
) [protected]

Definition at line 415 of file nsContentSink.cpp.

{
  nsresult rv = NS_OK;

  // parse link content and call process style link
  nsAutoString href;
  nsAutoString rel;
  nsAutoString title;
  nsAutoString type;
  nsAutoString media;
  PRBool didBlock = PR_FALSE;

  // copy to work buffer
  nsAutoString stringList(aLinkData);

  // put an extra null at the end
  stringList.Append(kNullCh);

  PRUnichar* start = stringList.BeginWriting();
  PRUnichar* end   = start;
  PRUnichar* last  = start;
  PRUnichar  endCh;

  while (*start != kNullCh) {
    // skip leading space
    while ((*start != kNullCh) && nsCRT::IsAsciiSpace(*start)) {
      ++start;
    }

    end = start;
    last = end - 1;

    // look for semicolon or comma
    while (*end != kNullCh && *end != kSemiCh && *end != kCommaCh) {
      PRUnichar ch = *end;

      if (ch == kApostrophe || ch == kQuote || ch == kLessThanCh) {
        // quoted string

        PRUnichar quote = *end;
        if (quote == kLessThanCh) {
          quote = kGreaterThanCh;
        }

        PRUnichar* closeQuote = (end + 1);

        // seek closing quote
        while (*closeQuote != kNullCh && quote != *closeQuote) {
          ++closeQuote;
        }

        if (quote == *closeQuote) {
          // found closer

          // skip to close quote
          end = closeQuote;

          last = end - 1;

          ch = *(end + 1);

          if (ch != kNullCh && ch != kSemiCh && ch != kCommaCh) {
            // end string here
            *(++end) = kNullCh;

            ch = *(end + 1);

            // keep going until semi or comma
            while (ch != kNullCh && ch != kSemiCh && ch != kCommaCh) {
              ++end;

              ch = *end;
            }
          }
        }
      }

      ++end;
      ++last;
    }

    endCh = *end;

    // end string here
    *end = kNullCh;

    if (start < end) {
      if ((*start == kLessThanCh) && (*last == kGreaterThanCh)) {
        *last = kNullCh;

        if (href.IsEmpty()) { // first one wins
          href = (start + 1);
          href.StripWhitespace();
        }
      } else {
        PRUnichar* equals = start;

        while ((*equals != kNullCh) && (*equals != kEqualsCh)) {
          equals++;
        }

        if (*equals != kNullCh) {
          *equals = kNullCh;
          nsAutoString  attr(start);
          attr.StripWhitespace();

          PRUnichar* value = ++equals;
          while (nsCRT::IsAsciiSpace(*value)) {
            value++;
          }

          if (((*value == kApostrophe) || (*value == kQuote)) &&
              (*value == *last)) {
            *last = kNullCh;
            value++;
          }

          if (attr.LowerCaseEqualsLiteral("rel")) {
            if (rel.IsEmpty()) {
              rel = value;
              rel.CompressWhitespace();
            }
          } else if (attr.LowerCaseEqualsLiteral("title")) {
            if (title.IsEmpty()) {
              title = value;
              title.CompressWhitespace();
            }
          } else if (attr.LowerCaseEqualsLiteral("type")) {
            if (type.IsEmpty()) {
              type = value;
              type.StripWhitespace();
            }
          } else if (attr.LowerCaseEqualsLiteral("media")) {
            if (media.IsEmpty()) {
              media = value;

              // HTML4.0 spec is inconsistent, make it case INSENSITIVE
              ToLowerCase(media);
            }
          }
        }
      }
    }

    if (endCh == kCommaCh) {
      // hit a comma, process what we've got so far

      if (!href.IsEmpty() && !rel.IsEmpty()) {
        rv = ProcessLink(aElement, href, rel, title, type, media);
        if (rv == NS_ERROR_HTMLPARSER_BLOCK) {
          didBlock = PR_TRUE;
        }
      }

      href.Truncate();
      rel.Truncate();
      title.Truncate();
      type.Truncate();
      media.Truncate();
    }

    start = ++end;
  }

  if (!href.IsEmpty() && !rel.IsEmpty()) {
    rv = ProcessLink(aElement, href, rel, title, type, media);

    if (NS_SUCCEEDED(rv) && didBlock) {
      rv = NS_ERROR_HTMLPARSER_BLOCK;
    }
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsContentSink::ProcessMETATag ( nsIContent aContent) [protected]

Definition at line 693 of file nsContentSink.cpp.

{
  NS_ASSERTION(aContent, "missing base-element");

  nsresult rv = NS_OK;

  // set any HTTP-EQUIV data into document's header data as well as url
  nsAutoString header;
  aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::httpEquiv, header);
  if (!header.IsEmpty()) {
    nsAutoString result;
    aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::content, result);
    if (!result.IsEmpty()) {
      ToLowerCase(header);
      nsCOMPtr<nsIAtom> fieldAtom(do_GetAtom(header));
      rv = ProcessHeaderData(fieldAtom, result, aContent); 
    }
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsContentSink::ProcessStyleLink ( nsIContent aElement,
const nsSubstring aHref,
PRBool  aAlternate,
const nsSubstring aTitle,
const nsSubstring aType,
const nsSubstring aMedia 
) [protected, virtual]

Reimplemented in nsXMLContentSink, and nsXMLFragmentContentSink.

Definition at line 619 of file nsContentSink.cpp.

{
  if (aAlternate && aTitle.IsEmpty()) {
    // alternates must have title return without error, for now
    return NS_OK;
  }

  nsAutoString  mimeType;
  nsAutoString  params;
  nsParserUtils::SplitMimeType(aType, mimeType, params);

  // see bug 18817
  if (!mimeType.IsEmpty() && !mimeType.LowerCaseEqualsLiteral("text/css")) {
    // Unknown stylesheet language
    return NS_OK;
  }

  nsCOMPtr<nsIURI> url;
  nsresult rv = NS_NewURI(getter_AddRefs(url), aHref, nsnull, mDocumentBaseURI);
  
  if (NS_FAILED(rv)) {
    // The URI is bad, move along, don't propagate the error (for now)
    return NS_OK;
  }

  if (!aAlternate) {
    // possibly preferred sheet

    if (!aTitle.IsEmpty()) {
      nsAutoString preferredStyle;
      mDocument->GetHeaderData(nsHTMLAtoms::headerDefaultStyle,
                               preferredStyle);
      if (preferredStyle.IsEmpty()) {
        mDocument->SetHeaderData(nsHTMLAtoms::headerDefaultStyle, aTitle);
      }
    }
  }

  PRBool blockParser = kBlockByDefault;
  if (aAlternate) {
    blockParser = PR_FALSE;
  }

  // NOTE: no longer honoring the important keyword to indicate
  // blocking as it is proprietary and unnecessary since all
  // non-alternate will block the parser now -mja
#if 0
  if (linkTypes.IndexOf("important") != -1) {
    blockParser = PR_TRUE;
  }
#endif

  PRBool doneLoading;
  nsIParser* parser = nsnull;
  if (blockParser) {
    parser = mParser;
  }
  rv = mCSSLoader->LoadStyleLink(aElement, url, aTitle, aMedia,
                                 parser, doneLoading, this);

  if (NS_SUCCEEDED(rv) && blockParser && !doneLoading) {
    rv = NS_ERROR_HTMLPARSER_BLOCK;
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 870 of file nsContentSink.cpp.

{
  if (!vm) {
    return NS_OK;
  }

  NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);

  nsCOMPtr<nsIContentViewer> contentViewer;
  mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
  if (contentViewer) {
    PRBool enabled;
    contentViewer->GetEnableRendering(&enabled);
    if (enabled) {
      vm->EnableRefresh(NS_VMREFRESH_IMMEDIATE);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIScriptLoaderObserver::scriptAvailable ( in nsresult  aResult,
in nsIScriptElement  aElement,
in boolean  aIsInline,
in boolean  aWasPending,
in nsIURI  aURI,
in PRInt32  aLineNo,
in AString  aScript 
) [inherited]

The script is available for evaluation.

For inline scripts, this method will be called synchronously. For externally loaded scripts, this method will be called when the load completes.

Parameters:
aResultA result code representing the result of loading a script. If this is a failure code, script evaluation will not occur.
aElementThe element being processed.
aIsInlineIs this an inline script or externally loaded?
aWasPendingDid script processing have to be delayed, either for loading of an external script or because processing of an earlier scheduled script was delayed?
aURIWhat is the URI of the script (the document URI if it is inline).
aLineNoAt what line does the script appear (generally 1 if it is a loaded script).
aScriptString representation of the string to be evaluated.
void nsIScriptLoaderObserver::scriptEvaluated ( in nsresult  aResult,
in nsIScriptElement  aElement,
in boolean  aIsInline,
in boolean  aWasPending 
) [inherited]

The script has been evaluated.

Parameters:
aResultA result code representing the success or failure of the script evaluation.
aElementThe element being processed.
aIsInlineIs this an inline script or externally loaded?
aWasPendingDid script processing have to be delayed, either for loading of an external script or because processing of an earlier scheduled script was delayed?
PRBool nsContentSink::ScrollToRef ( PRBool  aReallyScroll) [protected]

Definition at line 814 of file nsContentSink.cpp.

{
  if (mRef.IsEmpty()) {
    return PR_FALSE;
  }

  PRBool didScroll = PR_FALSE;

  char* tmpstr = ToNewCString(mRef);
  if (!tmpstr) {
    return PR_FALSE;
  }

  nsUnescape(tmpstr);
  nsCAutoString unescapedRef;
  unescapedRef.Assign(tmpstr);
  nsMemory::Free(tmpstr);

  nsresult rv = NS_ERROR_FAILURE;
  // We assume that the bytes are in UTF-8, as it says in the spec:
  // http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.1
  NS_ConvertUTF8toUCS2 ref(unescapedRef);

  PRInt32 i, ns = mDocument->GetNumberOfShells();
  for (i = 0; i < ns; i++) {
    nsIPresShell* shell = mDocument->GetShellAt(i);
    if (shell) {
      // Check an empty string which might be caused by the UTF-8 conversion
      if (!ref.IsEmpty()) {
        // Note that GoToAnchor will handle flushing layout as needed.
        rv = shell->GoToAnchor(ref, aReallyScroll);
      } else {
        rv = NS_ERROR_FAILURE;
      }

      // If UTF-8 URI failed then try to assume the string as a
      // document's charset.

      if (NS_FAILED(rv)) {
        const nsACString &docCharset = mDocument->GetDocumentCharacterSet();

        rv = CharsetConvRef(docCharset, unescapedRef, ref);

        if (NS_SUCCEEDED(rv) && !ref.IsEmpty())
          rv = shell->GoToAnchor(ref, aReallyScroll);
      }
      if (NS_SUCCEEDED(rv)) {
        didScroll = PR_TRUE;
      }
    }
  }

  return didScroll;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsContentSink::StartLayout ( PRBool  aIsFrameset) [protected]

Definition at line 892 of file nsContentSink.cpp.

{
  PRUint32 i, ns = mDocument->GetNumberOfShells();
  for (i = 0; i < ns; i++) {
    nsIPresShell *shell = mDocument->GetShellAt(i);

    if (shell) {
      // Make sure we don't call InitialReflow() for a shell that has
      // already called it. This can happen when the layout frame for
      // an iframe is constructed *between* the Embed() call for the
      // docshell in the iframe, and the content sink's call to OpenBody().
      // (Bug 153815)

      PRBool didInitialReflow = PR_FALSE;
      shell->GetDidInitialReflow(&didInitialReflow);
      if (didInitialReflow) {
        // XXX: The assumption here is that if something already
        // called InitialReflow() on this shell, it also did some of
        // the setup below, so we do nothing and just move on to the
        // next shell in the list.

        continue;
      }

      // Make shell an observer for next time
      shell->BeginObservingDocument();

      // Resize-reflow this time
      nsRect r = shell->GetPresContext()->GetVisibleArea();
      shell->InitialReflow(r.width, r.height);

      // Now trigger a refresh
      RefreshIfEnabled(shell->GetViewManager());
    }
  }

  // If the document we are loading has a reference or it is a
  // frameset document, disable the scroll bars on the views.

  if (mDocumentURI) {
    nsCAutoString ref;

    // Since all URI's that pass through here aren't URL's we can't
    // rely on the nsIURI implementation for providing a way for
    // finding the 'ref' part of the URI, we'll haveto revert to
    // string routines for finding the data past '#'

    mDocumentURI->GetSpec(ref);

    nsReadingIterator<char> start, end;

    ref.BeginReading(start);
    ref.EndReading(end);

    if (FindCharInReadable('#', start, end)) {
      ++start; // Skip over the '#'

      mRef = Substring(start, end);
    }
  }
}

Here is the call graph for this function:

NS_IMETHODIMP nsContentSink::StyleSheetLoaded ( nsICSSStyleSheet aSheet,
PRBool  aNotify 
) [private, virtual]

Implements nsICSSLoaderObserver.

Definition at line 194 of file nsContentSink.cpp.

{
  return NS_OK;
}

Member Data Documentation

Definition at line 116 of file nsContentSink.h.

Definition at line 115 of file nsContentSink.h.

Definition at line 111 of file nsContentSink.h.

Definition at line 114 of file nsContentSink.h.

Definition at line 113 of file nsContentSink.h.

Definition at line 122 of file nsContentSink.h.

Definition at line 117 of file nsContentSink.h.

Definition at line 112 of file nsContentSink.h.

Definition at line 121 of file nsContentSink.h.

Definition at line 119 of file nsContentSink.h.


The documentation for this class was generated from the following files: