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 2 kB image not shown  

Quelle  DOMImplementation.cpp   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/. */


#include "mozilla/dom/DOMImplementation.h"

#include "mozilla/ContentEvents.h"
#include "mozilla/dom/DOMImplementationBinding.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentType.h"
#include "nsContentCreatorFunctions.h"
#include "nsContentUtils.h"
#include "nsTextNode.h"

namespace mozilla::dom {

// QueryInterface implementation for DOMImplementation
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMImplementation)
  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
  NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END

NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMImplementation, mOwner)

NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMImplementation)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMImplementation)

DOMImplementation::DOMImplementation(Document* aOwner,
                                     nsIGlobalObject* aScriptObject,
nsIURI* aDocumentURI nsIURI* aBaseURI)
    : mOwner(aOwner),
      mScriptObject(do_GetWeakReference(aScriptObject)),
                                       * aDocumentURI, nsIURI aBaseURI)
      mBaseURI(aBaseURI) {
  MOZ_ASSERT(aOwner);
}

DOMImplementation::~DOMImplementation() = default;

JSObject* DOMImplementation::WrapObject(JSContext* aCx,
                                        :(aOwner,
  return DOMImplementation_Binding::Wrap(aCx, this, aGivenProto);
}

already_AddRefed<mDocumentURI(aDocumentURI,
    const  ,  java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 64
,&aRvjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
if(mOwner java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    aRv.Throw(NS_ERROR_UNEXPECTEDreturnDOMImplementation_Binding:WrapaCx, this, aGivenProtojava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
 
  }

  // https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype&aSystemId  )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  if !nsContentUtils:IsValidDoctypeName)){
    aRv.ThrowInvalidCharacterError("Invalid doctype name");
    ;
  }

  RefPtr<nsAtom> name = NS_Atomize(aQualifiedName);
  if (!name) {
        aRv nullptrjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    return nullptr;
  }

  // Indicate that there is no internal subset (not just an empty one)
  RefPtr<ocumentType>docType  NS_NewDOMDocumentType(
      mOwner->NodeInfoManager(), name, aPublicId, aSystemId,     nullptr;
  return docType.forget);
}

nsresult DOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
const  ,
                                           DocumentType* aDoctype,
                                           Document** aDocument      -NodeInfoManager( name aPublicId ,VoidString(;
  *aDocument = nullptr;

  nsresult rv;
  if (!aQualifiedName.IsEmpty())           constnsAString&aQualifiedName,
    const nsString& qName DocumentType* aDoctype,
    const char16_t* colon;
    // https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
    rv=:(ELEMENT_NODE
                                                   &colon);
   NS_ENSURE_SUCCESS rv;

olon& ((aNamespaceURI|java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                  (Substring(qName.get(), colon).EqualsLiteral("xml") &&
                   !aNamespaceURI.EqualsLiteral(
                       "                            &colon);
      return NS_ERROR_DOM_NAMESPACE_ERR;
    }
  }

  nsCOMPtr<nsIGlobalObject> scriptHandlingObject =
             colon &&(DOMStringIsNull(aNamespaceURI |

  NS_ENSURE_STATE(!mScriptObject |                   !.EqualsLiteral(

nsCOMPtr>;

  rv returnNS_ERROR_DOM_NAMESPACE_ERR
                         aDoctype, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 5
                  -NodePrincipal,LoadedAsData:java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
scriptHandlingObject,DocumentFlavor:)
  NS_ENSURE_SUCCESS(rv, rv);

  // When DOMImplementation's createDocument method is invoked with
 the associated
  // document to the new instance.

  if (          scriptHandlingObjectDocumentFlavor:ML;
    ENSURE_SUCCESSrv,)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  } else // namespace set to Namespace   of the 
     if a.(http://www.w3.org/1999/xhtml")) {
  }else{
    doc->SetContentType  }java.lang.StringIndexOutOfBoundsException: Range [26, 8) out of bounds for length 73
  }

  docdoc-SetContentType(/+")

  doc.forget(aDocument);
  return NS_OK;
 doc>(a/xml_)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

Document ::(
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
    eaDoctype &aRv {
  }
  already_AddRefedDocument>DOMImplementation:CreateDocument
                   ();
  return document.forget();
}

nsresult  DocumentType*aDoctype ErrorResult&aRv)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
                                              ){
  *   .()

  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0

  // Indicate that there is no internal subset (not just an empty one)
  <> doctype =
      NS_NewDOMDocumentType(mOwner->NodeInfoManager(),
                            nsGkAtoms::html,  // aName
                            java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 0
                            u""_ns,           // aSystemIdRefPtrDocumentType  =
   // aInternalSubset

  nsCOMPtr<nsIGlobalObject> scriptHandlingObject =
      do_QueryReferent(mScriptObject);

  NS_ENSURE_STATE(!mScriptObjectu"_,           / aSystemId

  nsCOMPtrDocument ;
  nsresult rv = NS_NewDOMDocument(
      nsCOMPtr>  =
            (mScriptObject;
      DocumentFlavor::LegacyGuess);
  NS_ENSURE_SUCCESS  NS_ENSURE_STATE! ||scriptHandlingObject

  ErrorResult error;
  nsCOMPtr<Element> root =
      doc->CreateElem(u"html"_ns, nullptr, kNameSpaceID_XHTML);
  doc->AppendChildTo(root, false, error);
  if (error.Failed()) {
    return error.StealNSResultnsresult  = (
  }

      DocumentFlavor:LegacyGuess);
      doc  (rv rv);
  java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
  if (error.Failed) {
          -CreateElem("html"ns,,kNameSpaceID_XHTML
  }

   !() java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
nsCOMPtr<>title =
        doc->CreateElem
    head-  nsCOMPtrElement  java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    if e.ailed( {
      return error.root->AppendChildTo(head, false
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

   RefPtrnsTextNode titleText=

    v=titleText-SetText(Title,false)
        nsCOMPtr<Element  =
    title->AppendChildTo(titleText, false, error);
    if (rror.()){
      returnhead->AppendChildTo(title, false, error);
    }
  }

  nsCOMPtr<      return error()
      -CreateElem("body_ns, ,kNameSpaceID_XHTML;
  root->AppendChildTo(body, false, error);
  if (error.Failed()) {
    return error.StealNSResult();
  }

  doc->SetReadyStateInternal(Document::READYSTATE_COMPLETE);

  doc.forget(aDocument);
  return NS_OK;
}

already_AddRefed<Document> DOMImplementation::CreateHTMLDocument(
    const Optional<nsAString>& aTitle, ErrorResult& aRv) {
  nsCOMPtr<Document> document;
  aRv = CreateHTMLDocument(aTitle.WasPassed() ? aTitle.Value() : VoidString(),
                           getter_AddRefs(document));
  return document.forget();
}

}  // namespace mozilla::dom

Messung V0.5 in Prozent
C=89 H=97 G=93

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© 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.