2007-01-16 23:51:52 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/. */
|
2007-01-16 23:51:52 +03:00
|
|
|
|
|
|
|
#include "nsTextFrameUtils.h"
|
|
|
|
|
2007-07-03 03:36:59 +04:00
|
|
|
#include "nsBidiUtils.h"
|
2016-10-25 17:35:02 +03:00
|
|
|
#include "nsCharTraits.h"
|
2012-04-17 02:32:12 +04:00
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsStyleStruct.h"
|
2013-08-22 22:32:52 +04:00
|
|
|
#include "nsTextFragment.h"
|
2016-10-25 17:35:02 +03:00
|
|
|
#include "nsUnicharUtils.h"
|
2013-01-15 16:22:03 +04:00
|
|
|
#include <algorithm>
|
2007-01-16 23:51:52 +03:00
|
|
|
|
2016-12-01 01:47:45 +03:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2017-01-12 04:27:01 +03:00
|
|
|
static bool
|
|
|
|
IsDiscardable(char16_t ch, uint32_t* aFlags)
|
2007-01-16 23:51:52 +03:00
|
|
|
{
|
|
|
|
// Unlike IS_DISCARDABLE, we don't discard \r. \r will be ignored by gfxTextRun
|
|
|
|
// and discarding it would force us to copy text in many cases of preformatted
|
|
|
|
// text containing \r\n.
|
|
|
|
if (ch == CH_SHY) {
|
|
|
|
*aFlags |= nsTextFrameUtils::TEXT_HAS_SHY;
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2013-10-02 17:07:02 +04:00
|
|
|
return IsBidiControl(ch);
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
|
|
|
|
2017-01-12 04:27:01 +03:00
|
|
|
static bool
|
|
|
|
IsDiscardable(uint8_t ch, uint32_t* aFlags)
|
2007-01-16 23:51:52 +03:00
|
|
|
{
|
|
|
|
if (ch == CH_SHY) {
|
|
|
|
*aFlags |= nsTextFrameUtils::TEXT_HAS_SHY;
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
|
|
|
|
2017-01-12 04:27:01 +03:00
|
|
|
static bool
|
|
|
|
IsSegmentBreak(char16_t aCh)
|
|
|
|
{
|
|
|
|
return aCh == '\n' || aCh == '\r';
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
IsSpaceOrTab(char16_t aCh)
|
|
|
|
{
|
|
|
|
return aCh == ' ' || aCh == '\t';
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
IsSpaceOrTabOrSegmentBreak(char16_t aCh)
|
|
|
|
{
|
|
|
|
return IsSpaceOrTab(aCh) || IsSegmentBreak(aCh);
|
|
|
|
}
|
|
|
|
|
2017-01-12 04:27:02 +03:00
|
|
|
template<class CharT>
|
|
|
|
static CharT*
|
|
|
|
TransformWhiteSpaces(const CharT* aText, uint32_t aLength,
|
2017-01-12 04:27:01 +03:00
|
|
|
uint32_t aBegin, uint32_t aEnd,
|
|
|
|
bool aHasSegmentBreak,
|
|
|
|
bool& aInWhitespace,
|
2017-01-12 04:27:02 +03:00
|
|
|
CharT* aOutput,
|
2017-01-12 04:27:01 +03:00
|
|
|
uint32_t& aFlags,
|
|
|
|
nsTextFrameUtils::CompressionMode aCompression,
|
|
|
|
gfxSkipChars* aSkipChars)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aCompression == nsTextFrameUtils::COMPRESS_WHITESPACE ||
|
|
|
|
aCompression == nsTextFrameUtils::COMPRESS_WHITESPACE_NEWLINE,
|
|
|
|
"whitespaces should be skippable!!");
|
|
|
|
// Get the context preceding/following this white space range.
|
2017-01-12 04:27:02 +03:00
|
|
|
// For 8-bit text (sizeof CharT == 1), the checks here should get optimized
|
|
|
|
// out, and isSegmentBreakSkippable should be initialized to be 'false'.
|
2017-01-12 04:27:01 +03:00
|
|
|
bool isSegmentBreakSkippable =
|
2017-01-12 04:27:02 +03:00
|
|
|
sizeof(CharT) > 1 &&
|
|
|
|
((aBegin > 0 && IS_ZERO_WIDTH_SPACE(aText[aBegin - 1])) ||
|
|
|
|
(aEnd < aLength && IS_ZERO_WIDTH_SPACE(aText[aEnd])));
|
|
|
|
if (sizeof(CharT) > 1 && !isSegmentBreakSkippable &&
|
|
|
|
aBegin > 0 && aEnd < aLength) {
|
2017-01-12 04:27:01 +03:00
|
|
|
uint32_t ucs4before;
|
|
|
|
uint32_t ucs4after;
|
|
|
|
if (aBegin > 1 &&
|
|
|
|
NS_IS_LOW_SURROGATE(aText[aBegin - 1]) &&
|
|
|
|
NS_IS_HIGH_SURROGATE(aText[aBegin - 2])) {
|
|
|
|
ucs4before = SURROGATE_TO_UCS4(aText[aBegin - 2], aText[aBegin - 1]);
|
|
|
|
} else {
|
|
|
|
ucs4before = aText[aBegin - 1];
|
|
|
|
}
|
|
|
|
if (aEnd + 1 < aLength &&
|
|
|
|
NS_IS_HIGH_SURROGATE(aText[aEnd]) &&
|
|
|
|
NS_IS_LOW_SURROGATE(aText[aEnd + 1])) {
|
|
|
|
ucs4after = SURROGATE_TO_UCS4(aText[aEnd], aText[aEnd + 1]);
|
|
|
|
} else {
|
|
|
|
ucs4after = aText[aEnd];
|
|
|
|
}
|
|
|
|
// Discard newlines between characters that have F, W, or H
|
|
|
|
// EastAsianWidth property and neither side is Hangul.
|
|
|
|
isSegmentBreakSkippable = IsSegmentBreakSkipChar(ucs4before) &&
|
|
|
|
IsSegmentBreakSkipChar(ucs4after);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (uint32_t i = aBegin; i < aEnd; ++i) {
|
2017-01-12 04:27:02 +03:00
|
|
|
CharT ch = aText[i];
|
2017-01-12 04:27:01 +03:00
|
|
|
bool keepChar = false;
|
|
|
|
bool keepTransformedWhiteSpace = false;
|
|
|
|
if (IsDiscardable(ch, &aFlags)) {
|
|
|
|
aSkipChars->SkipChar();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (IsSpaceOrTab(ch)) {
|
|
|
|
if (aHasSegmentBreak) {
|
|
|
|
// If white-space is set to normal, nowrap, or pre-line, white space
|
|
|
|
// characters are considered collapsible and all spaces and tabs
|
|
|
|
// immediately preceding or following a segment break are removed.
|
|
|
|
aSkipChars->SkipChar();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aInWhitespace) {
|
|
|
|
aSkipChars->SkipChar();
|
|
|
|
continue;
|
|
|
|
} else {
|
|
|
|
keepTransformedWhiteSpace = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Apply Segment Break Transformation Rules (CSS Text 3 - 4.1.2) for
|
|
|
|
// segment break characters.
|
|
|
|
if (aCompression == nsTextFrameUtils::COMPRESS_WHITESPACE ||
|
|
|
|
// XXX: According to CSS Text 3, a lone CR should not always be
|
|
|
|
// kept, but still go through the Segment Break Transformation
|
|
|
|
// Rules. However, this is what current modern browser engines
|
|
|
|
// (webkit/blink/edge) do. So, once we can get some clarity
|
|
|
|
// from the specification issue, we should either remove the
|
|
|
|
// lone CR condition here, or leave it here with this comment
|
|
|
|
// being rephrased.
|
|
|
|
// Please see https://github.com/w3c/csswg-drafts/issues/855.
|
|
|
|
ch == '\r') {
|
|
|
|
keepChar = true;
|
|
|
|
} else {
|
|
|
|
// aCompression == COMPRESS_WHITESPACE_NEWLINE
|
|
|
|
|
|
|
|
// Any collapsible segment break immediately following another
|
|
|
|
// collapsible segment break is removed. Then the remaining segment
|
|
|
|
// break is either transformed into a space (U+0020) or removed
|
|
|
|
// depending on the context before and after the break.
|
|
|
|
if (isSegmentBreakSkippable || aInWhitespace) {
|
|
|
|
aSkipChars->SkipChar();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
isSegmentBreakSkippable = true;
|
|
|
|
keepTransformedWhiteSpace = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (keepChar) {
|
|
|
|
*aOutput++ = ch;
|
|
|
|
aSkipChars->KeepChar();
|
|
|
|
aInWhitespace = IsSpaceOrTab(ch);
|
|
|
|
} else if (keepTransformedWhiteSpace) {
|
|
|
|
if (ch != ' ') {
|
|
|
|
aFlags |= nsTextFrameUtils::TEXT_WAS_TRANSFORMED;
|
|
|
|
}
|
|
|
|
*aOutput++ = ' ';
|
|
|
|
aSkipChars->KeepChar();
|
|
|
|
aInWhitespace = true;
|
|
|
|
} else {
|
|
|
|
MOZ_ASSERT_UNREACHABLE("Should've skipped the character!!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return aOutput;
|
|
|
|
}
|
|
|
|
|
2017-01-12 04:27:02 +03:00
|
|
|
template<class CharT>
|
|
|
|
CharT*
|
|
|
|
nsTextFrameUtils::TransformText(const CharT* aText, uint32_t aLength,
|
|
|
|
CharT* aOutput,
|
2008-08-12 12:31:56 +04:00
|
|
|
CompressionMode aCompression,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t* aIncomingFlags,
|
2014-01-10 13:42:05 +04:00
|
|
|
gfxSkipChars* aSkipChars,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t* aAnalysisFlags)
|
2007-01-16 23:51:52 +03:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t flags = 0;
|
2017-01-12 04:27:02 +03:00
|
|
|
CharT* outputStart = aOutput;
|
2007-01-16 23:51:52 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool lastCharArabic = false;
|
2012-09-07 09:42:19 +04:00
|
|
|
if (aCompression == COMPRESS_NONE ||
|
2014-06-05 07:25:15 +04:00
|
|
|
aCompression == COMPRESS_NONE_TRANSFORM_TO_SPACE) {
|
2007-05-23 03:45:47 +04:00
|
|
|
// Skip discardables.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t i;
|
2007-01-16 23:51:52 +03:00
|
|
|
for (i = 0; i < aLength; ++i) {
|
2017-01-12 04:27:02 +03:00
|
|
|
CharT ch = aText[i];
|
2014-06-05 07:25:15 +04:00
|
|
|
if (IsDiscardable(ch, &flags)) {
|
2007-01-16 23:51:52 +03:00
|
|
|
aSkipChars->SkipChar();
|
|
|
|
} else {
|
|
|
|
aSkipChars->KeepChar();
|
2012-06-20 23:58:19 +04:00
|
|
|
if (ch > ' ') {
|
2008-12-18 23:12:53 +03:00
|
|
|
lastCharArabic = IS_ARABIC_CHAR(ch);
|
2014-06-05 07:25:15 +04:00
|
|
|
} else if (aCompression == COMPRESS_NONE_TRANSFORM_TO_SPACE) {
|
|
|
|
if (ch == '\t' || ch == '\n') {
|
|
|
|
ch = ' ';
|
|
|
|
flags |= TEXT_WAS_TRANSFORMED;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// aCompression == COMPRESS_NONE
|
|
|
|
if (ch == '\t') {
|
|
|
|
flags |= TEXT_HAS_TAB;
|
|
|
|
}
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
|
|
|
*aOutput++ = ch;
|
|
|
|
}
|
|
|
|
}
|
2008-12-18 23:12:53 +03:00
|
|
|
if (lastCharArabic) {
|
|
|
|
*aIncomingFlags |= INCOMING_ARABICCHAR;
|
|
|
|
} else {
|
|
|
|
*aIncomingFlags &= ~INCOMING_ARABICCHAR;
|
|
|
|
}
|
|
|
|
*aIncomingFlags &= ~INCOMING_WHITESPACE;
|
2007-01-16 23:51:52 +03:00
|
|
|
} else {
|
2011-09-29 10:19:26 +04:00
|
|
|
bool inWhitespace = (*aIncomingFlags & INCOMING_WHITESPACE) != 0;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t i;
|
2007-01-16 23:51:52 +03:00
|
|
|
for (i = 0; i < aLength; ++i) {
|
2017-01-12 04:27:02 +03:00
|
|
|
CharT ch = aText[i];
|
2017-01-12 04:27:01 +03:00
|
|
|
// CSS Text 3 - 4.1. The White Space Processing Rules
|
|
|
|
// White space processing in CSS affects only the document white space
|
|
|
|
// characters: spaces (U+0020), tabs (U+0009), and segment breaks.
|
|
|
|
// Since we need the context of segment breaks and their surrounding
|
|
|
|
// white spaces to proceed the white space processing, a consecutive run
|
|
|
|
// of spaces/tabs/segment breaks is collected in a first pass loop, then
|
|
|
|
// we apply the collapsing and transformation rules to this run in a
|
|
|
|
// second pass loop.
|
|
|
|
if (IsSpaceOrTabOrSegmentBreak(ch)) {
|
|
|
|
bool keepLastSpace = false;
|
|
|
|
bool hasSegmentBreak = IsSegmentBreak(ch);
|
|
|
|
uint32_t countTrailingDiscardables = 0;
|
|
|
|
uint32_t j;
|
|
|
|
for (j = i + 1; j < aLength &&
|
|
|
|
(IsSpaceOrTabOrSegmentBreak(aText[j]) ||
|
|
|
|
IsDiscardable(aText[j], &flags));
|
|
|
|
j++) {
|
|
|
|
if (IsSegmentBreak(aText[j])) {
|
|
|
|
hasSegmentBreak = true;
|
|
|
|
}
|
2016-10-25 17:35:02 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
// Exclude trailing discardables before checking space combining
|
|
|
|
// sequence tail.
|
|
|
|
for (; IsDiscardable(aText[j - 1], &flags); j--) {
|
|
|
|
countTrailingDiscardables++;
|
2016-10-25 17:35:02 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
// If the last white space is followed by a combining sequence tail,
|
|
|
|
// exclude it from the range of TransformWhiteSpaces.
|
2017-01-12 04:27:02 +03:00
|
|
|
if (sizeof(CharT) > 1 && aText[j - 1] == ' ' && j < aLength &&
|
2017-01-12 04:27:01 +03:00
|
|
|
IsSpaceCombiningSequenceTail(&aText[j], aLength - j)) {
|
|
|
|
keepLastSpace = true;
|
|
|
|
j--;
|
2016-10-25 17:35:02 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
if (j > i) {
|
|
|
|
aOutput = TransformWhiteSpaces(aText, aLength, i, j, hasSegmentBreak,
|
|
|
|
inWhitespace, aOutput, flags,
|
|
|
|
aCompression, aSkipChars);
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
// We need to keep KeepChar()/SkipChar() in order, so process the
|
|
|
|
// last white space first, then process the trailing discardables.
|
|
|
|
if (keepLastSpace) {
|
|
|
|
keepLastSpace = false;
|
|
|
|
*aOutput++ = ' ';
|
2007-01-16 23:51:52 +03:00
|
|
|
aSkipChars->KeepChar();
|
2017-01-12 04:27:01 +03:00
|
|
|
lastCharArabic = false;
|
|
|
|
j++;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
for (; countTrailingDiscardables > 0; countTrailingDiscardables--) {
|
2007-01-16 23:51:52 +03:00
|
|
|
aSkipChars->SkipChar();
|
2017-01-12 04:27:01 +03:00
|
|
|
j++;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
i = j - 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// Process characters other than the document white space characters.
|
|
|
|
if (IsDiscardable(ch, &flags)) {
|
|
|
|
aSkipChars->SkipChar();
|
|
|
|
} else {
|
|
|
|
*aOutput++ = ch;
|
|
|
|
aSkipChars->KeepChar();
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
lastCharArabic = IS_ARABIC_CHAR(ch);
|
|
|
|
inWhitespace = false;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
2017-01-12 04:27:01 +03:00
|
|
|
|
2008-12-18 23:12:53 +03:00
|
|
|
if (lastCharArabic) {
|
|
|
|
*aIncomingFlags |= INCOMING_ARABICCHAR;
|
|
|
|
} else {
|
|
|
|
*aIncomingFlags &= ~INCOMING_ARABICCHAR;
|
|
|
|
}
|
|
|
|
if (inWhitespace) {
|
|
|
|
*aIncomingFlags |= INCOMING_WHITESPACE;
|
|
|
|
} else {
|
|
|
|
*aIncomingFlags &= ~INCOMING_WHITESPACE;
|
|
|
|
}
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (outputStart + aLength != aOutput) {
|
|
|
|
flags |= TEXT_WAS_TRANSFORMED;
|
|
|
|
}
|
|
|
|
*aAnalysisFlags = flags;
|
|
|
|
return aOutput;
|
|
|
|
}
|
2017-01-12 04:27:02 +03:00
|
|
|
/*
|
|
|
|
* NOTE: This template is part of public API of nsTextFrameUtils, while
|
|
|
|
* its function body is not available in the header. It may stop working
|
|
|
|
* (fail to resolve symbol in link time) once its callsites are moved to a
|
|
|
|
* different translation unit (e.g. a different unified source file).
|
|
|
|
* Explicit instantiating this function template with `uint8_t` and `char16_t`
|
|
|
|
* could prevent us from the potential risk.
|
|
|
|
*/
|
|
|
|
template uint8_t*
|
2012-08-22 19:56:38 +04:00
|
|
|
nsTextFrameUtils::TransformText(const uint8_t* aText, uint32_t aLength,
|
|
|
|
uint8_t* aOutput,
|
2008-08-12 12:31:56 +04:00
|
|
|
CompressionMode aCompression,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t* aIncomingFlags,
|
2014-01-10 13:42:05 +04:00
|
|
|
gfxSkipChars* aSkipChars,
|
2017-01-12 04:27:02 +03:00
|
|
|
uint32_t* aAnalysisFlags);
|
|
|
|
template char16_t*
|
|
|
|
nsTextFrameUtils::TransformText(const char16_t* aText, uint32_t aLength,
|
|
|
|
char16_t* aOutput,
|
|
|
|
CompressionMode aCompression,
|
|
|
|
uint8_t* aIncomingFlags,
|
|
|
|
gfxSkipChars* aSkipChars,
|
|
|
|
uint32_t* aAnalysisFlags);
|
2007-01-16 23:51:52 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t
|
2012-04-17 02:32:12 +04:00
|
|
|
nsTextFrameUtils::ComputeApproximateLengthWithWhitespaceCompression(
|
|
|
|
nsIContent *aContent, const nsStyleText *aStyleText)
|
|
|
|
{
|
|
|
|
const nsTextFragment *frag = aContent->GetText();
|
|
|
|
// This is an approximation so we don't really need anything
|
|
|
|
// too fancy here.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t len;
|
2012-04-17 02:32:12 +04:00
|
|
|
if (aStyleText->WhiteSpaceIsSignificant()) {
|
|
|
|
len = frag->GetLength();
|
|
|
|
} else {
|
|
|
|
bool is2b = frag->Is2b();
|
|
|
|
union {
|
|
|
|
const char *s1b;
|
2014-01-04 19:02:17 +04:00
|
|
|
const char16_t *s2b;
|
2012-04-17 02:32:12 +04:00
|
|
|
} u;
|
|
|
|
if (is2b) {
|
|
|
|
u.s2b = frag->Get2b();
|
|
|
|
} else {
|
|
|
|
u.s1b = frag->Get1b();
|
|
|
|
}
|
|
|
|
bool prevWS = true; // more important to ignore blocks with
|
|
|
|
// only whitespace than get inline boundaries
|
|
|
|
// exactly right
|
|
|
|
len = 0;
|
2012-08-22 19:56:38 +04:00
|
|
|
for (uint32_t i = 0, i_end = frag->GetLength(); i < i_end; ++i) {
|
2014-01-04 19:02:17 +04:00
|
|
|
char16_t c = is2b ? u.s2b[i] : u.s1b[i];
|
2012-04-17 02:32:12 +04:00
|
|
|
if (c == ' ' || c == '\n' || c == '\t' || c == '\r') {
|
|
|
|
if (!prevWS) {
|
|
|
|
++len;
|
|
|
|
}
|
|
|
|
prevWS = true;
|
|
|
|
} else {
|
|
|
|
++len;
|
|
|
|
prevWS = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool nsSkipCharsRunIterator::NextRun() {
|
2007-01-16 23:51:52 +03:00
|
|
|
do {
|
|
|
|
if (mRunLength) {
|
|
|
|
mIterator.AdvanceOriginal(mRunLength);
|
|
|
|
NS_ASSERTION(mRunLength > 0, "No characters in run (initial length too large?)");
|
|
|
|
if (!mSkipped || mLengthIncludesSkipped) {
|
|
|
|
mRemainingLength -= mRunLength;
|
|
|
|
}
|
|
|
|
}
|
2007-03-23 02:13:12 +03:00
|
|
|
if (!mRemainingLength)
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t length;
|
2007-01-16 23:51:52 +03:00
|
|
|
mSkipped = mIterator.IsOriginalCharSkipped(&length);
|
2013-01-15 16:22:03 +04:00
|
|
|
mRunLength = std::min(length, mRemainingLength);
|
2007-01-16 23:51:52 +03:00
|
|
|
} while (!mVisitSkipped && mSkipped);
|
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2007-01-16 23:51:52 +03:00
|
|
|
}
|