aPosition = mStartPos; aRequest = kFragmentAt;
case kFirstFragment: case kLastFragment: case kFragmentAt: aFragment.mStart = mStart; aFragment.mEnd = mEnd; return mStart + aOffset;  case kPrevFragment: case kNextFragment: default: return 0;
nsPromiseSubstring<CharT>::GetReadableFragment( nsReadableFragment<CharT>& aFragment, nsFragmentRequest aRequest, PRUint32 aPosition ) const  {      // Offset any request for a specific position (First, Last, At) by our      //  substrings startpos within the owning string    if ( aRequest == kFirstFragment )      {        aPosition = mStartPos;        aRequest = kFragmentAt;      }    else if ( aRequest == kLastFragment )      {        aPosition = mStartPos + mLength;        aRequest = kFragmentAt;      }    else if ( aRequest == kFragmentAt )      aPosition += mStartPos;    // requests for |kNextFragment| or |kPrevFragment| are just relayed down into the string we're slicing    const CharT* position_ptr = mString.GetReadableFragment(aFragment, aRequest, aPosition);    // If |GetReadableFragment| returns |0|, then we are off the string, the contents of the    //  fragment are garbage.      // Therefore, only need to fix up the fragment boundaries when |position_ptr| is not null    if ( position_ptr )      {          // if there's more physical data in the returned fragment than I logically have left...        size_t logical_size_backward = aPosition - mStartPos;        if ( position_ptr - aFragment.mStart > logical_size_backward )          aFragment.mStart = position_ptr - logical_size_backward;        size_t logical_size_forward = mLength - logical_size_backward;        if ( aFragment.mEnd - position_ptr > logical_size_forward )          aFragment.mEnd = position_ptr + logical_size_forward;      }    return position_ptr;  }