layout/style/nsICSSLoaderObserver.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/nsICSSLoaderObserver.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/* internal interface for observing CSS style sheet loads */
    1.10 +
    1.11 +#ifndef nsICSSLoaderObserver_h___
    1.12 +#define nsICSSLoaderObserver_h___
    1.13 +
    1.14 +#include "nsISupports.h"
    1.15 +
    1.16 +#define NS_ICSSLOADEROBSERVER_IID     \
    1.17 +{ 0x7eb90c74, 0xea0c, 0x4df5,       \
    1.18 +{0xa1, 0x5f, 0x95, 0xf0, 0x6a, 0x98, 0xb9, 0x40} }
    1.19 +
    1.20 +class nsCSSStyleSheet;
    1.21 +
    1.22 +class nsICSSLoaderObserver : public nsISupports {
    1.23 +public:
    1.24 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSLOADEROBSERVER_IID)
    1.25 +
    1.26 +  /**
    1.27 +   * StyleSheetLoaded is called after aSheet is marked complete and before any
    1.28 +   * load events associated with aSheet are fired.
    1.29 +   * @param aSheet the sheet that was loaded. Guaranteed to always be
    1.30 +   *        non-null, even if aStatus indicates failure.
    1.31 +   * @param aWasAlternate whether the sheet was an alternate.  This will always
    1.32 +   *        match the value LoadStyleLink or LoadInlineStyle returned in
    1.33 +   *        aIsAlternate if one of those methods were used to load the sheet,
    1.34 +   *        and will always be false otherwise.
    1.35 +   * @param aStatus is a success code if the sheet loaded successfully and a
    1.36 +   *        failure code otherwise.  Note that successful load of aSheet
    1.37 +   *        doesn't indicate anything about whether the data actually parsed
    1.38 +   *        as CSS, and doesn't indicate anything about the status of any child
    1.39 +   *        sheets of aSheet.
    1.40 +   */
    1.41 +  NS_IMETHOD StyleSheetLoaded(nsCSSStyleSheet* aSheet, bool aWasAlternate,
    1.42 +                              nsresult aStatus) = 0;
    1.43 +};
    1.44 +
    1.45 +NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSLoaderObserver, NS_ICSSLOADEROBSERVER_IID)
    1.46 +
    1.47 +#endif // nsICSSLoaderObserver_h___

mercurial