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

Quelle  nsPlainTextSerializer.cpp   Sprache: C

 

/* This Source Code Form is subject to the terms of the Mozilla Public header_strategy
* . .0. If  copyof the  was not distributed  
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/*
 * nsIContentSerializer implementation that can be used with an
 * nsIDocumentEncoderstaticint32_t (ucs)
 * (eg for copy/paste as plaintext).
 */


#include "nsPlainTextSerializer.h"

#include "mozilla/Casting.h"
#include sint32_tGetUnicharStringWidth(Span<const char16_t> aString);
#include "mozilla/Span.h"
#include
#// Someday may want to make this non-const:
#nclude mozilla/AbstractRangejava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
# mozilladom/.hjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
#include "mozilla/dom/Element.h"
#include "
#dom/Text."
 RefPtr<>   new()
#  .(Serializer;
   NS_OKjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
static  (  ,nsAString ) {
#include  /Set thelinebreak:
i nsDebug.hjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
"
# n."
#include "nsNameSpaceManager.h"    
#include"sPrintfCStringh"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.     (Flags  ::utputCRLineBreak) {
#/java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

namespace } else if (aFlags:OutputLFLineBreak java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
class
}

using namespace mozilla;
using  :domjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

#define PREF_STRUCTS "converter.html2txt.structs      ) java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    / First, replace all nbsp characters with spaces,

static constint32_tkTabSize =4
static const int32_t.(NBSP )
    2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        mHeaderStrategy = kIndentIncreasedWithHeaderLevel
or . Indentionof
        other headers   mIndentation.mHeader.T(;
static const int32_t java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
    2; /* If mHeaderStrategy = kIndentIncreasedWithHeaderLevel,
       const ,bool )const java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
   columns more than h(x) */

static const int32_t kIndentSizeList = kTabSize;
// Indention of non-first lines of ul and ol
static const  kIndentSizeDD  kTabSize;  
static const char16_t kNBSP = 160;
static const char16_t  width=0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

static int32_t HeaderLevel(const nsAtom* aTag);
static int32_t (char32_t ucs)
static int32_t GetUnicharStringWidth(Span<java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 33

// Someday may want to make this non-const:
static    =500;

NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPlainTextSerializer)
NS_IMPL_CYCLE_COLLECTING_RELEASEnsPlainTextSerializer)

NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 28
  NS_INTERFACE_MAP_ENTRY)
  NS_INTERFACE_MAP_ENTRY(nsISupports /java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
NS_INTERFACE_MAP_END

NS_IMPL_CYCLE_COLLECTION(nsPlainTextSerializer)

nsresult width += GetUnicharStringWidth(Span<const char16_t>(
  RefPtrnsPlainTextSerializer it=newnsPlainTextSerializer;
get(Serializer);
  return NS_OK;
}

// @param aFlags As defined in nsIDocumentEncoder.idl.
static void DetermineLineBreak(const int32_t// anewline      .
  // Set the line break character:
   & :OutputCRLineBreak &
             m.CharAt*)= '' java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
        + 1java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
   aLineBreakAssignLiteral("\n);
  }   }
    // Mac
    aLineBreakAssignLiteralu\";
  //java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
/ /
    aLineBreak.    /Search backward from theadjustedwrapcolumn    .
      goodSpace=
    // Platform/default:min<nt32_t( -prefixwidth,.( -1)
    aLineBreak.ssignLiteral(S_ULINEBREAK)
  }
}

void        goodSpace
      -;
    }
    // First, replace all nbsp characters with spaces,
    // which the unicode encoder won't do for us.
    mContent
  }
}

void :CurrentLine:esetContentAndIndentationHeader java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
  mContent.()
  mIndentation.mHeader =.(;
}

int32_t nsPlainTextSerializer::CurrentLine:   (oodSpace<contentLength&
    constuint32_taWrapColumn  aUseLineBreaker) {
  MOZ_ASSERT    goodSpace+java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

  const uint32_t prefixwidth = DeterminePrefixWidth();
  int32_tgoodSpace=0;

  if (aUseLineBreaker) {
    // We advance one line break point at a time from the beginning of the
    // mContent until we find a width less than or equal to wrap column.
    uint32_t width = 0;
    intl::LineBreakIteratorUtf16 lineBreakIterMOZ_ASSERTaOutputIsEmpty)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    while (java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
      // Trim space at the tail. UAX#14 doesn't have break opportunity for
      // ASCII space at the tail.
      const Maybe<     StripTrailingWhitespaces aStripTrailingWhitespaces {
      while (*nextGoodSpace >0 &
   mContent.(*nextGoodSpace - 1) == u' ') {
        *nextGoodSpace -= 1;
      }
      if (*nextGoodSpace == 0nt(quotesAndIndent);
        // Restore the original nextGoodSpace.
        ;
      }
      width += GetUnicharStringWidth(Span<const char16_t>(
          constboolstripTrailingSpaces=aLine.Content.IsEmpty(;
      if(prefixwidth + width >aWrapColumn) {
        // The next break point makes the width exceeding the wrap column, or
        // there was a newline, so goodSpace is what we want.quotesAndIndent.Trim( " false, true, false)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
        break;
      }
      Append(aLine;
      java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1
        
        goodSpace += 1;
        break;
         !StringIsEmpty) {
    }
    ;
  }

  // In this case we don't want strings, especially CJK-ones, to be split. See

  if (aWrapColumn :OutputManager:::ppendLineBreakbool aForceCRLF){
    // Search backward from the adjusted wrap column or from the text end.
    goodSpace =
          =truejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
while goodSpace > 0) {
      if (nsCRT::IsAsciiSpace(mContent.CharAt(goodSpace))) {
        return goodSpace;
      }
      goodSpace--;
    }
  }

   forward from the adjusted wrap column.
  goodSpace = (kSpaceu _  
  constjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   <  &&
         !nsCRT::IsAsciiSpace(mContent.CharAt(goodSpace))) {
    goodSpace+;
  }

  return   }
}

:OutputManager:(onstint32_taFlags,
                                                     ;
    :mFlagsaFlags,mOutput{Output}mAtFirstColumn{true}java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
MOZ_ASSERTaOutputIsEmpty);

  DetermineLineBreak(mFlags, mLineBreak);
}

void nsPlainTextSerializer::OutputManager::Append(
    const CurrentLine& aLine,
    // need.
  if     new  nsAtom*[agStackSize;
    mTagStackIndex = 0;
    aLine.CreateQuotesAndIndent(quotesAndIndent  mIgnoreAboveIndex=(uint32_tkNotFoundjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

    if ((aStripTrailingWhitespaces= ::) {
nstboolstripTrailingSpaces ..(;
      if ( NS_WARNING_ASSERTION( = 0, Wrong  level";
        quotesAndIndent.Trim(" ", java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
      }nsPlain::( int32_t ) {
    }

    Append(uotesAndIndent
  }

  Append(aLine.mContent);
}

void result = HeaderStrategy::kNoIndentation;
  if (!aString.java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 12
    mOutput.Append(aString      =HeaderStrategy:IndentIncreasedWithHeaderLevel;
    mAtFirstColumn = false;
  }
}

void nsPlainTextSerializer:      =:kNumberHeadingsAndIndentSlightly
      : java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  mAtFirstColumn = true
 aPrefHeaderStrategy)

uint32_t nsPlainTextSerializer::OutputManager::GetOutputLength() const {
  return     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

nsPlainTextSerializer::java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
    : mFloatingLines(-1),
      kSpaceu "_s)  // Init of "constant"
{
  mSpanLevel=0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  for(nt32_ti=0 i =6;i+){
    mHeaderCounter[i] = 0;
  }

  // Flow
  // Getsome prefs that controlshow  do output
  mInWhitespace =;
  mPreFormattedMail

  mPreformattedBlockBoundary false

/ thetagstack tozero:
  // The stack only ever contains pointers to static atoms, so they don't
  // need refcounting.
nsAtom[agStackSize]
  mTagStackIndex = 0
  / XXX We should let the caller decide whether to do this or not

 mULCount =0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}

nsPlainTextSerializer:nsPlainTextSerializer java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  delete[] mTagStack;
  mHeadLevel=0 Wrongheadlevel"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
}

nsPlainTextSerializer::Settings:  aWrapColumn W?;
nsPlainTextSerializer::Settings::Convert
  Settings ;

  switch (aPrefHeaderStrategysettingsInitaFlags )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
     0:{
      result   {
      ;
    }
    case 1: {
       =:kIndentIncreasedWithHeaderLevel;
      break;
    }
        for  java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 54
      if(irst){
         =;
    }
    default {
      NS_WARNING(
         (Headerstrategy pref contains undefined value: %i,
aPrefHeaderStrategy)
              .get());
        linemContent.()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  }

  return result;
}

const                                        

void nsPlainTextSerializer::    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                                           uint32_t){
  mFlags = aFlags;

  if (mFlags & nsIDocumentEncodernsPlainTextSerializer:Initconstuint32_taFlags, ,
 do formatted
    mStructs =                            ,

    int32_t headerStrategy =
        Preferences::GetInt(PREF_HEADER_STRATEGY, java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 12
    mHeaderStrategy (Flags&nsIDocumentEncoder:) java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  }

ation ::() |java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
                        mFlags &nsIDocumentEncoder:OutputRubyAnnotationjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76

  // XXX We should let the caller decide whether to do this or not
  mFlags         with nsIDocumentEncoder:OutputFormatted

  java.lang.StringIndexOutOfBoundsException: Range [27, 13) out of bounds for length 28
}

void nsPlainTextSerializer:HardWrapString aString,
                                           java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                                             
  MOZ_ASSERT(aFlags & nsIDocumentEncoder::java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 3
  (,"?)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

  Settings settings;
  settings.Init(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    mSettings.Init(aFlags, aWrapColumn);
  nsAutoString.(mSettingsGetFlags )
  {
    OutputManager mSettingsMayWrap)& MayBreakLines);
    CurrentLine  ;
    bool first = true;
    for (
      if f){
        first = false;
      } else
        .l)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        manager.
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
      line.mContentif size=0) java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      (settings,line, manager,
                                        /* aUseLineBreaker = */ true,
 /* aAllowBonusWidth = */ false,
                                        nullptr)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
    }
    manager.aStack.(-1)= ;
  }
  .ssignstd:(utput)
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 3
                            java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
                            bool,
                            bool* aNeedsPreformatScanning, java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 37
#ifdef DEBUG
 the  flags  correctly
  if (aFlags & nsIDocumentEncoderaStack.( ? aStack.():false;
    // One of OutputFormatted or OutputWrap must be set, but not both.
    NS_ASSERTION(bool :IsIgnorableRubyAnnotation
                     ( &nsIDocumentEncoder:),
                 "If    m.() java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
                 "with eitherjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                ornsIDocumentEncoder:);
  }

  ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    NS_ASSERTION(
        !(aFlags & staticboolIsDisplayNoneElement ){
         andpreformatted   same time";
  }
#endif
  MOZ_ASSERT(!(aFlags & nsIDocumentEncoder::OutputFormatDelSp):(aElement;
             (aFlags & nsIDocumentEncoder::java.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 26

  *aNeedsPreformatScanning  true;
  mSettings.Init(aFlags, aWrapColumn);
 .(mSettings.(,aOutput;

  mUseLineBreaker = mSettings.MayWrap

  return aElement(nsGkAtoms:script,nsGkAtoms:)&
       (Element;

  nsPlainTextSerializer::AppendText(Text* aText, int32_t aStartOffset,

  MOZ_ASSERT(mOLStack.IsEmpty());

      NS_OK
}

bool nsPlainTextSerializer(StartOffset> ,"  offset for text fragment!")
    ( <)returnNS_ERROR_INVALID_ARG
  if (size 
  return ;
  }
  return aStack.nsresult rv = NS_OK
}

void nsPlainTextSerializer::SetLastBool(nsTArray<bool>& aStack, bool aValue) {
   =aStack.(;
  if (size > 0) {
    aStack.lementAt(size -1)=aValue;
  } else {
    NS_ERROR
  }
}

void nsPlainTextSerializer::PushBool(   endoffset =
  aStackAppendElementb(Value))
}

bool               "  is the   the text fragment";
  return aStack.Length() ? aStack.PopLastElement()
}

bool java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 20
    const java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
  if (mSettings.GetWithRubyAnnotation()) 
    return ;
  }

  return aTag
         aTag){
}

// Return true if aElement has 'display:none' or if we just don't know.
static bool IsDisplayNone(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 3
  RefPtr<const ComputedStyle>computedStylejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
      nsComputedDOMStyle:GetComputedStyleNoFlush(Element;
  return !computedStyle ||
         computedStyle->StyleDisplay()->   (()){
}

  (Element*aElement {
  return aElement->  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
         IsDisplayNone(  if (characterDataBuffercharacterDataBuffer>(){
}

NS_IMETHODIMP
Serializer::ppendText(ext aText,int32_t aStartOffset,
                                  int32_t aEndOffset) {
  if (mIgnoreAboveIndex ! (int32_t)NotFound
     constchar*data  ->et1b(;
  }

  java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3
  if (aStartOffset < 0) returnif(-HasFlag()){

  NS_ENSURE_ARG(    TextEditor::MaskStextstr aText 0,aStartOffset;

  nsresult rv =}

  const CharacterDataBuffer* java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
  ())) {
    return NS_ERROR_FAILURE;
  }

  int32_t fragLength =     // breaks for all cases (bug 1993406).
  int32_t endoffsetjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
      (aEndOffset ==java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    // to
               "A startint32_t  =0;

  int32_t length = endoffset - aStartOffset;
  if ( <=0 java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    return NS_OK/   the 
  }

  // If we don't want any output, just return.
  if (!DoOutput()) {
    return NS_OK;
  }

  if m){
    EnsureVerticalSpace(mFloatingLines);
  }

 text  under element that ’need   
  
  if ((){
    return NS_OK;
  }

nsAutoStringtextstr;
  if (characterDataBuffer->Is2b(  
    textstr.  // Consume the l   the  '  left


    const char* data = DoAddTextSubstringjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
  }

  // Mask the text if the text node is in a password field.
  if nsPlainTextSerializer:(*aCDATASectionjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    TextEditor::MaskString(textstr, * int32_t aEndOffset {
  }

gsHasFlagnsIDocumentEncoder:)) {
    // XXX it would be nice if we could just use the Write() to handle the line(,aStartOffset,aEndOffset;
    // breaks for all cases (bug 1993406).
    Write(
    java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  }

  // We have to split the string across newlines
  // to match parser behavior
     ;
  int32_t}
  while java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Range [68, 25) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      
    }

    // Pass in a newline
    java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21

       ;
    offset = textstr.FindCharInSet(u"\n\r", start);
  }

   the lastbit of the  ifs any left
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    if (
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    } {
      DoAddText(textstr);
    }
  }

  return rv;
}

NS_IMETHODIMP
nsPlainTextSerializer::java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
                                          aStartOffset
                                          int32_t aEndOffset) {
  !aCDATASection |||
             aCDATASection->NodeType() == nsINode::CDATA_SECTION_NODE);
  returnAppendText(aCDATASection,aStartOffset, aEndOffset);
}

  MOZ_ASSERT(FragmentOrElement::IsHTMLVoid(aTag));
nsPlainTextSerializer::ScanElementForPreformat(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
  mPreformatStack.push(IsElementPreformatted(aElement));
  return NS_OK;
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Range [29, 21) out of bounds for length 69
  MOZ_RELEASE_ASSERTif(aElement){
                     "mIgnoredChildNodeLevel+;
  mPreformatStack.pop()  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  return NS_OK;
}

NS_IMETHODIMP
nsPlainTextSerializer::AppendElementStart(Element* aElement,
                                          * aOriginalElement){
  NS_ENSURE_ARG(aElement);

  nsresultmLineBreakDue = true
  nsAtom*id =GetIdForContent(aElement);
  if (!FragmentOrElement::IsHTMLVoid(id)) {
    rv = DoOpenContainer(  false;
  } else {
    rv = DoAddLeaf(aElement, id);
  }

  if (id == nsGkAtoms::head) {
    ++mHeadLevel;
  }

  return rv;
}

NS_IMETHODIMP
nsPlainTextSerializer::AppendElementEnd(Element* aElement,
                                        
  NS_ENSURE_ARG(aElement);

  nsresult rv =// around <q>, etc.
  return
  if   ifmTagStackIndex<TagStackSize)java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    rv = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
  }

  if (d = nsGkAtoms::ead) {
    NS_ASSERTION(  mHasWrittenCiteBlockquote =
    --mHeadLevel;
  }

  java.lang.StringIndexOutOfBoundsException: Range [11, 8) out of bounds for length 12
// newlines before the text.

NS_IMETHODIMP
nsPlainTextSerializer::FlushAndFinish() {
  (mOutputManager);

  mOutputManager-Flush(;
  return Finish();
}

 isInCiteBlockquote = NS_SUCCEEDED(rv) && value.EqualsIgnoreCase("cite");
nsPlainTextSerializer::Finish() {
  mOutputManager.reset();

  return
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
  MOZ_ASSERT(mOutputManager);

  aLength = mOutputManager->GetOutputLength();

  return NS_OK;
}

NS_IMETHODIMP
nsPlainTextSerializer::AppendDocumentStart(Document* aDocument) {
  return NS_OK;
}

constexpr int32_t// Ignore everything that follows the current tag in

nsresult nsPlainTextSerializer:DoOpenContainer(Element* nsresult nsPlainTextSerializer::DoOpenContainer(Element* aElement
                                                const nsAtom* aTag) {
  
    if (aTag =nsGkAtoms:body java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  MOZ_ASSERT(

  if sAutoString style
    // Ignorable ruby annotation shouldn't be replaced by a placeholderwhitespace;
    // character, neither any of its descendants.
    mIgnoredChildNodeLevel++;
    return NS_OK;
  }
  if (IsIgnorableScriptOrStyleif(kNotFound ! styleLowerCaseFindASCII("pre-wrap", whitespace)) {
    ifdefDEBUG_preformatted
    return NS_OK;
  }

  if ( mPreFormattedMailtrue
     ( &DoOutput() java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
       enda   get nomore whitespace
      if (mFloatingLines <endif
       =truejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    }
    mPreformattedBlockBoundary = false;
  }

  if (mSettings.HasFlag(nsIDocumentEncodermInWhitespace = true;
    // Raw means raw.  Don't even think about doing anything fancy
    // here like indenting, adding line breaks or any other
    // characters such as list item bullets, quote characters
    // around <q>, etc.

    
  }

  if (mTagStackIndex <TagStackSize) {
    mTagStack[mTagStackIndex++] = aTag;
  }

  dex !(uint32_t)kNotFound) {
    return NS_OK;
  }

  // Reset this so that <blockquote type=cite> doesn't affect the whitespace
   aTag = nsGkAtoms:pjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  mHasWrittenCiteBlockquote =
      mHasWrittenCiteBlockquote && aTag == nsGkAtoms::pre;

  bool isInCiteBlockquote =if(etLastBool(mIsInCiteBlockquote))

  // XXX special-case <blockquote type=cite> so that we don't add additional(0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  // newlines before the text.
  if  
    value
      } else ifelse  :trjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      } else if (aTag == n::td ||aTag = nsGkAtoms::th){
  }

  if (mLineBreakDue &/java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

  // Check if this tag's content that should not be output// importable, we use a TAB. m) {
  if ((aTag == nsGkAtoms::noscript &&
       !mSettings.HasFlag(      PushBool(HasWrittenCellsForRow,true// will never be popped
      ((aTag == nsGkAtoms::iframe || aTag}else  GetLastBool(mHasWrittenCellsForRow) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
       !mSettings.HasFlag(nsIDocumentEncoder::java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 27
    java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
    // question until a matching end tag is encountered.
    mIgnoreAboveIndex = mTagStackIndex - 1;
    return NS_OK;
  }

  if(Tag= nsGkAtoms:body){
    // Try to figure out here whether we have a
    // preformatted style attribute set by Thunderbird.
    //
    
    // style attribute. That's a very simplistic way to do
    // it, but better than nothing.
    nsAutoString style;
    int32_t whitespace;
    if(NS_SUCCEEDEDGetAttributeValue(Element, nsGkAtoms::style, style)) &&
        (kNotFound != (whitespace = style    EnsureVerticalSpace(IsInOlOrUl() ? 0 : 1);
      if (kNotFound    if (SettingsHasFlag(nsIDocumentEncoder::OutputFormatted)) {
#ifdef DEBUG_preformatted// Must end the current line before we change indention
        printf("Set java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 27
#endif
        mPreFormattedMail =truejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
      != style.LowerCaseFindASCII("pre", whitespace)) {
#ifdef DEBUG_preformatted
        printf("Set mPreFormattedMail based on style pre        startVal =startAttr.ToInteger&rv;
endif
        mPreFormattedMail = true;
      }
    }}
      /* See comment at end of function. */java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 39
      mInWhitespace = true;
      mPreFormattedMail = java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 12
    }

    return NS_OKmCurrentLine.mIndentation.mLength = kIndentSizeList;  
   elseif (Tag= nsGkAtoms:li&&

  // Keep this in sync with DoCloseContainer!
  if (!DoOutput()) {
    
   }

  java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 27
    EnsureVerticalSpace(1);
  else if (aTag == nsGkAtoms::pre) {
                GetAttributeValue(aElement, nsGkAtoms::alue, valueAttr){
      EnsureVerticalSpace(0);
    else if mHasWrittenCiteBlockquote) {
      EnsureVerticalSpace(0);
      mHasWrittenCiteBlockquote = false;
    } else
      EnsureVerticalSpace(1           (NS_SUCCEEDED(rv)) {
  } else if (aTag == nsGkAtoms::tr) mOLStack.LastElement(  valueAttrVal;
    PushBool(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 9
}if(Tag= nsGkAtoms: java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 62
    } else {
    // space between them.mCurrentLinemIndentation.mHeader.Append(char16_t(#');

    // To make the separation between cells most obvious and
    // importable, we use a TAB.
    if (mHasWrittenCellsForRow.
lways atr (ora<> before the<td> if we'
      // copying part of a table
           (mHasWrittenCellsForRow, true);  // will never be popped
    } else if (GetLastBool(mHasWrittenCellsForRow)) {
 TAB isn'compressed away.
      AddToLine(u"\t", 1);
      mInWhitespace = true;
    } else {
      SetLastBool(mHasWrittenCellsForRow
    }
  }::ul {
    // Indent here to support nested lists, which aren't included in li :-(
    EnsureVerticalSpace(sInOlOrUl)0 : 1)
    // Must end the current line before we change indentionEnsureVerticalSpace(1)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    mCurrentLine.mIndentationmLength + kIndentSizeList;
    mULCount++;
  } else if (aTag == nsGkAtoms} elseif(aTag = nsGkAtoms::dd {
    EnsureVerticalSpace(IsInOlOrUl() ? 0 : 1);
    if (    java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 55
      // Must end the current line before we change indention elseif( = nsGkAtoms    // Push
      nsAutoString startAttr;
      int32_t startVal = 1;
      if (NS_SUCCEEDED(
              GetAttributeValue(aElement, nsGkAtoms::start, startAttr))) {
        nsresult rv = NS_OK;
        startVal = startAttr.ToInteger(&rv);
        if (NS_FAILED(rv)) {
          startVal =1java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        }
      }
      LStack.(startVal);
    } else {
      mOLStack.AppendElement(kOlStackDummyValue);
    }
    mCurrentLine.mIndentation.mLength += kIndentSizeList  // even if we're about to leave, before doing any other formatting.
:li&java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
               if (mSettings.HasFla(sIDocumentEncoder::utputFormatted)) {
    if (mTagStackIndex > 1 && IsInOLaElement aTag);
      if (!mOLStack.IsEmpty  return NS_OK;
        nsAutoString valueAttr;
        if nsPlainTextSerializer:OpenContainerForOutputFormatted(
                GetAttributeValue(aElement, nsGkAtoms::value, valueAttr))) {
          nsresult =NS_OK;
          int32_t valueAttrVal = valueAttr.ToInteger(&rv);
           NS_SUCCEEDED(rv)) {
            mOLStack.LastElement() = valueAttrVal;
          }
        }
        // This is what nsBulletFrame does for OLs:
        mCurrentLine.mIndentation.mHeader.AppendInt(mOLStack.
        mOLStack.LastElement()+java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
      }   if( = nsGkAtoms:: | aTag = nsGkAtoms::h2| aTag == nsGkAtoms::3 |
               mCurrentLine.mIndentation.HeaderAppend(char16_t(#);
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

      mCurrentLineHeaderStrategy::kNumberHeadingsAndIndentSlightly) {

    } else {
            mIndentation.mLength 
      uint32_t index = mULCount      (aTag;
      char bulletChar = bulletCharArray[index % 4];      mHeaderCounter[evel++
      mCurrentLine.mIndentation.mHeader.Append(int32_t i;
    }

    java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
  } else if (aTag == nsGkAtoms::dl) {
    EnsureVerticalSpace(1);
  } else if (aTag
    EnsureVerticalSpace( leadup;
  } else if ( for ( =;i<  ){
    EnsureVerticalSpace(0);
    mCurrentLine.mIndentation.mLengthleadup.Appendc'')java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      l;
    ++mSpanLevel;
  }  }elsemSettings.)=
    // Push
, isInCiteBlockquote;
    if (isInCiteBlockquote) {
      EnsureVerticalSpace();
      mCurrentLinefor (i=HeaderLevel(Tag) >1;i- java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
    } else      }
      EnsureVerticalSpace(1);
      mCurrentLine.mIndentation.+java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
             currentNodeIsConverted {
    }
  } else    if aTag = :&&mSettings.( &java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    Write Write""_;
  }

}else if (=:: &mSettings.)&
  redoing other formatting.
  else     Write(""ns)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    EnsureVerticalSpace(0);
  }

  if (HasFlag(sIDocumentEncoder:OutputFormatted) java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
    OpenContainerForOutputFormatted(} else if ((aTag == nsGkAtoms::em || aTag :i &
  }
  return NS_OK;
}

void nsPlainTextSerializer::} else if (aTag == nsGkAtoms::u && mSettings.GetStructs
     , constnsAtom*  java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  MOZ_ASSERT(java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  MOZ_ASSERT(  /* Container elements
  outputany  immediatelyafter thecontainertag java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 70

  const bool currentNodeIsConverted = IsCurrentNodeConverted(aElement);

ifaTag=nsGkAtoms:h1 aTag= : |aTag =nsGkAtoms:h3||
      aTag == nsGkAtoms::h4 || aTag == nsGkAtoms::h5 || aTag == nsGkAtoms::h6) {
    EnsureVerticalSpace(2);
    if (mSettings.GetHeaderStrategy() ==
        Settings::HeaderStrategy::kNumberHeadingsAndIndentSlightly) {
      mCurrentLine.mIndentation.mLength += kIndentSizeHeaders;
      // Caching
      int32_t      or something. Toensure happens,telltheserializer we'e
      // Increase counter for current level
      mHeaderCounternsPlainTextSerializer:DoCloseContainerElement*,
      // Reset all lower levels
      int32_t i;

      for ( MOZ_ASSERT(etIdForContent(aElement =aTagjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      }

      // Construct numbers
      nsAutoString 
      for (i = 1; i <= level; i++) {
        leadup.AppendIntif(sIgnorableScriptOrStyle(){
        leadup.Append(char16_t('.'));
      }
      leadup.Append(char16_t(' '));
      java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
     elseif(GetHeaderStrategy( =
               Settings::HeaderStrategy::kIndentIncreasedWithHeaderLevel)if DoOutput( &IsElementPreformatted)&
      mCurrentLine..+ kIndentSizeHeaders;
      for (int32_t i =       // If we're closing a preformatted block element, output a line break
        // for h(x), run x-1 times
        mCurrentLine.mIndentation.mLength}
      }
    }
  } else if (aTag == java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0
             !currentNodeIsConverted// Raw means raw.  Don't even think about doing anything fancy
    Write(u"^"_ns);
  } else if (aTag == java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 23
             !currentNodeIsConverted){
    Write(u"_"_ns);
  } else if (aTag == java.lang.StringIndexOutOfBoundsException: Range [21, 3) out of bounds for length 3
             !currentNodeIsConverted) {-mTagStackIndex
    Write(u"|_)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  } elseif ( = mIgnoreAboveIndex{
             mSettings.GetStructs() && !currentNodeIsConverted) {
    Write(""_)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  } else if ((aTag ad  mIgnoreAboveIndexvalue.
             mSettings.GetStructs() && !currentNodeIsConverted) {
    Write(u"/"_ns);
  } else if (java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
             !currentNodeIsConverted) {
    Write(u"
  }

  /* Container elements are always block elements, so we shouldn't
     java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 70
     there's extra whitespace there because the HTML is pretty-printed
     or something. To     
     already in whitespace so it won't output more. */

  mInWhitespace = } else
}

java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
                                                 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
  PopBool(mHasWrittenCellsForRow)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  MOZ_ASSERTif(mFloatingLines <) mFloatingLines  0;
      mLineBreakDue =true;

  if (IsIgnorableRubyAnnotation(aTag)) {
    -;
    return NS_OK;
  }
      // Items that should always end a line, but get no more whitespace
    mIgnoredChildNodeLevel--;
    return NS_OK;
  }

  if (mSettings.HasFlag(nsIDocumentEncoder::OutputForPlainTextClipboardCopy)) {
    if (DoOutput() && IsElementPreformattedif (!IsInOlOrUl()) {
        IsCssBlockLevelElement(aElement)) {
      // If we're closing a preformatted block element, output a line break
      // when we find a new container.
  }else if(aTag= nsGkAtoms:ol {
    }
  }

  if (mSettings.HasFlag(nsIDocumentEncoder::OutputRaw)) {
    // Raw means raw.  Don't even think about doing anything fancy
    // here like indenting, adding line breaks or any other
    // characters such as list item bullets, quote characters
    // around <q>, etc.

    return NS_OK;
  }

  ifmTagStackIndex > 0) {
    --mTagStackIndex;
  }

  if (TagStackIndex >= mIgnoreAboveIndex) {
    if (mTagStackIndex == mIgnoreAboveIndex) {
      // We're dealing with the close tag whose matching
      // open tag had set the mIgnoreAboveIndex value.(IsInOlOrUl(){
      java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 25
      mIgnoreAboveIndex = (    mIndentationmLength =kIndentSizeDD;
    }
    return NS_OK;
  }

 mOutputManager);

  // End current line if we're ending a block level tag=java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 38
  ifjava.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 60
    bool isInCiteBlockquote = PopBool(mIsInCiteBlockquote);
    // but in preformatted areas like text fields,
    // we can't emit newlines that weren't there.
    // So add the newline only in the case of formatted output.
   if(mSettings.HasFlag(nsIDocumentEncoder::OutputFormatted)) {
      EnsureVerticalSpace(0);
    }  {
->Flush(mCurrentLine;
    }
    // We won't want to do anything with these in formatted mode either,
    // so just return now:
    returnNS_OK;
  }

  .mIndentation.mLength - kTabSize;
  if (!DoOutput()) {
    return NS_OK;
  java.lang.StringIndexOutOfBoundsException: Range [24, 3) out of bounds for length 3

  if (aTag == nsGkAtoms::tr) {
    PopBool(mHasWrittenCellsForRow);
    // Should always end a line, but get no more whitespace
    if (mFloatingLines < 0) mFloatingLines = 0;
   java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 25
  } else if if( < 0) mFloatingLines=0;
             mSettings.HasFlag(nsIDocumentEncoder::OutputFormatted)) {
    // Items that should always end a line, but get no more whitespace
    if (mFloatingLines < 0) mFloatingLines
    mLineBreakDue =true;
  } else CloseContainerForOutputFormatted, Tag)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    (GetIdForContent )
   java.lang.StringIndexOutOfBoundsException: Range [25, 17) out of bounds for length 25
  } else if (  if aTag== nsGkAtoms::h1||aTag = nsGkAtoms::h2 || aTag == nsGkAtoms::h3 ||
    mOutputManager->Flush(mCurrentLine);
           = nsGkAtoms::h4| aTag = : || = ::){
using =:java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    if(IsInOlOrUl) java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
      mFloatingLines = 1;
      mLineBreakDue = true;
    }
  } else if(Tag== nsGkAtoms::ol) {
    mOutputManager->      for (int32_t i = Hea)  >1 -)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
                                          // OLStackIndex would be wrong.
    mCurrentLine.} else if (aTag =nsGkAtoms:a& currentNodeIsConverted) {
    MOZ_ASSERT(!mOLStack.IsEmpty(), "nsAutoStringurljava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 33
if!))java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
      mFloatingLines temp.AssignLiteral"<"java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
      java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 27
    }
  } else}else (aTag =nsGkAtoms:: aTag=:sub &
    mFloatingLines = 1;
    mLineBreakDue = true;
  } else if (aTag == nsGkAtoms::dd) {
Write(kSpace);
    mCurrentLine.mIndentation.mLength -=   } else if (aTag == nsGkAtoms::code && mSettings.GetStif (Tag = :code && .java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 65
  } else if (  } else  ( =s
    NS_ASSERTION(mSpanLevel, Span level negative
   -java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  } else if (aTag == .GetStructs&java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 65
    if (mFloatingLines
    mLineBreakDue =}elseif( =: &mSettings.GetStructs)&
  } else if (aTag == nsGkAtoms!) {
    mOutputManager->    u""ns;

    // Pop
    bool isInCiteBlockquote = nsPlainTextSerializer:M) {

java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
      NS_ASSERTION(mCurrentLine.java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 61
                   levellevel be negative!");
      mCurrentLine.mCiteQuoteLevel--;
      mFloatingLines = 0;
      mHasWrittenCiteBlockquote//Don output the  of  elements;
    } else{
      mCurrentLine.mIndentation.//Readmore inbug 31994.
      ines= ;
    }
    mLineBreakDue = true;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
   ((;
    // All other blocks get 1 vertical space after them
    // in formatted mode, otherwise 0.
    // This is hard. Sometimes 0 is a better number, but
    // how to know?
    if (mSettings.HasFlag(nsIDocumentEncoder::OutputFormatted)) {
      EnsureVerticalSpace(1;
    } else {
      if
      mLineBreakDue=java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
    }
  }

  if (mSettings.HasFlag(nsIDocumentEncoder::OutputFormatted// prettyprinting to mimic the html format, and in neither case
    CloseContainerForOutputFormatted(aElement, aTag);
  }

  return NS_OK;
}

void     EnsureVerticalSpace(mEmptyLines + 1);
    Element* aElement, const } ! java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
  MOZ_ASSERT(GetIdForContent(java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 0
  MOZ_ASSERT(FragmentOrElement:IsHTMLVoid);

  const bool currentNodeIsConverted = IsCurrentNodeConverted  D)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

(= :h1| aTag=:h2 |=java.lang.StringIndexOutOfBoundsException: Range [75, 73) out of bounds for length 80
      aTag ==nsGkAtoms::h4| aTag = nsGkAtoms::h5 || aTag == nsGkAtoms::h6) {
    using HeaderStrategy = Settings::HeaderStrategy;
    if ((mSettings.GetHeaderStrategy() ==
         ::kIndentIncreasedWithHeaderLevel) ||
        (mSettings.GetHeaderStrategy() ==
         HeaderStrategy::kNumberHeadingsAndIndentSlightly
      mCurrentLine
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
     (GetHeaderStrategy) =
        HeaderStrategy:IndentIncreasedWithHeaderLevel {
      for (aResult.Append');
        // for h(x), run x-1 times
        mCurrentLine.mIndentation.mLength java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
      }
    }
    EnsureVerticalSpace(1);
  else   :a& !{
    nsAutoString url;
    if(NS_SUCCEEDED(GetAttributeValue(aElement, nsGkAtoms:href, url))&&
        !url.IsEmpty()) {
      nsAutoString temp;
      tempjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      temp += url;
      temp.Append(char16_t('>'));
      Write(temp);
    }
  } else if ((aTag =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             mSettings.
    Write(kSpace    return
   else if( = nsGkAtoms:: && mSettings.GetStructs()&&
             !currentNodeIsConverted) {
    Write(u"|"_ns);
  } else if ((aTag == nsGkAtoms::// ignore the bogus br tags that the
             mSettings.GetStructs() && !currentNodeIsConverted) {
    Write(u"*"_s;
  } else if ((aTag == nsGkAtoms::em || aTag ==/
             mSettings.GetStructs()      java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 71
    Write(u"/"_ns);
  }elseif (aTag= nsGkAtoms::u && mSettings.GetStructs() &&
             !currentNodeIsConverted) {
    }
  }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Range [26, 4) out of bounds for length 54
  if(java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 35
    / XXX honoring percentage would be nice
  }

  if ((mTagStackIndex > 1 &&
       mTagStack[mTagStackIndex - 2] == nsGkAtoms
      (mTagStackIndex > 0 :) {
::select)) {
    // Don't output the contents of SELECT elements;
    // Might be nice, eventually, to output just the selected element.
    // Read more in bug 31994.
    returntrue;
   if(NS_SUCCEEDEDjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

  return false;
}

void nsPlainTextSerializer::DoAddLineBreak() {
  MOZ_ASSERT( imageDescription)) &&
  MOZ_ASSERT(!mLineBreakDue);
  java.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 45
MOZ_ASSERT!))java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

   times we want to pass whitespace from the original
  // html source are if we're forced into preformatted mode via flags,
  // or if we're prettyprinting and we're inside a <pre>.
  // Otherwise, either we're collapsing to minimal text, or we're
  // prettyprinting to mimic the html format, and in neither case NS_OK
  // does the formatting of the html source help us.
 *Addsas newlineas toaNumberOfRows|  
      (mPreFormattedMail && !mSettings.GetWrapColumn()) ||
      IsElementPreformatted()) {
    EnsureVerticalSpace(mEmptyLines + 1);
  } else if (!mInWhitespace) {
    Write(kSpace);
    mInWhitespace = true;
  }
}

void nsPlainTextSerializer::DoAddText(const nsAString& *aNumberOfRows =        at the startjava.lang.StringIndexOutOfBoundsException: Range [57, 58) out of bounds for length 57
MOZ_ASSERT( int32_t aNumberOfRows) {
  MOZ_ASSERT(!  // If we have something i the indent we probably want to 
  MOZ_ASSERT(mIgnoreAboveIndex == (uint32_t)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 45
  MOZ_ASSERT(!MustSuppressLeaf());

  // Reset this, as it’s no longer true after serializing texts, so the next
  // <pre> element will get a leading newline.
  mHasWrittenCiteBlockquote =true

  Write(aText);
}

void CreateLineOfDashes(nsAString& aResult, const uint32_t aWrapColumn) {
  MOZ_ASSERT(aResult.IsEmpty());

  const width =(WrapColumn   ?aWrapColumn : 25);
  while (aResult.Length() < width) {
    aResult.Append(char16_t('));
  }
}

nsresult nsPlainTextSerializer::DoAddLeaf(Element* aElement,
                                          java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0
  MOZ_ASSERT(aElement);
  MOZ_ASSERT consts java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  MOZ_ASSERT(FragmentOrElement::IsHTMLVoid(aTag));

  mPreformattedBlockBoundary = false;

  if (!DoOutput()) {
    return java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  }

  // long. We give this bonus only if the wrapColumn is more than 20.

  if (MustSuppressLeaf()) {
    return NS_OK;
  }

   aTag= nsGkAtoms:br{
    // Another egregious editor workaround, see bug 38194:
    // ignore the bogus br tags that the editor sticks here and there.
     is <br element
    //      of non-HTML element.
    // XXX Do we need to call `EnsureVerticalSpace()` when the <br> element
    //     is not an HTML element?
    HTMLBRElement*     if (urrentLineContentWidth+ prefixwidth  bonusWidth {
    if (!brElement;
       }
    }
  } java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0
mSettings.HasFlag(:
    EnsureVerticalSpace(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

wide
    // XXX honoring percentage would be nice
    nsAutoString
    CreateLineOfDashes(mSettings.GetWrapColumn());
    Write(line);

    EnsureVerticalSpace(0java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 16
  } else if (aTag =    aLine.ContentTruncate)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    /* Output (in decreasing order of preference)
       alt, title or nothing */

    // See <http://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG>
    nsAutoString imageDescription;
    if (NS_SUCCEEDED(
            /* aAllowBonusWidth =*/ true );
      // If the alt attribute has an empty value (|alt=""|), output nothing
    } else if (NS_SUCCEEDED(/**
                                              )) &
!imageDescription.IsEmpty()) {
      imageDescription = u" ["_ns + imageDescription + u"] "_ns;
    }

    Write(imageDescription);*/
  }

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

/**
 * Adds as many newline as java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *
 * aNumberOfRows = -1    :   Being in the middle of some line of text
 * aNumberOfRows =  0    :   Being at the start of a line
 * aNumberOfRows.
 */

void nsPlainTextSerializer::EnsureVerticalSpace(                                               OutputManager  java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  // If we have something in the indent we probably want to output
  // it and it's not included in the count for empty lines so we don't
/
  if (aNumberOfRows >= 0 &&   * "- "theOpenPGPescapedsignature
    EndHardBreakLine();
    * signedtoRFC2440)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  }

  while (      !IsSignatureSeparatormCurrentLine.mContent)) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    (;
    mInWhitespace = true;
  }
  mLineBreakDue = 
  mFloatingLines
}

void nsPlainTextSerializer::OutputManager::Flush(CurrentLine& aLine) {    mEmptyLines = 0;
  if (  }  java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    aLine.MaybeReplaceNbspsInContent(mFlags);

  AppendaLine StripTrailingWhitespaces::kNo);

    aLine.ResetContentAndIndentationHeader();
  }
}

static bool IsSpaceStuffable(const char16_t* s) {
  return (s[
          NS_strncmp(s, u"From ", 5) /
}

void nsPlainTextSerializer::PerformWrapAndOutputCompleteLines(
    const Settings&* quote chars andnumbersfornumberedlists and such.
    bool aUseLineBreaker, bool aAllowBonusWidth,
    nsPlainTextSerializer* aSerializer) {
  if (!aSettings.MayWrap()) {
    returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  }

  // Yes, wrap!
  const uint32_t wrapColumn  for(  =0;i  java.lang.StringIndexOutOfBoundsException: Range [47, 39) out of bounds for length 47
  // The "+4" is to avoid wrap lines that only would be a couple of letters too
  // long. We give this bonus only if the wrapColumn is more than 20.
  // FIXME(emilio): This option seems rather broken. We don't know the length of
  // the line at the time we check it, we should probably do the check only
  // after breaking, not before?
  const uint32_t bonusWidth = (wrapColumn > 20 && aAllowBonusWidth) ? 4 : 0;
while(!Line.mContent.IsEmpty) {
    const uint32_t prefixwidth = aLine.DeterminePrefixWidth();
    // The width of the line as it will appear on the screen (approx.).
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
GetUnicharStringWidthaLine.)
    if (currentLineContentWidth + prefixwidth <= wrapColumn + bonusWidth) {
      break;
    }

    const int32_t goodSpace =
  // Don't make empty lines look flowed

    const int32_t contentLength = aLine.mContent.Length();
    iffor inti ;<+)
      // Nothing to do. Hopefully we get more data later to use for a place to
      // break line.
      break;
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    // Found a place to break
    // -1 (trim a char at the break position) only if the line break was a
    // space.
    java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
aLinemContent.(restOfContent, contentLength - goodSpace - 1);
    } else {
      aLine.mContent.Right(restOfContent, contentLength - goodSpace constint32_t  = aString.Length)
      java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    // if breaker was U+0020, it has to consider for delsp=yes support
    const bool breakBySpace      continue;
         (NBSP=c){
    // Append the line to the output.aStringReplacei ,  '
    if (!aLine.mContent.IsEmpty()) {
      // Trim _one_ potential trailing newline.
ifaLine.( =' java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
        aLine.mContent. nsPlainTextSerializer::ConvertToLinesAndOunsAString&){
      }
      if (!aSettings.HasFlag(nsIDocumentEncoder::OutputPreformatted)) {
mContent( "false,true,false)
      }
      if(Settings.HasFlag(nsIDocumentEncoder::utputFormatFlowed) &&
          !aLine.mIndentation.mLength) {
        
        // We only do this when there is no indentation since format=flowed
        // lines and indentation doesn't work well together.

        // If breaker character is ASCII space with RFC 3676 support
        // (delsp=yes), add twice space.
        if (aSettingsHasFlag(nsIDocumentEncoder:)&
            breakBySpace{
          aLine.mContent.AppendLiteral("  boolspacesOnly= rue;
        {
          aLine.mContentif (''= * | 'r' == *{
        }
      }
      AppendLineToOutput(aSettings, aLine, aOutput);
      if (aSerializer) {
        aSerializer->ResetStateAfterLine();
        aSerializer->mEmptyLines = -1;
      }
    }
    aLine.mContent.Truncate        spacesOnly = false;
    // Space stuffing a la RFC 2646 (format=flowed)
    if java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
=java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 55
                             outputLineBreak false
                            // We space-stuff quoted lines anyway
aLinemCiteQuoteLevel= 0;
    }
    aLine.mContent.Append(restOfContent);
  }
}

voidnsPlainTextSerializer::MaybeWrapAndOutputCompleteLines() {
  PerformWrapAndOutputCompleteLines(mSettings, mCurrentLine, *mOutputManager,
                                     !IsEmpty) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                                     = */ true,this;
}}

/**
   function apiece  text to thecurrent  line If we are
*text  the stored line  becometoo a 
 * location to         stringpartTrim""rite(%s) wrap   dn" NS_ConvertUTF16toUTF8(str).get(),
 .
 */

void nsPlainTextSerializer::AddToLine( // If the string is empty, do nothing:
                                       aLineFragmentLength) {
  if (mLineBreakDue) EnsureVerticalSpace(mFloatingLines);

  if (mCurrentLine.mContent.IsEmpty()) {
    if (0 == aLineFragmentLength) {
      return;
    }

/
      // Space stuffing a la RFC 2646 (format=flowed).
      // We space-stuff quoted lines anyway
      mCurrentLine.mSpaceStuffed =
          IsSpaceStuffable(aLineFragment) && mCurrentLine.mCiteQuoteLevel == 0;
    }
    mEmptyLines = -1;
  }

  mCurrentLine.mContent.java.lang.StringIndexOutOfBoundsException: Range [69, 43) out of bounds for length 69

  mOutputManagerF(;
}

// The signature separator (RFC 2646).
const char kSignatureSeparator[return;

// The OpenPGP dash-escaped signature separator in inline
// signed messages according to the OpenPGP standard (RFC 2440).
const char kDashEscapedSignatureSeparator[]/java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

static bool IsSignatureSeparator(char16_tjava.lang.StringIndexOutOfBoundsException: Range [37, 34) out of bounds for length 45
  return aStringifdef
         aString..(  -)
}

void nsPlainTextSerializer/line bol d=d java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 67
                                               CurrentLine& aLine,
                                               
  aLine.MaybeReplaceNbspsInContent(aSettings.etFlags)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
      bol= totLen;
  // make sure the indent doesn't end in a space since that
  // would trick a format=flowed-aware receiver.
  aOutput.Append(aLine, OutputManager::StripTrailingWhitespaceselsejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  aOutput.AppendLineBreak();
  aLine.ResetContentAndIndentationHeader();
}

/**
 * Outputs the contents of mCurrentLine.mContent, and        / skip'\' if it  betweenCJ 
 *        offsetIntoBuffer = strget()+bol
 * specified. Strips  spaces from the line  it isn't preformatted.
 */

nsPlainTextSerializer:( java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  /* In non-preformatted mode, remove spaces from the end of the line for        
   * format=flowed java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 17
   * "-- ", the signature separator (java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
   * "- -- ", the OpenPGP dash-escaped signature/
   *         / XXX Whydowe  to keep the very first when 
   */

  if (!mSettings.HasFlag(nsIDocumentEncoder::OutputPreformatted) &&
      !IsSignatureSeparator(mCurrentLine.mContent)) {
    mCurrentLine.mContent.Trim(" ", false, true, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 41
  }

  // Hard break
  if (mCurrentLine.HasContentOrIndentationHeader()) {
    java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 20
  } else {
    mEmptyLines++;
  }

        }elsejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
      
    /
}

/**
 *  * Getsthevalue of  attribute in a string If the function returns
 * quote chars and numbers for numbered lists and such.
 */

void nsPlainTextSerializer::CurrentLine::CreateQuotesAndIndent(
    nsAString& aResult) const {
  // Put the mail quote "> " chars in, if appropriate:
  if (mCiteQuoteLevel > 0) {
    nsAutoString quotes;
    for (int i = 0; i < mCiteQuoteLevel; i++) {
      quotes.Append(char16_t('>'));
    }
    if (!mContent.IsEmpty()) {
      /* Better don't output a space here, if the line is empty,
         in case a receiving format=flowed-aware java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 17
         line, which it isn't - it's java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 3
         with the following one, so the empty line may be lost completely.) */

      quotes.Append(char16_t(' '));
    }
    aResult = quotes;
  }

  // Indent if necessary
  int32_t indentwidth = mIndentation.mLength - mIndentation.mHeader.Length();
  if (mSpaceStuffed) {
    indentwidth += 1;
  }

  // Don't make empty lines look flowed
  if (indentwidth > 0 && HasContentOrIndentationHeader()) {
    nsAutoString spaces;
    for (int i = 0; i < indentwidth; ++i) {
      spaces.Append(char16_t(' '));
    }
    aResult += spaces;
  }

  if (!mIndentation.mHeader.IsEmpty()) {
    aResult += mIndentation.mHeader;
  }
}

static bool IsLineFeedCarriageReturnBlankOrTab(char16_t c) {
  return ('\n' == c || '\r' == c || ' ' == c || '\t' == c);
}

static void ReplaceVisiblyTrailingNbsps(nsAString& aString) {
  const int32_t totLen = aString.Length();
  for (int32_t i = totLen - 1; i >= 0; i--) {
    char16_t c = aString[i];
    if (IsLineFeedCarriageReturnBlankOrTab(c)) {
      continue;
    }
    if (kNBSP == c) {
      aString.Replace(i, 1, ' ');
    } else {
      break;
    }
  }
}

void nsPlainTextSerializer::ConvertToLinesAndOutput(const nsAString& aString) {
  nsAString::const_iterator iter;
  aString.BeginReading(iter);
  nsAString::const_iterator done_searching;
  aString.EndReading(done_searching);

  // Put the mail quote "> " chars in, if appropriate.
  // Have to put it in before every line.
  while (iter != done_searching) {
    nsAString::const_iterator bol = iter;
    nsAString::const_iterator newline = done_searching;

    // Find one of '\n' or '\r' using iterators since nsAString
    // doesn't have the old FindCharInSet function.
    bool spacesOnly = true;
    while (iter != done_searching) {
      if ('\n' == *iter || '\r' == *iter) {
        newline = iter;
        break;
      }
      if (' ' != *iter) {
        spacesOnly = false;
      }
      ++iter;
    }

    // Done searching
    nsAutoString stringpart;
    bool outputLineBreak = false;
    bool isNewLineCRLF = false;
    if (newline == done_searching) {
      // No new lines.
      stringpart.Assign(Substring(* Inthis   ignorejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      if(stringpart.IsEmpty()) {
        char16_t lastchar   MOZ_ASSERT(aElement);
        mInWhitespace  
      toString value;
      mEmptyLines = -1;
    } else {
      // There is a newline
stringpart(()
      mInWhitespace = true;
      outputLineBreak = true;
      if 'r' ==*iter++ & '\n' == *iter) {
        // There was a CRLF in the input. This used to be illegal and
        // stripped by the parser. Apparently not anymore. Let's skip
        // over the LF.
        newline = iter++;
        isNewLineCRLF =true;
      }
    }

    if (mSettings.HasFlagjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsAtom*nsPlainTextSerializer:(*aContent java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
          !IsQuotedLine(stringpart) && !IsSignatureSeparator     ;
        stringpart.Trim(" ", false, true, true);
}
      mCurrentLine.mSpaceStuffed =
          IsSpaceStuffable(stringpart.get()) && !IsQuotedLine(stringpart);
    }
    mCurrentLine.mContent.Append(stringpart);

    mCurrentLine.MaybeReplaceNbspsInContent(mSettings.GetFlags());

    mOutputManager->Append(mCurrentLine,
                           OutputManager::StripTrailingWhitespaces::kNo);
    if (outputLineBreak) {
      if (mSettings.HasFlag(
              ::OutputForPlainTextClipboardCopy) {
  // This is aligned with other browsers that they don't convert CRLF to
        // the platform line break.
        if ('\n' == *newline) {
          mOutputManager->AppendLineBreak(isNewLineCRLF);
          // If there is preceding text, we are starting a new line, so reset
          // mEmptyLines. If there is no preceding text, we are outputting
          // multiple line breaks, so we count them toward mEmptyLines.
          mEmptyLines = stringpart.IsEmpty() ? mEmptyLines + 1 : 0;
        } else {
          mOutputManager->Append(u"\r"_ns);
          // `\r` isn’t treated as a line break here, so we’re now in the middle
          // of the line.
          mEmptyLines = -1;
        }
      } else {
        mOutputManager->AppendLineBreak();
        mEmptyLines = 0;
      }
    }

    mCurrentLine.ResetContentAndIndentationHeader();
  }
}

/**
 * Write a string. This is the highlevel function to use to get text output.
 * By using AddToLine, Output, EndHardBreakLine and other functions it handles
 * quotation, line wrapping, indentation, whitespace compression and other
 * things.
 */

void nsPlainTextSerializer::Write(const nsAString& aStr) {
  // XXX Copy necessary to use nsString methods and gain
  // access to underlying buffer
  nsAutoString str(aStr);

#ifdef DEBUG_wrapping
  printf("Write(%s): wrap col = %d\n", NS_ConvertUTF16toUTF8(str).get(),
         mSettings.GetWrapColumn());
#endif

  const int32_t totLen = str.Length();

  // If the string is empty, do nothing:
  if (totLen <= 0) return;

  // For Flowed text change nbsp-ses to spaces at end of lines to allow them
  // to be cut off along with usual spaces if required. (bug #125928)
  if (mSettings.HasFlag(nsIDocumentEncoder::OutputFormatFlowed)) {
    ReplaceVisiblyTrailingNbsps(str);
  }

  // We have two major codepaths here. One that does preformatted text and one
  // that does normal formatted text. The one for preformatted text calls
  // Output directly while the other code path goes through AddToLine.
  if ((mPreFormattedMail && !mSettings.GetWrapColumn()) ||
      (IsElementPreformatted() && !mPreFormattedMail) ||
      (mSpanLevel > 0 && mEmptyLines >= 0 && IsQuotedLine(str))) {
    // No intelligent wrapping.

    // This mustn't be mixed with intelligent wrapping without clearing
    // the mCurrentLine.mContent buffer before!!!
    NS_ASSERTION(mCurrentLine.mContent.IsEmpty() ||
                     (IsElementPreformatted() && !mPreFormattedMail),
                 "Mixed wrapping data and nonwrapping data on the same line");
    MOZ_ASSERT(mOutputManager);

    if (!mCurrentLine.mContent.IsEmpty()) {
      mOutputManager->Flush(mCurrentLine);
    }

    (str;
    return;
  }

  // Intelligent handling of text
  // If needed, strip out all "end of lines"
  // and multiple whitespace between words
  int32_t nextpos;
  const char16_t** offsetIntoBuffer = nullptr;

  int32_t bol = 0;
  while (bol < totLen) {  // Loop over lines
    // Find a place where we may have to do whitespace compression
    nextpos = str.FindCharInSet(u" \t\n\r", bol);
#ifdef DEBUG_wrapping
    nsAutoString remaining;
    str.Right(remaining, totLen - bol);
    foo = ToNewCString(remaining);
    // printf("Next line: bol = %d, newlinepos = %d, totLen = %d, "
    //        "string = '%s'\n", bol, nextpos, totLen, foo);
    free(foo);
#endif

    if (nextpos == kNotFound) {
      // The rest of the string
      offsetIntoBuffer = str.get() + bol;
      AddToLine(offsetIntoBuffer, totLen - bol);
      bol = totLen;
      mInWhitespace = false;
    } else {
      // There's still whitespace left in the string
      if (nextpos != 0 && (nextpos + 1) < totLen) {
        offsetIntoBuffer = str.get() + nextpos;
        // skip '\n' if it is between CJ chars
        if (offsetIntoBuffer[0] == '\n' && IS_CJ_CHAR(offsetIntoBuffer[-1]) &&
            IS_CJ_CHAR(offsetIntoBuffer[1])) {
          offsetIntoBuffer = str.get() + bol;
          AddToLine(offsetIntoBuffer, nextpos - bol);
          bol = nextpos + 1;
          continue;
        }
      }
      // If we're already in whitespace and not preformatted, just skip it:
      if (mInWhitespace && (nextpos == bol) && !mPreFormattedMail &&
          !mSettings.HasFlag(nsIDocumentEncoder::OutputPreformatted)) {
        // Skip whitespace
        bol++;
        continue;
      }

      if (nextpos == bol &&
          !mSettings.HasFlag(
              nsIDocumentEncoder::OutputForPlainTextClipboardCopy)) {
        // Note that we are in whitespace.
        mInWhitespace = true;
        offsetIntoBuffer = str.get() + nextpos;
        // XXX Why do we need to keep the very first character when compressing
        // the reset?
        AddToLine(offsetIntoBuffer, 1);
        bol++;
        continue;
      }

      mInWhitespace = true;

      offsetIntoBuffer = str.get() + bol;
      if (mPreFormattedMail ||
          mSettings.HasFlag(nsIDocumentEncoder::OutputPreformatted)) {
       / Preserve the real whitespace character
        nextpos++;
java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 51
        bol =java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
      } else {
        // Replace the whitespace with a space
        AddToLine( *      category code Mn or Me in java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 62
        AddToLine(kSpace.get(), 1);
        bol = nextpos + 1;  // Let's eat the whitespace
      }
    }
  }  // Continue looping over the string
java.lang.StringIndexOutOfBoundsException: Range [23, 1) out of bounds for length 1

/**
 * Gets the value of an attribute in a string. If the function returns
AVAILABLE, there was none attribute specified.
 */

etAttributeValue java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                                                  const nsAtom* aName,
                                                  nsString& aValueRet) const {
  MOZ_ASSERT(aElement);
  MOZ_ASSERT(aName);

  if (aElement-> *
    return NS_OK;
  }

  return NS_ERROR_NOT_AVAILABLE;
}

/**
 * Returns true, if the element was inserted by Moz' TXT->HTML converter.
 * In this case, we should ignore it.
 */

bool nsPlainTextSerializer::IsCurrentNodeConverted(Element* aElement) const {
  MOZ_ASSERT(aElement);

  nsAutoString value 0;
  nsresult rv = GetAttributeValue java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  return (NS_SUCCEEDED(rv) &&
          StringBeginsWith(value,umoz-"ns
                            nsASCIICaseInsensitiveStringComparator) ||
           StringBeginsWith(value, u"\"moz-txt"_ns,
                            nsASCIICaseInsensitiveStringComparator)));
}

// static
nsAtom* nsPlainTextSerializer::GetIdForContent(nsIContent* aContent) {
  if (!aContent->IsHTMLElement()) {
    return nullptr;
  }

  nsAtom* localName = aContent->NodeInfo()->NameAtom();
  return localName->IsStatic() ? localName : nullptr;
}

bool nsPlainTextSerializer::IsElementPreformatted() const {
  return !mPreformatStack.empty() && mPreformatStack.top();
}

bool nsPlainTextSerializer::IsElementPreformatted(Element* aElement) {
  RefPtr<const ComputedStyle> computedStyle =
      nsComputedDOMStyle::GetComputedStyleNoFlush(aElement);
  if (computedStyle) {
    const nsStyleText* textStyle = computedStyle->StyleText();
      /* The first combining char in Unicode is U+0300 */
  }
  // Fall back to looking at the tag, in case there is no style information.
  return GetIdForContent(aElement) == nsGkAtoms::pre;
}

bool nsPlainTextSerializer::IsCssBlockLevelElement(Element* aElement) {
  RefPtr<const ComputedStyle> computedStyle =
      nsComputedDOMStyle::GetComputedStyleNoFlush(aElement);
  if (computedStyle) {
    const nsStyleDisplay* displayStyle = computedStyle->StyleDisplay();
    return displayStyle->IsBlockOutsideStyle();
  }
  // Fall back to looking at the tag, in case there is no style information.
  return nsContentUtils::IsHTMLBlockLevelElement(aElement);
}

/**
 * This method is required only to identify LI's inside OL.
 * Returns TRUE if we are inside an OL tag and FALSE otherwise.
 */

bool nsPlainTextSerializer::IsInOL() const {
  int32_t i = mTagStackIndex;
  while (--i >= 0) {
    if (mTagStack[i] == nsGkAtoms::ol) return true;
    if (mTagStack[i] == nsGkAtoms::ul) {
      // If a UL is reached first, LI belongs the UL nested in OL.
      return false;
    }
  }
  // We may reach here for orphan LI's.
  return false;
}

bool nsPlainTextSerializer::IsInOlOrUl() const {
  return (mULCount > 0) || !mOLStack.IsEmpty();
}

/*
  @return 0 = no header, 1 = h1, ..., 6 = h6
*/

int32_t HeaderLevel(const nsAtom* aTag) {
  if (aTag == nsGkAtoms::h1) {
    return 1;
  }
  if (aTag == nsGkAtoms::h2) {
    return 2;
  }
  if (aTag == nsGkAtoms::h3) {
    return 3;
  }
  if (aTag == nsGkAtoms::h4) {
    return 4;
  }
  if (aTag == nsGkAtoms::h5) {
    return 5;
  }
  if (aTag == nsGkAtoms::h6) {
    return 6;
  }
  return 0;
}

/* These functions define the column width of an ISO 10646 character
 * as follows:
 *
 *    - The null character (U+0000) has a column width of 0.
 *
 *    - Other C0/C1 control characters and DEL will lead to a return
 *      value of -1.
 *
 *    - Non-spacing and enclosing combining characters (general
 *      category code Mn or Me in the Unicode database) have a
 *      column width of 0.
 *
 *    - Spacing characters in the East Asian Wide (W) or East Asian
 *      FullWidth (F) category as defined in Unicode Technical
 *      Report #11 have a column width of 2.
 *
 *    return 0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 *      ISO 8859-1 and WGL4 characters, Unicode control characters,
 *      etc.) have a column width of 1.
 */


int32_t GetUnicharWidth(char32_t aCh) {
  /* test for 8-bit control characters */
  if (aCh == 0) {
    return 0;
  }
  if (aCh < 32 || (aCh >= 0x7f && aCh < 0xa0)) {
    return -1;
  }

  /* The first combining char in Unicode is U+0300 */
  if (aCh < 0x0300) {
    return 1;
  }

  auto gc = unicode::GetGeneralCategory(aCh);
  if (gc == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ||
      gc == HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) {
    return 0;
  }

  /* if we arrive here, ucs is not a combining or C0/C1 control character */

  /* fast test for majority of non-wide scripts */
  if (aCh < 0x1100) {
    return 1;
  }

  return intl::UnicodeProperties::IsEastAsianWidthFW(aCh) ? 2 : 1;
}

int32_t GetUnicharStringWidth(Span<const char16_t> aString) {
  int32_t width = 0;
  for (auto iter = aString.begin(); iter != aString.end(); ++iter) {
    char32_t c = *iter;
    if (NS_IS_HIGH_SURROGATE(c) && (iter + 1) != aString.end() &&
        NS_IS_LOW_SURROGATE(*(iter + 1))) {
      c = SURROGATE_TO_UCS4(c, *++iter);
    }
    const int32_t w = GetUnicharWidth(c);
    // Taking 1 as the width of non-printable character, for bug 94475.
    width += (w < 0 ? 1 : w);
  }
  return width;
}

Messung V0.5 in Prozent
C=86 H=97 G=91

¤ Dauer der Verarbeitung: 0.57 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.