Changeset 44674 in webkit


Ignore:
Timestamp:
Jun 14, 2009 7:39:09 PM (15 years ago)
Author:
Darin Adler
Message:

WebCore:

2009-06-14 Darin Adler <Darin Adler>

Reviewed by Dan Bernstein.

Bug 26364: Search can find text that's hidden by overflow:hidden
https://bugs.webkit.org/show_bug.cgi?id=26364
<rdar://problem/6952081>

Test: fast/text/find-hidden-text.html

  • editing/TextIterator.cpp: (WebCore::BitStack::BitStack): Added. (WebCore::BitStack::push): Added. (WebCore::BitStack::pop): Added. (WebCore::BitStack::top): Added. (WebCore::BitStack::size): Added. (WebCore::parentOrShadowParent): Added. Helper function for walking up the parent node chain, crossing shadow tree boundaries. (WebCore::depthCrossingShadowBoundaries): Added for use in assertions. Counts the depth of a node using the parentOrShadowParent function. (WebCore::fullyClipsContents): Added. Returns true for an element that fully clips its contents, currently defined as a box that has zero width or height and hides overflow. We can add other cases here later. (WebCore::ignoresContainerClip): Added. Returns true for an element that ignores its container clip, currently defined as an element with absolute or fixed positioning. (WebCore::pushFullyClippedState): Added. Pushes a bit on the stack indicating if the node in question fully clips its contents. (WebCore::setUpFullyClippedStack): Added. Pushes a bit for each ancestor of a node. Used when creating an iterator. (WebCore::TextIterator::TextIterator): Removed code to initialize m_inShadowContent. Call setUpFullyClippedStack. (WebCore::TextIterator::advance): Use parentOrShadowParent. Call pop when moving up to a parent node, and also one extra time when moving to a sibling node. Call pushFullyClippedState when moving to a child node, or when moving to a sibling node after the aforementioned call to pop. (WebCore::TextIterator::handleTextNode): Return early if the node is fully clipped. (WebCore::TextIterator::handleReplacedElement): Ditto. (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Call setUpFullyClippedStack. (WebCore::SimplifiedBackwardsTextIterator::advance): Same changes as TextIterator::advance above.
  • editing/TextIterator.h: Added BitStack class and added m_fullyClippedStack to both TextIterator and SimplifiedBackwardsTextIterator. Removed unneeded m_inShadowContent.

LayoutTests:

2009-06-14 Darin Adler <Darin Adler>

Reviewed by Dan Bernstein.

Bug 26364: Search can find text that's hidden by overflow:hidden
https://bugs.webkit.org/show_bug.cgi?id=26364
<rdar://problem/6952081>

  • fast/text/find-hidden-text-expected.txt: Added.
  • fast/text/find-hidden-text.html: Added.
  • fast/block/float/crash-replaced-display-block-expected.txt: Removed a space.
  • fast/dom/Range/acid3-surround-contents-expected.txt: Removed a blank line.
  • fast/dom/object-embed-plugin-scripting-expected.txt: Removed four spaces.
  • fast/parser/badentity-expected.txt: Removed a blank line.
  • http/tests/security/local-video-poster-from-remote-expected.txt: Removed a blank line.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r44671 r44674  
     12009-06-14  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Bug 26364: Search can find text that's hidden by overflow:hidden
     6        https://bugs.webkit.org/show_bug.cgi?id=26364
     7        <rdar://problem/6952081>
     8
     9        * fast/text/find-hidden-text-expected.txt: Added.
     10        * fast/text/find-hidden-text.html: Added.
     11
     12        * fast/block/float/crash-replaced-display-block-expected.txt: Removed a space.
     13        * fast/dom/Range/acid3-surround-contents-expected.txt: Removed a blank line.
     14        * fast/dom/object-embed-plugin-scripting-expected.txt: Removed four spaces.
     15        * fast/parser/badentity-expected.txt: Removed a blank line.
     16        * http/tests/security/local-video-poster-from-remote-expected.txt: Removed a blank line.
     17
    1182009-06-14  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/LayoutTests/fast/block/float/crash-replaced-display-block-expected.txt

    r40431 r44674  
    11This tests rdar://problem/6545095 ASSERTION FAILED: RenderBlock.h:519: !o || o->isRenderBlock()
    22
    3  
     3
  • trunk/LayoutTests/fast/dom/Range/acid3-surround-contents-expected.txt

    r31090 r44674  
    1 
    21The test below should report no failures, and should say PASS at the end.
    32
  • trunk/LayoutTests/fast/dom/object-embed-plugin-scripting-expected.txt

    r11962 r44674  
    1515standalone plugin <embed>: should have a plugin and does
    1616
    17        
     17   
  • trunk/LayoutTests/fast/parser/badentity-expected.txt

    r21687 r44674  
    11Test for bug 13495: REPRODUCIBLE CRASH: Referencing an undefined entity in an XHTML document.
    22
    3 
    43If you don't crash, you pass.
  • trunk/LayoutTests/http/tests/security/local-video-poster-from-remote-expected.txt

    r42533 r44674  
    11CONSOLE MESSAGE: line 0: Not allowed to load local resource: compass.jpg
    22CONSOLE MESSAGE: line 0: Not allowed to load local resource: compass.jpg
    3 
    43Test that a remote video element can not use a local poster
    54
  • trunk/WebCore/ChangeLog

    r44673 r44674  
     12009-06-14  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Bug 26364: Search can find text that's hidden by overflow:hidden
     6        https://bugs.webkit.org/show_bug.cgi?id=26364
     7        <rdar://problem/6952081>
     8
     9        Test: fast/text/find-hidden-text.html
     10
     11        * editing/TextIterator.cpp:
     12        (WebCore::BitStack::BitStack): Added.
     13        (WebCore::BitStack::push): Added.
     14        (WebCore::BitStack::pop): Added.
     15        (WebCore::BitStack::top): Added.
     16        (WebCore::BitStack::size): Added.
     17        (WebCore::parentOrShadowParent): Added. Helper function for walking up
     18        the parent node chain, crossing shadow tree boundaries.
     19        (WebCore::depthCrossingShadowBoundaries): Added for use in assertions.
     20        Counts the depth of a node using the parentOrShadowParent function.
     21        (WebCore::fullyClipsContents): Added. Returns true for an element that
     22        fully clips its contents, currently defined as a box that has zero width
     23        or height and hides overflow. We can add other cases here later.
     24        (WebCore::ignoresContainerClip): Added. Returns true for an element that
     25        ignores its container clip, currently defined as an element with absolute
     26        or fixed positioning.
     27        (WebCore::pushFullyClippedState): Added. Pushes a bit on the stack indicating
     28        if the node in question fully clips its contents.
     29        (WebCore::setUpFullyClippedStack): Added. Pushes a bit for each ancestor of
     30        a node. Used when creating an iterator.
     31        (WebCore::TextIterator::TextIterator): Removed code to initialize
     32        m_inShadowContent. Call setUpFullyClippedStack.
     33        (WebCore::TextIterator::advance): Use parentOrShadowParent. Call pop when moving
     34        up to a parent node, and also one extra time when moving to a sibling node.
     35        Call pushFullyClippedState when moving to a child node, or when moving to a
     36        sibling node after the aforementioned call to pop.
     37        (WebCore::TextIterator::handleTextNode): Return early if the node is fully clipped.
     38        (WebCore::TextIterator::handleReplacedElement): Ditto.
     39        (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
     40        Call setUpFullyClippedStack.
     41        (WebCore::SimplifiedBackwardsTextIterator::advance): Same changes as
     42        TextIterator::advance above.
     43
     44        * editing/TextIterator.h: Added BitStack class and added m_fullyClippedStack to both
     45        TextIterator and SimplifiedBackwardsTextIterator. Removed unneeded m_inShadowContent.
     46
    1472009-06-14  David Hyatt  <hyatt@apple.com>
    248
  • trunk/WebCore/editing/TextIterator.cpp

    r43533 r44674  
    9898// --------
    9999
     100BitStack::BitStack()
     101    : m_size(0)
     102{
     103}
     104
     105void BitStack::push(bool bit)
     106{
     107    unsigned index = m_size / 0x20;
     108    unsigned shift = m_size & 0x1F;
     109    if (!shift && index == m_words.size())
     110        m_words.grow(index + 1);
     111    unsigned& word = m_words[index];
     112    unsigned mask = 1U << shift;
     113    if (bit)
     114        word |= mask;
     115    else
     116        word &= ~mask;
     117    ++m_size;
     118}
     119
     120void BitStack::pop()
     121{
     122    if (m_size)
     123        --m_size;
     124}
     125
     126bool BitStack::top() const
     127{
     128    if (!m_size)
     129        return false;
     130    unsigned shift = (m_size - 1) & 0x1F;
     131    return m_words.last() & (1U << shift);
     132}
     133
     134unsigned BitStack::size() const
     135{
     136    return m_size;
     137}
     138
     139// --------
     140
     141static inline Node* parentOrShadowParent(Node* node)
     142{
     143    if (Node* parent = node->parentNode())
     144        return parent;
     145    return node->shadowParentNode();
     146}
     147
     148#ifndef NDEBUG
     149
     150static unsigned depthCrossingShadowBoundaries(Node* node)
     151{
     152    unsigned depth = 0;
     153    for (Node* parent = parentOrShadowParent(node); parent; parent = parentOrShadowParent(parent))
     154        ++depth;
     155    return depth;
     156}
     157
     158#endif
     159
     160static inline bool fullyClipsContents(Node* node)
     161{
     162    RenderObject* renderer = node->renderer();
     163    if (!renderer || !renderer->isBox())
     164        return false;
     165    RenderStyle* style = renderer->style();
     166    if (style->overflowX() == OVISIBLE && style->overflowY() == OVISIBLE)
     167        return false;
     168    return toRenderBox(renderer)->size().isEmpty();
     169}
     170
     171static inline bool ignoresContainerClip(Node* node)
     172{
     173    RenderObject* renderer = node->renderer();
     174    if (!renderer || renderer->isText())
     175        return false;
     176    EPosition position = renderer->style()->position();
     177    return position == AbsolutePosition || position == FixedPosition;
     178}
     179
     180static void pushFullyClippedState(BitStack& stack, Node* node)
     181{
     182    ASSERT(stack.size() == depthCrossingShadowBoundaries(node));
     183
     184    // Push true if this node full clips its contents, or if a parent already has fully
     185    // clipped and this is not a node that ignores its container's clip.
     186    stack.push(fullyClipsContents(node) || stack.top() && !ignoresContainerClip(node));
     187}
     188
     189static void setUpFullyClippedStack(BitStack& stack, Node* node)
     190{
     191    // Put the nodes in a vector so we can iterate in reverse order.
     192    Vector<Node*, 100> ancestry;
     193    for (Node* parent = parentOrShadowParent(node); parent; parent = parentOrShadowParent(parent))
     194        ancestry.append(parent);
     195
     196    // Call pushFullyClippedState on each node starting with the earliest ancestor.
     197    size_t size = ancestry.size();
     198    for (size_t i = 0; i < size; ++i)
     199        pushFullyClippedState(stack, ancestry[size - i - 1]);
     200    pushFullyClippedState(stack, node);
     201
     202    ASSERT(stack.size() == 1 + depthCrossingShadowBoundaries(node));
     203}
     204
     205// --------
     206
    100207TextIterator::TextIterator()
    101208    : m_startContainer(0)
     
    113220
    114221TextIterator::TextIterator(const Range* r, bool emitCharactersBetweenAllVisiblePositions, bool enterTextControls)
    115     : m_inShadowContent(false)
    116     , m_startContainer(0)
     222    : m_startContainer(0)
    117223    , m_startOffset(0)
    118224    , m_endContainer(0)
     
    145251    m_endOffset = endOffset;
    146252
    147     for (Node* n = startContainer; n; n = n->parentNode()) {
    148         if (n->isShadowNode()) {
    149             m_inShadowContent = true;
    150             break;
    151         }
    152     }
    153 
    154253    // set up the current node for processing
    155254    m_node = r->firstNode();
    156     if (m_node == 0)
     255    if (!m_node)
    157256        return;
     257    setUpFullyClippedStack(m_fullyClippedStack, m_node);
    158258    m_offset = m_node == m_startContainer ? m_startOffset : 0;
    159259    m_handledNode = false;
     
    220320        }
    221321       
    222         RenderObject *renderer = m_node->renderer();
     322        RenderObject* renderer = m_node->renderer();
    223323        if (!renderer) {
    224324            m_handledNode = true;
     
    242342        // find a new current node to handle in depth-first manner,
    243343        // calling exitNode() as we come back thru a parent node
    244         Node *next = m_handledChildren ? 0 : m_node->firstChild();
     344        Node* next = m_handledChildren ? 0 : m_node->firstChild();
    245345        m_offset = 0;
    246346        if (!next) {
     
    248348            if (!next) {
    249349                bool pastEnd = m_node->traverseNextNode() == m_pastEndNode;
    250                 Node* parentNode = m_node->parentNode();
    251                 if (!parentNode && m_inShadowContent) {
    252                     m_inShadowContent = false;
    253                     parentNode = m_node->shadowParentNode();
    254                 }
     350                Node* parentNode = parentOrShadowParent(m_node);
    255351                while (!next && parentNode) {
    256352                    if ((pastEnd && parentNode == m_endContainer) || m_endContainer->isDescendantOf(parentNode))
     
    258354                    bool haveRenderer = m_node->renderer();
    259355                    m_node = parentNode;
    260                     parentNode = m_node->parentNode();
    261                     if (!parentNode && m_inShadowContent) {
    262                         m_inShadowContent = false;
    263                         parentNode = m_node->shadowParentNode();
    264                     }
     356                    m_fullyClippedStack.pop();
     357                    parentNode = parentOrShadowParent(m_node);
    265358                    if (haveRenderer)
    266359                        exitNode();
     
    273366                }
    274367            }
     368            m_fullyClippedStack.pop();           
    275369        }
    276370
    277371        // set the new current node
    278372        m_node = next;
     373        if (m_node)
     374            pushFullyClippedState(m_fullyClippedStack, m_node);
    279375        m_handledNode = false;
    280376        m_handledChildren = false;
     
    286382}
    287383
    288 static inline bool compareBoxStart(const InlineTextBox *first, const InlineTextBox *second)
     384static inline bool compareBoxStart(const InlineTextBox* first, const InlineTextBox* second)
    289385{
    290386    return first->start() < second->start();
     
    293389bool TextIterator::handleTextNode()
    294390{
     391    if (m_fullyClippedStack.top())
     392        return false;
     393
    295394    RenderText* renderer = toRenderText(m_node->renderer());
    296395    if (renderer->style()->visibility() != VISIBLE)
     
    326425    if (renderer->containsReversedText()) {
    327426        m_sortedTextBoxes.clear();
    328         for (InlineTextBox * textBox = renderer->firstTextBox(); textBox; textBox = textBox->nextTextBox()) {
     427        for (InlineTextBox* textBox = renderer->firstTextBox(); textBox; textBox = textBox->nextTextBox()) {
    329428            m_sortedTextBoxes.append(textBox);
    330429        }
     
    340439void TextIterator::handleTextBox()
    341440{   
    342     RenderText *renderer = toRenderText(m_node->renderer());
     441    RenderText* renderer = toRenderText(m_node->renderer());
    343442    String str = renderer->text();
    344443    int start = m_offset;
     
    349448
    350449        // Check for collapsed space at the start of this run.
    351         InlineTextBox *firstTextBox = renderer->containsReversedText() ? m_sortedTextBoxes[0] : renderer->firstTextBox();
     450        InlineTextBox* firstTextBox = renderer->containsReversedText() ? m_sortedTextBoxes[0] : renderer->firstTextBox();
    352451        bool needSpace = m_lastTextNodeEndedWithCollapsedSpace
    353452            || (m_textBox == firstTextBox && textBoxStart == runStart && runStart > 0);
     
    366465       
    367466        // Determine what the next text box will be, but don't advance yet
    368         InlineTextBox *nextTextBox = 0;
     467        InlineTextBox* nextTextBox = 0;
    369468        if (renderer->containsReversedText()) {
    370469            if (m_sortedTextBoxesPosition + 1 < m_sortedTextBoxes.size())
     
    412511bool TextIterator::handleReplacedElement()
    413512{
     513    if (m_fullyClippedStack.top())
     514        return false;
     515
    414516    RenderObject* renderer = m_node->renderer();
    415517    if (renderer->style()->visibility() != VISIBLE)
     
    423525    if (m_enterTextControls && renderer->isTextControl()) {
    424526        m_node = toRenderTextControl(renderer)->innerTextElement();
     527        pushFullyClippedState(m_fullyClippedStack, m_node);
    425528        m_offset = 0;
    426         m_inShadowContent = true;
    427529        return false;
    428530    }
     
    699801}
    700802
    701 void TextIterator::emitCharacter(UChar c, Node *textNode, Node *offsetBaseNode, int textStartOffset, int textEndOffset)
     803void TextIterator::emitCharacter(UChar c, Node* textNode, Node* offsetBaseNode, int textStartOffset, int textEndOffset)
    702804{
    703805    m_haveEmitted = true;
     
    779881}
    780882
    781 SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator(const Range *r)
     883SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator(const Range* r)
    782884{
    783885    m_positionNode = 0;
     
    807909
    808910    m_node = endNode;
     911    setUpFullyClippedStack(m_fullyClippedStack, m_node);   
    809912    m_offset = endOffset;
    810913    m_handledNode = false;
     
    846949        // Don't handle node if we start iterating at [node, 0].
    847950        if (!m_handledNode && !(m_node == m_endNode && m_endOffset == 0)) {
    848             RenderObject *renderer = m_node->renderer();
     951            RenderObject* renderer = m_node->renderer();
    849952            if (renderer && renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) {
    850953                // FIXME: What about CDATA_SECTION_NODE?
     
    878981            next = m_node->previousSibling();
    879982            while (!next) {
    880                 if (!m_node->parentNode())
     983                Node* parentNode = parentOrShadowParent(m_node);
     984                if (!parentNode)
    881985                    break;
    882                 m_node = m_node->parentNode();
     986                m_node = parentNode;
     987                m_fullyClippedStack.pop();
    883988                exitNode();
    884989                if (m_positionNode) {
     
    889994                next = m_node->previousSibling();
    890995            }
     996            m_fullyClippedStack.pop();
    891997        }
    892998       
    893999        m_node = next;
     1000        if (m_node)
     1001            pushFullyClippedState(m_fullyClippedStack, m_node);
    8941002        m_offset = m_node ? caretMaxOffset(m_node) : 0;
    8951003        m_handledNode = false;
     
    9051013    m_lastTextNode = m_node;
    9061014
    907     RenderText *renderer = toRenderText(m_node->renderer());
     1015    RenderText* renderer = toRenderText(m_node->renderer());
    9081016    String str = renderer->text();
    9091017
     
    9611069}
    9621070
    963 void SimplifiedBackwardsTextIterator::emitCharacter(UChar c, Node *node, int startOffset, int endOffset)
     1071void SimplifiedBackwardsTextIterator::emitCharacter(UChar c, Node* node, int startOffset, int endOffset)
    9641072{
    9651073    m_singleCharacterBuffer = c;
     
    9891097}
    9901098
    991 CharacterIterator::CharacterIterator(const Range *r, bool emitCharactersBetweenAllVisiblePositions, bool enterTextControls)
     1099CharacterIterator::CharacterIterator(const Range* r, bool emitCharactersBetweenAllVisiblePositions, bool enterTextControls)
    9921100    : m_offset(0)
    9931101    , m_runOffset(0)
     
    11681276
    11691277WordAwareIterator::WordAwareIterator()
    1170 : m_previousText(0), m_didLookAhead(false)
    1171 {
    1172 }
    1173 
    1174 WordAwareIterator::WordAwareIterator(const Range *r)
    1175 : m_previousText(0), m_didLookAhead(false), m_textIterator(r)
    1176 {
    1177     m_didLookAhead = true;  // so we consider the first chunk from the text iterator
    1178     advance();              // get in position over the first chunk of text
     1278    : m_previousText(0)
     1279    , m_didLookAhead(false)
     1280{
     1281}
     1282
     1283WordAwareIterator::WordAwareIterator(const Range* r)
     1284    : m_previousText(0)
     1285    , m_didLookAhead(true) // so we consider the first chunk from the text iterator
     1286    , m_textIterator(r)
     1287{
     1288    advance(); // get in position over the first chunk of text
    11791289}
    11801290
     
    11861296// - We built up our own chunk of text from many chunks from the text iterator
    11871297
    1188 // FIXME: Perf could be bad for huge spans next to each other that don't fall on word boundaries
     1298// FIXME: Performance could be bad for huge spans next to each other that don't fall on word boundaries.
    11891299
    11901300void WordAwareIterator::advance()
     
    15081618// --------
    15091619
    1510 int TextIterator::rangeLength(const Range *r, bool forSelectionPreservation)
     1620int TextIterator::rangeLength(const Range* r, bool forSelectionPreservation)
    15111621{
    15121622    int length = 0;
     
    15231633}
    15241634
    1525 PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element *scope, int rangeLocation, int rangeLength, bool forSelectionPreservation)
     1635PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element* scope, int rangeLocation, int rangeLength, bool forSelectionPreservation)
    15261636{
    15271637    RefPtr<Range> resultRange = scope->document()->createRange();
  • trunk/WebCore/editing/TextIterator.h

    r41607 r44674  
    11/*
    2  * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5050PassRefPtr<Range> findPlainText(const Range*, const String&, bool forward, bool caseSensitive);
    5151
     52class BitStack {
     53public:
     54    BitStack();
     55
     56    void push(bool);
     57    void pop();
     58
     59    bool top() const;
     60    unsigned size() const;
     61
     62private:
     63    unsigned m_size;
     64    Vector<unsigned, 1> m_words;
     65};
     66
    5267// Iterates through the DOM range, returning all the text, and 0-length boundaries
    5368// at points where replaced elements break up the text flow.  The text comes back in
     
    8196    bool handleNonTextNode();
    8297    void handleTextBox();
    83     void emitCharacter(UChar, Node *textNode, Node *offsetBaseNode, int textStartOffset, int textEndOffset);
    84     void emitText(Node *textNode, int textStartOffset, int textEndOffset);
     98    void emitCharacter(UChar, Node* textNode, Node* offsetBaseNode, int textStartOffset, int textEndOffset);
     99    void emitText(Node* textNode, int textStartOffset, int textEndOffset);
    85100   
    86101    // Current position, not necessarily of the text being returned, but position
    87102    // as we walk through the DOM tree.
    88     Node *m_node;
     103    Node* m_node;
    89104    int m_offset;
    90105    bool m_handledNode;
    91106    bool m_handledChildren;
    92     bool m_inShadowContent;
     107    BitStack m_fullyClippedStack;
    93108   
    94109    // The range.
    95     Node *m_startContainer;
     110    Node* m_startContainer;
    96111    int m_startOffset;
    97     Node *m_endContainer;
     112    Node* m_endContainer;
    98113    int m_endOffset;
    99     Node *m_pastEndNode;
     114    Node* m_pastEndNode;
    100115   
    101116    // The current text and its position, in the form to be returned from the iterator.
    102     Node *m_positionNode;
    103     mutable Node *m_positionOffsetBaseNode;
     117    Node* m_positionNode;
     118    mutable Node* m_positionOffsetBaseNode;
    104119    mutable int m_positionStartOffset;
    105120    mutable int m_positionEndOffset;
     
    110125    // are false and 0, we go back to normal iterating.
    111126    bool m_needAnotherNewline;
    112     InlineTextBox *m_textBox;
     127    InlineTextBox* m_textBox;
    113128   
    114129    // Used to do the whitespace collapsing logic.
    115     Node *m_lastTextNode;   
     130    Node* m_lastTextNode;   
    116131    bool m_lastTextNodeEndedWithCollapsedSpace;
    117132    UChar m_lastCharacter;
     
    136151
    137152// Iterates through the DOM range, returning all the text, and 0-length boundaries
    138 // at points where replaced elements break up the text flow.  The text comes back in
     153// at points where replaced elements break up the text flow. The text comes back in
    139154// chunks so as to optimize for performance of the iteration.
    140155class SimplifiedBackwardsTextIterator {
    141156public:
    142157    SimplifiedBackwardsTextIterator();
    143     explicit SimplifiedBackwardsTextIterator(const Range *);
     158    explicit SimplifiedBackwardsTextIterator(const Range*);
    144159   
    145160    bool atEnd() const { return !m_positionNode; }
     
    156171    bool handleReplacedElement();
    157172    bool handleNonTextNode();
    158     void emitCharacter(UChar, Node *Node, int startOffset, int endOffset);
     173    void emitCharacter(UChar, Node*, int startOffset, int endOffset);
    159174   
    160175    // Current position, not necessarily of the text being returned, but position
     
    164179    bool m_handledNode;
    165180    bool m_handledChildren;
    166    
     181    BitStack m_fullyClippedStack;
     182
    167183    // End of the range.
    168184    Node* m_startNode;
     
    195211public:
    196212    CharacterIterator();
    197     explicit CharacterIterator(const Range* r, bool emitCharactersBetweenAllVisiblePositions = false, bool enterTextControls = false);
     213    explicit CharacterIterator(const Range*, bool emitCharactersBetweenAllVisiblePositions = false, bool enterTextControls = false);
    198214   
    199215    void advance(int numCharacters);
     
    241257public:
    242258    WordAwareIterator();
    243     explicit WordAwareIterator(const Range *r);
     259    explicit WordAwareIterator(const Range*);
    244260
    245261    bool atEnd() const { return !m_didLookAhead && m_textIterator.atEnd(); }
Note: See TracChangeset for help on using the changeset viewer.