Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/base/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 3 kB image not shown  

Quelle  DOMParser.h

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef mozilla_dom_DOMParser_h_
#define mozilla_dom_DOMParser_h_

#include "mozilla/Span.h"
#include "mozilla/dom/DOMParserBinding.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/TypedArray.h"
#include "nsCOMPtr.h"
#include "nsWrapperCache.h"

class nsIGlobalObject;
class nsIPrincipal;

namespace mozilla {
class ErrorResult;

namespace dom {

class TrustedHTMLOrString;

class DOMParser final : public nsISupports, public nsWrapperCache {
  typedef mozilla::dom::GlobalObject GlobalObject;

  ~DOMParser();

 public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMParser)

  // WebIDL API
  static already_AddRefed<DOMParser> Constructor(const GlobalObject& aOwner,
                                                 mozilla::ErrorResult& rv);

  already_AddRefed<Document> ParseFromStringInternal(const nsAString& aStr,
                                                     SupportedType aType,
                                                     ErrorResult& aRv);

  MOZ_CAN_RUN_SCRIPT already_AddRefed<Document> ParseFromString(
      const TrustedHTMLOrString& aStr, SupportedType aType,
      nsIPrincipal* aSubjectPrincipal, ErrorResult& aRv);

  // Chrome and UI Widgets API
  already_AddRefed<Document> ParseFromSafeString(const nsAString& aStr,
                                                 SupportedType aType,
                                                 ErrorResult& aRv);
  // Sequence converts to Span, so we can use this overload for both
  // the Sequence case and our internal uses.
  already_AddRefed<Document> ParseFromBuffer(Span<const uint8_t> aBuf,
                                             SupportedType aType,
                                             ErrorResult& aRv);

  already_AddRefed<Document> ParseFromBuffer(const Uint8Array& aBuf,
                                             SupportedType aType,
                                             ErrorResult& aRv);

  already_AddRefed<Document> ParseFromStream(nsIInputStream* aStream,
                                             const nsAString& aCharset,
                                             int32_t aContentLength,
                                             SupportedType aType,
                                             ErrorResult& aRv);

  void ForceEnableXULXBL() {
    mForceEnableXULXBL = true;
    ForceEnableDTD();
  }

  void ForceEnableDTD() { mForceEnableDTD = true; }

  nsIGlobalObject* GetParentObject() const { return mGlobal; }

  JSObject* WrapObject(JSContext* aCx,
                       JS::Handle<JSObject*> aGivenProto) override {
    return mozilla::dom::DOMParser_Binding::Wrap(aCx, this, aGivenProto);
  }

  // A way to create a non-global-associated DOMParser from C++.
  static already_AddRefed<DOMParser> CreateWithoutGlobal(ErrorResult& aRv);

 private:
  DOMParser(nsIGlobalObject* aGlobal, nsIPrincipal* aDocPrincipal,
            nsIURI* aDocumentURI);

  already_AddRefed<Document> SetUpDocument(DocumentFlavor aFlavor,
                                           ErrorResult& aRv);

  nsCOMPtr<nsIGlobalObject> mGlobal;
  nsCOMPtr<nsIPrincipal> mPrincipal;
  nsCOMPtr<nsIURI> mDocumentURI;

  bool mForceEnableXULXBL;
  bool mForceEnableDTD;
};

}  // namespace dom
}  // namespace mozilla

#endif

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-22) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.