Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
HTMLCSSStyleSheetImpl Class Reference
Inheritance diagram for HTMLCSSStyleSheetImpl:
Inheritance graph
[legend]
Collaboration diagram for HTMLCSSStyleSheetImpl:
Collaboration graph
[legend]

List of all members.

Public Types

typedef PRBool(* PR_CALLBACK )(nsIStyleRuleProcessor *, void *)

Public Member Functions

 HTMLCSSStyleSheetImpl ()
NS_DECL_ISUPPORTS NS_IMETHOD Init (nsIURI *aURL, nsIDocument *aDocument)
NS_IMETHOD Reset (nsIURI *aURL)
NS_IMETHOD GetSheetURI (nsIURI **aSheetURL) const
NS_IMETHOD GetBaseURI (nsIURI **aBaseURL) const
NS_IMETHOD GetTitle (nsString &aTitle) const
NS_IMETHOD GetType (nsString &aType) const
 NS_IMETHOD_ (PRBool) UseForMedium(nsPresContext *aPresContext) const
 NS_IMETHOD_ (PRBool) HasRules() const
NS_IMETHOD GetApplicable (PRBool &aApplicable) const
 Whether the sheet is applicable.
NS_IMETHOD SetEnabled (PRBool aEnabled)
 Set the stylesheet to be enabled.
NS_IMETHOD GetComplete (PRBool &aComplete) const
 Whether the sheet is complete.
NS_IMETHOD SetComplete ()
NS_IMETHOD GetParentSheet (nsIStyleSheet *&aParent) const
NS_IMETHOD GetOwningDocument (nsIDocument *&aDocument) const
NS_IMETHOD SetOwningDocument (nsIDocument *aDocument)
NS_IMETHOD RulesMatching (ElementRuleProcessorData *aData)
 Find the |nsIStyleRule|s matching the given content node and position the given |nsRuleWalker| at the |nsRuleNode| in the rule tree representing that ordered list of rules (with higher precedence being farther from the root of the lexicographic tree).
NS_IMETHOD RulesMatching (PseudoRuleProcessorData *aData)
 Just like the previous |RulesMatching|, except for a given content node and pseudo-element.
NS_IMETHOD HasStateDependentStyle (StateRuleProcessorData *aData, nsReStyleHint *aResult)
 Return how (as described by nsReStyleHint) style can depend on a change of the given content state on the given content node.
NS_IMETHOD HasAttributeDependentStyle (AttributeRuleProcessorData *aData, nsReStyleHint *aResult)
 Return how (as described by nsReStyleHint) style can depend on the presence or value of the given attribute for the given content node.

Protected Member Functions

virtual ~HTMLCSSStyleSheetImpl ()

Protected Attributes

nsIURImURL
nsIDocumentmDocument
CSSFirstLineRulemFirstLineRule
CSSFirstLetterRulemFirstLetterRule

Private Member Functions

 HTMLCSSStyleSheetImpl (const HTMLCSSStyleSheetImpl &aCopy)
HTMLCSSStyleSheetImploperator= (const HTMLCSSStyleSheetImpl &aCopy)

Detailed Description

Definition at line 331 of file nsHTMLCSSStyleSheet.cpp.


Member Typedef Documentation

Definition at line 182 of file nsIStyleRuleProcessor.h.


Constructor & Destructor Documentation


Member Function Documentation

NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetApplicable ( PRBool aApplicable) const [virtual]

Whether the sheet is applicable.

A sheet that is not applicable should never be inserted into a style set. A sheet may not be applicable for a variety of reasons including being disabled and being incomplete.

Implements nsIStyleSheet.

Definition at line 554 of file nsHTMLCSSStyleSheet.cpp.

{
  aApplicable = PR_TRUE;
  return NS_OK;
}
NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetBaseURI ( nsIURI **  aBaseURL) const [virtual]

Implements nsIStyleSheet.

Definition at line 519 of file nsHTMLCSSStyleSheet.cpp.

{
  NS_IF_ADDREF(mURL);
  *aBaseURL = mURL;
  return NS_OK;
}
NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetComplete ( PRBool aComplete) const [virtual]

Whether the sheet is complete.

Implements nsIStyleSheet.

Definition at line 567 of file nsHTMLCSSStyleSheet.cpp.

{
  aComplete = PR_TRUE;
  return NS_OK;
}

Implements nsIStyleSheet.

Definition at line 588 of file nsHTMLCSSStyleSheet.cpp.

{
  NS_IF_ADDREF(mDocument);
  aDocument = mDocument;
  return NS_OK;
}

Implements nsIStyleSheet.

Definition at line 581 of file nsHTMLCSSStyleSheet.cpp.

{
  aParent = nsnull;
  return NS_OK;
}
NS_IMETHODIMP HTMLCSSStyleSheetImpl::GetSheetURI ( nsIURI **  aSheetURL) const [virtual]

Implements nsIStyleSheet.

Definition at line 511 of file nsHTMLCSSStyleSheet.cpp.

{
  NS_IF_ADDREF(mURL);
  *aSheetURL = mURL;
  return NS_OK;
}

Implements nsIStyleSheet.

Definition at line 527 of file nsHTMLCSSStyleSheet.cpp.

{
  aTitle.AssignLiteral("Internal HTML/CSS Style Sheet");
  return NS_OK;
}

Implements nsIStyleSheet.

Definition at line 534 of file nsHTMLCSSStyleSheet.cpp.

{
  aType.AssignLiteral("text/html");
  return NS_OK;
}

Return how (as described by nsReStyleHint) style can depend on the presence or value of the given attribute for the given content node.

This test is used for optimization only, and may err on the side of reporting more dependencies than really exist.

Implements nsIStyleRuleProcessor.

Definition at line 489 of file nsHTMLCSSStyleSheet.cpp.

{
  *aResult = nsReStyleHint(0);
  return NS_OK;
}

Return how (as described by nsReStyleHint) style can depend on a change of the given content state on the given content node.

This test is used for optimization only, and may err on the side of reporting more dependencies than really exist.

Event states are defined in nsIEventStateManager.h.

Implements nsIStyleRuleProcessor.

Definition at line 480 of file nsHTMLCSSStyleSheet.cpp.

{
  *aResult = nsReStyleHint(0);
  return NS_OK;
}
NS_IMETHODIMP HTMLCSSStyleSheetImpl::Init ( nsIURI aURL,
nsIDocument aDocument 
) [virtual]

Implements nsIHTMLCSSStyleSheet.

Definition at line 463 of file nsHTMLCSSStyleSheet.cpp.

{
  NS_PRECONDITION(aURL && aDocument, "null ptr");
  if (! aURL || ! aDocument)
    return NS_ERROR_NULL_POINTER;

  if (mURL || mDocument)
    return NS_ERROR_ALREADY_INITIALIZED;

  mDocument = aDocument; // not refcounted!
  mURL = aURL;
  NS_ADDREF(mURL);
  return NS_OK;
}

Here is the call graph for this function:

Implements nsIStyleSheet.

Implements nsIStyleSheet.

HTMLCSSStyleSheetImpl& HTMLCSSStyleSheetImpl::operator= ( const HTMLCSSStyleSheetImpl aCopy) [private]

Implements nsIHTMLCSSStyleSheet.

Definition at line 499 of file nsHTMLCSSStyleSheet.cpp.

Here is the call graph for this function:

Find the |nsIStyleRule|s matching the given content node and position the given |nsRuleWalker| at the |nsRuleNode| in the rule tree representing that ordered list of rules (with higher precedence being farther from the root of the lexicographic tree).

Implements nsIStyleRuleProcessor.

Just like the previous |RulesMatching|, except for a given content node and pseudo-element.

Implements nsIStyleRuleProcessor.

Definition at line 431 of file nsHTMLCSSStyleSheet.cpp.

{
  // We only want to add these rules if there are real :first-letter or
  // :first-line rules that cause a pseudo-element frame to be created.
  // Otherwise the use of ProbePseudoStyleContextFor will prevent frame
  // creation, and adding rules here would cause it.
  if (aData->mRuleWalker->AtRoot())
    return NS_OK;

  nsIAtom* pseudoTag = aData->mPseudoTag;
  if (pseudoTag == nsCSSPseudoElements::firstLine) {
    if (!mFirstLineRule) {
      mFirstLineRule = new CSSFirstLineRule();
      if (!mFirstLineRule)
        return NS_ERROR_OUT_OF_MEMORY;
      NS_ADDREF(mFirstLineRule);
    }
    aData->mRuleWalker->Forward(mFirstLineRule);
  }
  else if (pseudoTag == nsCSSPseudoElements::firstLetter) {
    if (!mFirstLetterRule) {
      mFirstLetterRule = new CSSFirstLetterRule();
      if (!mFirstLetterRule)
        return NS_ERROR_OUT_OF_MEMORY;
      NS_ADDREF(mFirstLetterRule);
    }
    aData->mRuleWalker->Forward(mFirstLetterRule);
  } 
  return NS_OK;
}

Here is the call graph for this function:

Implements nsIStyleSheet.

Definition at line 574 of file nsHTMLCSSStyleSheet.cpp.

{
  return NS_OK;
}

Set the stylesheet to be enabled.

This may or may not make it applicable.

Implements nsIStyleSheet.

Definition at line 561 of file nsHTMLCSSStyleSheet.cpp.

{ // these can't be disabled
  return NS_OK;
}

Implements nsIStyleSheet.

Definition at line 596 of file nsHTMLCSSStyleSheet.cpp.

{
  mDocument = aDocument;
  return NS_OK;
}

Member Data Documentation

Definition at line 385 of file nsHTMLCSSStyleSheet.cpp.

Definition at line 388 of file nsHTMLCSSStyleSheet.cpp.

Definition at line 387 of file nsHTMLCSSStyleSheet.cpp.

Definition at line 384 of file nsHTMLCSSStyleSheet.cpp.


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