Changeset 86704 in webkit


Ignore:
Timestamp:
May 17, 2011 1:39:18 PM (13 years ago)
Author:
atwilson@chromium.org
Message:

2011-05-17 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r86647.
http://trac.webkit.org/changeset/86647
https://bugs.webkit.org/show_bug.cgi?id=56814

Broke tests downstream in Chromium

  • dom/DocumentMarker.h: (WebCore::DocumentMarker::operator==): (WebCore::DocumentMarker::operator!=):
  • dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::copyMarkers): (WebCore::DocumentMarkerController::removeMarkers): (WebCore::DocumentMarkerController::markerContainingPoint): (WebCore::DocumentMarkerController::markersInRange): (WebCore::DocumentMarkerController::renderedRectsForMarkers): (WebCore::DocumentMarkerController::removeMarkersFromList): (WebCore::DocumentMarkerController::repaintMarkers): (WebCore::DocumentMarkerController::shiftMarkers): (WebCore::DocumentMarkerController::setMarkersActive): (WebCore::DocumentMarkerController::hasMarkers): (WebCore::DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange): (WebCore::DocumentMarkerController::showMarkers):
  • dom/DocumentMarkerController.h:
  • editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
  • editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
  • editing/Editor.cpp: (WebCore::Editor::selectionStartHasMarkerFor):
  • editing/SpellingCorrectionController.cpp: (WebCore::SpellingCorrectionController::respondToChangedSelection):
  • editing/SpellingCorrectionController.h: (WebCore::SpellingCorrectionController::shouldStartTimerFor):
  • rendering/HitTestResult.cpp: (WebCore::HitTestResult::spellingToolTip): (WebCore::HitTestResult::replacedString):
  • rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintSpellingOrGrammarMarker): (WebCore::InlineTextBox::paintTextMatchMarker): (WebCore::InlineTextBox::computeRectForReplacementMarker): (WebCore::InlineTextBox::paintDocumentMarkers):
  • rendering/svg/SVGInlineFlowBox.cpp: (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):

2011-05-17 Andrew Wilson <atwilson@chromium.org>

Unreviewed, rolling out r86647.
http://trac.webkit.org/changeset/86647
https://bugs.webkit.org/show_bug.cgi?id=56814

Broke tests downstream in Chromium

  • src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::addMarker):
Location:
trunk/Source
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86703 r86704  
     12011-05-17  Andrew Wilson  <atwilson@chromium.org>
     2
     3        Unreviewed, rolling out r86647.
     4        http://trac.webkit.org/changeset/86647
     5        https://bugs.webkit.org/show_bug.cgi?id=56814
     6
     7        Broke tests downstream in Chromium
     8
     9        * dom/DocumentMarker.h:
     10        (WebCore::DocumentMarker::operator==):
     11        (WebCore::DocumentMarker::operator!=):
     12        * dom/DocumentMarkerController.cpp:
     13        (WebCore::DocumentMarkerController::addMarker):
     14        (WebCore::DocumentMarkerController::copyMarkers):
     15        (WebCore::DocumentMarkerController::removeMarkers):
     16        (WebCore::DocumentMarkerController::markerContainingPoint):
     17        (WebCore::DocumentMarkerController::markersInRange):
     18        (WebCore::DocumentMarkerController::renderedRectsForMarkers):
     19        (WebCore::DocumentMarkerController::removeMarkersFromList):
     20        (WebCore::DocumentMarkerController::repaintMarkers):
     21        (WebCore::DocumentMarkerController::shiftMarkers):
     22        (WebCore::DocumentMarkerController::setMarkersActive):
     23        (WebCore::DocumentMarkerController::hasMarkers):
     24        (WebCore::DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
     25        (WebCore::DocumentMarkerController::showMarkers):
     26        * dom/DocumentMarkerController.h:
     27        * editing/CompositeEditCommand.cpp:
     28        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
     29        * editing/DeleteSelectionCommand.cpp:
     30        (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
     31        * editing/Editor.cpp:
     32        (WebCore::Editor::selectionStartHasMarkerFor):
     33        * editing/SpellingCorrectionController.cpp:
     34        (WebCore::SpellingCorrectionController::respondToChangedSelection):
     35        * editing/SpellingCorrectionController.h:
     36        (WebCore::SpellingCorrectionController::shouldStartTimerFor):
     37        * rendering/HitTestResult.cpp:
     38        (WebCore::HitTestResult::spellingToolTip):
     39        (WebCore::HitTestResult::replacedString):
     40        * rendering/InlineTextBox.cpp:
     41        (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
     42        (WebCore::InlineTextBox::paintTextMatchMarker):
     43        (WebCore::InlineTextBox::computeRectForReplacementMarker):
     44        (WebCore::InlineTextBox::paintDocumentMarkers):
     45        * rendering/svg/SVGInlineFlowBox.cpp:
     46        (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
     47
    1482011-05-17  Andrew Wilson  <atwilson@chromium.org>
    249
  • trunk/Source/WebCore/dom/DocumentMarker.h

    r86647 r86704  
    8585        }
    8686    };
    87 
    88 
    89     DocumentMarker();
    90     DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset);
    91     DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, const String& description);
    92     DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch);
    93 
    94     MarkerType type() const { return m_type; }
    95     unsigned startOffset() const { return m_startOffset; }
    96     unsigned endOffset() const { return m_endOffset; }
    97     const String& description() const { return m_description; }
    98     bool hasDescription() const { return !m_description.isEmpty(); }
    99     bool activeMatch() const { return m_activeMatch; }
    100 
    101     void setActiveMatch(bool);
    102     void clearDescription() { m_description = String(); }
    103 
    104     // Offset modifications are done by DocumentMarkerController.
    105     // Other classes should not call following setters.
    106     void setStartOffset(unsigned offset) { m_startOffset = offset; }
    107     void setEndOffset(unsigned offset) { m_endOffset = offset; }
    108     void shiftOffsets(int delta);
     87   
     88    MarkerType type;
     89    unsigned startOffset;
     90    unsigned endOffset;
     91    String description;
     92    bool activeMatch;
    10993
    11094    bool operator==(const DocumentMarker& o) const
    11195    {
    112         return type() == o.type() && startOffset() == o.startOffset() && endOffset() == o.endOffset();
     96        return type == o.type && startOffset == o.startOffset && endOffset == o.endOffset;
    11397    }
    11498
     
    117101        return !(*this == o);
    118102    }
    119 
    120 private:   
    121     MarkerType m_type;
    122     unsigned m_startOffset;
    123     unsigned m_endOffset;
    124     String m_description;
    125     bool m_activeMatch;
    126103};
    127 
    128 inline DocumentMarker::DocumentMarker()
    129     : m_type(Spelling), m_startOffset(0), m_endOffset(0), m_activeMatch(false)
    130 {
    131 }
    132 
    133 inline DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset)
    134     : m_type(type), m_startOffset(startOffset), m_endOffset(endOffset), m_activeMatch(false)
    135 {
    136 }
    137 
    138 inline DocumentMarker::DocumentMarker(MarkerType type, unsigned startOffset, unsigned endOffset, const String& description)
    139     : m_type(type), m_startOffset(startOffset), m_endOffset(endOffset), m_description(description), m_activeMatch(false)
    140 {
    141     ASSERT(type == DocumentMarker::Grammar || DocumentMarker::Autocorrected);
    142 }
    143 
    144 inline DocumentMarker::DocumentMarker(unsigned startOffset, unsigned endOffset, bool activeMatch)
    145     : m_type(DocumentMarker::TextMatch), m_startOffset(startOffset), m_endOffset(endOffset), m_activeMatch(activeMatch)
    146 {
    147 }
    148 
    149 inline void DocumentMarker::shiftOffsets(int delta)
    150 {
    151     m_startOffset += delta;
    152     m_endOffset +=  delta;
    153 }
    154 
    155 inline void DocumentMarker::setActiveMatch(bool active)
    156 {
    157     ASSERT(m_type == DocumentMarker::TextMatch);
    158     m_activeMatch = active;
    159 }
    160104
    161105} // namespace WebCore
  • trunk/Source/WebCore/dom/DocumentMarkerController.cpp

    r86647 r86704  
    5555}
    5656
    57 void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, const String& description)
     57void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, String description)
    5858{
    5959    // Use a TextIterator to visit the potentially multiple nodes the range covers.
     
    6161        RefPtr<Range> textPiece = markedText.range();
    6262        int exception = 0;
    63         addMarker(textPiece->startContainer(exception),
    64                   DocumentMarker(type, textPiece->startOffset(exception), textPiece->endOffset(exception), description));
    65     }
    66 }
    67 
    68 void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type)
    69 {
    70     // Use a TextIterator to visit the potentially multiple nodes the range covers.
    71     for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
    72         RefPtr<Range> textPiece = markedText.range();
    73         int exception = 0;
    74         addMarker(textPiece->startContainer(exception),
    75                   DocumentMarker(type, textPiece->startOffset(exception), textPiece->endOffset(exception)));
    76     }
    77 
    78 }
    79 
    80 
    81 void DocumentMarkerController::addTextMatchMarker(Range* range, bool activeMatch)
    82 {
    83     // Use a TextIterator to visit the potentially multiple nodes the range covers.
    84     for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
    85         RefPtr<Range> textPiece = markedText.range();
    86         int exception = 0;
    87         unsigned startOffset = textPiece->startOffset(exception);
    88         unsigned endOffset = textPiece->endOffset(exception);
    89         addMarker(textPiece->startContainer(exception), DocumentMarker(activeMatch, startOffset, endOffset));
    90         if (endOffset > startOffset) {
    91             // Rendered rects for markers in WebKit are not populated until each time
    92             // the markers are painted. However, we need it to happen sooner, because
    93             // the whole purpose of tickmarks on the scrollbar is to show where
    94             // matches off-screen are (that haven't been painted yet).
    95             Node* node = textPiece->startContainer(exception);
    96             Vector<DocumentMarker> markers = markersForNode(node);
    97             setRenderedRectForMarker(textPiece->startContainer(exception),
    98                                      markers[markers.size() - 1],
    99                                      range->boundingBox());
    100         }
     63        DocumentMarker marker = {type, textPiece->startOffset(exception), textPiece->endOffset(exception), description, false};
     64        addMarker(textPiece->startContainer(exception), marker);
    10165    }
    10266}
     
    12185void DocumentMarkerController::addMarker(Node* node, const DocumentMarker& newMarker)
    12286{
    123     ASSERT(newMarker.endOffset() >= newMarker.startOffset());
    124     if (newMarker.endOffset() == newMarker.startOffset())
    125         return;
    126 
    127     m_possiblyExistingMarkerTypes.add(newMarker.type());
     87    ASSERT(newMarker.endOffset >= newMarker.startOffset);
     88    if (newMarker.endOffset == newMarker.startOffset)
     89        return;
     90
     91    m_possiblyExistingMarkerTypes.add(newMarker.type);
    12892
    12993    MarkerList* list = m_markers.get(node);
     
    142106        for (i = 0; i < numMarkers; ++i) {
    143107            DocumentMarker marker = list->at(i);
    144             if (marker.startOffset() > toInsert.startOffset())
     108            if (marker.startOffset > toInsert.startOffset)
    145109                break;
    146             if (marker.type() == toInsert.type() && marker.endOffset() >= toInsert.startOffset()) {
    147                 toInsert.setStartOffset(marker.startOffset());
     110            if (marker.type == toInsert.type && marker.endOffset >= toInsert.startOffset) {
     111                toInsert.startOffset = marker.startOffset;
    148112                list->remove(i);
    149113                numMarkers--;
     
    157121        while (j < numMarkers) {
    158122            DocumentMarker marker = list->at(j);
    159             if (marker.startOffset() > toInsert.endOffset())
     123            if (marker.startOffset > toInsert.endOffset)
    160124                break;
    161             if (marker.type() == toInsert.type()) {
     125            if (marker.type == toInsert.type) {
    162126                list->remove(j);
    163                 if (toInsert.endOffset() <= marker.endOffset()) {
    164                     toInsert.setEndOffset(marker.endOffset());
     127                if (toInsert.endOffset <= marker.endOffset) {
     128                    toInsert.endOffset = marker.endOffset;
    165129                    break;
    166130                }
     
    199163
    200164        // stop if we are now past the specified range
    201         if (marker.startOffset() > endOffset)
     165        if (marker.startOffset > endOffset)
    202166            break;
    203167
    204168        // skip marker that is before the specified range or is the wrong type
    205         if (marker.endOffset() < startOffset)
     169        if (marker.endOffset < startOffset)
    206170            continue;
    207171
    208172        // pin the marker to the specified range and apply the shift delta
    209173        docDirty = true;
    210         if (marker.startOffset() < startOffset)
    211             marker.setStartOffset(startOffset);
    212         if (marker.endOffset() > endOffset)
    213             marker.setEndOffset(endOffset);
    214         marker.shiftOffsets(delta);
     174        if (marker.startOffset < startOffset)
     175            marker.startOffset = startOffset;
     176        if (marker.endOffset > endOffset)
     177            marker.endOffset = endOffset;
     178        marker.startOffset += delta;
     179        marker.endOffset += delta;
    215180
    216181        addMarker(dstNode, marker);
     
    241206
    242207        // markers are returned in order, so stop if we are now past the specified range
    243         if (marker.startOffset() >= endOffset)
     208        if (marker.startOffset >= endOffset)
    244209            break;
    245210
    246211        // skip marker that is wrong type or before target
    247         if (marker.endOffset() <= startOffset || !markerTypes.contains(marker.type())) {
     212        if (marker.endOffset <= startOffset || !markerTypes.contains(marker.type)) {
    248213            i++;
    249214            continue;
     
    261226
    262227        // add either of the resulting slices that are left after removing target
    263         if (startOffset > marker.startOffset()) {
     228        if (startOffset > marker.startOffset) {
    264229            DocumentMarker newLeft = marker;
    265             newLeft.setEndOffset(startOffset);
     230            newLeft.endOffset = startOffset;
    266231            list->insert(i, RenderedDocumentMarker(newLeft));
    267232            // i now points to the newly-inserted node, but we want to skip that one
    268233            i++;
    269234        }
    270         if (marker.endOffset() > endOffset) {
     235        if (marker.endOffset > endOffset) {
    271236            DocumentMarker newRight = marker;
    272             newRight.setStartOffset(endOffset);
     237            newRight.startOffset = endOffset;
    273238            list->insert(i, RenderedDocumentMarker(newRight));
    274239            // i now points to the newly-inserted node, but we want to skip that one
     
    306271
    307272            // skip marker that is wrong type
    308             if (marker.type() != markerType)
     273            if (marker.type != markerType)
    309274                continue;
    310275
     
    347312        Vector<DocumentMarker>::const_iterator end = markers.end();
    348313        for (Vector<DocumentMarker>::const_iterator it = markers.begin(); it != end; ++it) {
    349             if (!markerTypes.contains(it->type()))
    350                 continue;
    351             if (node == startContainer && it->endOffset() <= static_cast<unsigned>(range->startOffset()))
    352                 continue;
    353             if (node == endContainer && it->startOffset() >= static_cast<unsigned>(range->endOffset()))
     314            if (!markerTypes.contains(it->type))
     315                continue;
     316            if (node == startContainer && it->endOffset <= static_cast<unsigned>(range->startOffset()))
     317                continue;
     318            if (node == endContainer && it->startOffset >= static_cast<unsigned>(range->endOffset()))
    354319                continue;
    355320            foundMarkers.append(*it);
     
    377342
    378343            // skip marker that is wrong type
    379             if (marker.type() != markerType)
     344            if (marker.type != markerType)
    380345                continue;
    381346
     
    429394
    430395            // skip nodes that are not of the specified type
    431             if (!markerTypes.contains(marker.type())) {
     396            if (!markerTypes.contains(marker.type)) {
    432397                ++i;
    433398                continue;
     
    476441
    477442            // skip nodes that are not of the specified type
    478             if (markerTypes.contains(marker.type())) {
     443            if (markerTypes.contains(marker.type)) {
    479444                nodeNeedsRepaint = true;
    480445                break;
     
    537502    for (size_t i = 0; i != list->size(); ++i) {
    538503        RenderedDocumentMarker& marker = list->at(i);
    539         if (marker.startOffset() >= startOffset) {
    540             ASSERT((int)marker.startOffset() + delta >= 0);
    541             marker.shiftOffsets(delta);
     504        if (marker.startOffset >= startOffset) {
     505            ASSERT((int)marker.startOffset + delta >= 0);
     506            marker.startOffset += delta;
     507            marker.endOffset += delta;
    542508            docDirty = true;
    543509
     
    581547
    582548        // Markers are returned in order, so stop if we are now past the specified range.
    583         if (marker.startOffset() >= endOffset)
     549        if (marker.startOffset >= endOffset)
    584550            break;
    585551
    586552        // Skip marker that is wrong type or before target.
    587         if (marker.endOffset() < startOffset || marker.type() != DocumentMarker::TextMatch)
     553        if (marker.endOffset < startOffset || marker.type != DocumentMarker::TextMatch)
    588554            continue;
    589555
    590         marker.setActiveMatch(active);
     556        marker.activeMatch = active;
    591557        docDirty = true;
    592558    }
     
    613579        Vector<DocumentMarker>::const_iterator end = markers.end();
    614580        for (Vector<DocumentMarker>::const_iterator it = markers.begin(); it != end; ++it) {
    615             if (!markerTypes.contains(it->type()))
    616                 continue;
    617             if (node == startContainer && it->endOffset() <= static_cast<unsigned>(range->startOffset()))
    618                 continue;
    619             if (node == endContainer && it->startOffset() >= static_cast<unsigned>(range->endOffset()))
     581            if (!markerTypes.contains(it->type))
     582                continue;
     583            if (node == startContainer && it->endOffset <= static_cast<unsigned>(range->startOffset()))
     584                continue;
     585            if (node == endContainer && it->startOffset >= static_cast<unsigned>(range->endOffset()))
    620586                continue;
    621587            return true;
     
    646612
    647613            // markers are returned in order, so stop if we are now past the specified range
    648             if (marker.startOffset() >= endOffset)
     614            if (marker.startOffset >= endOffset)
    649615                break;
    650616
    651617            // skip marker that is wrong type or before target
    652             if (marker.endOffset() <= startOffset || !markerTypes.contains(marker.type())) {
     618            if (marker.endOffset <= startOffset || !markerTypes.contains(marker.type)) {
    653619                i++;
    654620                continue;
    655621            }
    656622
    657             marker.clearDescription();
     623            marker.description = String();
    658624        }
    659625    }
     
    669635        fprintf(stderr, "%p", node);
    670636        MarkerList* list = nodeIterator->second;
    671         for (unsigned markerIndex = 0; markerIndex < list->size(); ++markerIndex) {
    672             const DocumentMarker& marker = list->at(markerIndex);
    673             fprintf(stderr, " %d:[%d:%d](%d)", marker.type(), marker.startOffset(), marker.endOffset(), marker.activeMatch());
    674         }
    675 
     637        for (unsigned markerIndex = 0; markerIndex < list->size(); ++markerIndex)
     638            fprintf(stderr, " %d:[%d:%d](%d)", list->at(markerIndex).type, list->at(markerIndex).startOffset, list->at(markerIndex).endOffset, list->at(markerIndex).activeMatch);
    676639        fprintf(stderr, "\n");
    677640    }
  • trunk/Source/WebCore/dom/DocumentMarkerController.h

    r86647 r86704  
    4848
    4949    void detach();
    50     void addMarker(Range*, DocumentMarker::MarkerType);
    51     void addMarker(Range*, DocumentMarker::MarkerType, const String& description);
    52     void addTextMatchMarker(Range*, bool activeMatch);
    53 
     50    void addMarker(Range*, DocumentMarker::MarkerType, String description = String());
     51    void addMarker(Node*, const DocumentMarker&);
    5452    void copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta);
    5553    bool hasMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
     
    8280
    8381private:
    84     void addMarker(Node*, const DocumentMarker&);
    85 
    8682    typedef Vector<RenderedDocumentMarker> MarkerList;
    8783    typedef HashMap<RefPtr<Node>, MarkerList*> MarkerMap;
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r86647 r86704  
    349349    replaceTextInNode(node, offset, count, replacementText);
    350350    RefPtr<Range> newRange = Range::create(document(), node, offset, node, offset + replacementText.length());
    351     for (size_t i = 0; i < markers.size(); ++i) {
    352         if (markers[i].hasDescription())
    353             markerController->addMarker(newRange.get(), markers[i].type(), markers[i].description());
    354         else
    355             markerController->addMarker(newRange.get(), markers[i].type());
    356     }
     351    for (size_t i = 0; i < markers.size(); ++i)
     352        markerController->addMarker(newRange.get(), markers[i].type, markers[i].description);
    357353}
    358354
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r86647 r86704  
    763763    for (size_t i = 0; i < markers.size(); ++i) {
    764764        const DocumentMarker& marker = markers[i];
    765         int startOffset = marker.startOffset();
     765        int startOffset = marker.startOffset;
    766766        if (startOffset == startOfSelection.deepEquivalent().offsetInContainerNode())
    767             return marker.description();
     767            return marker.description;
    768768    }
    769769    return String();
  • trunk/Source/WebCore/editing/Editor.cpp

    r86647 r86704  
    32203220    for (size_t i = 0; i < markers.size(); ++i) {
    32213221        DocumentMarker marker = markers[i];
    3222         if (marker.startOffset() <= startOffset && endOffset <= marker.endOffset() && marker.type() == markerType)
     3222        if (marker.startOffset <= startOffset && endOffset <= marker.endOffset && marker.type == markerType)
    32233223            return true;
    32243224    }
  • trunk/Source/WebCore/editing/SpellingCorrectionController.cpp

    r86703 r86704  
    410410        if (!shouldStartTimerFor(marker, endOffset))
    411411            continue;
    412         RefPtr<Range> wordRange = Range::create(m_frame->document(), node, marker.startOffset(), node, marker.endOffset());
     412        RefPtr<Range> wordRange = Range::create(m_frame->document(), node, marker.startOffset, node, marker.endOffset);
    413413        String currentWord = plainText(wordRange.get());
    414414        if (!currentWord.length())
     
    417417        m_correctionPanelInfo.rangeToBeReplaced = wordRange;
    418418        m_correctionPanelInfo.replacedString = currentWord;
    419         if (marker.type() == DocumentMarker::Spelling)
     419        if (marker.type == DocumentMarker::Spelling)
    420420            startCorrectionPanelTimer(CorrectionPanelInfo::PanelTypeSpellingSuggestions);
    421421        else {
    422             m_correctionPanelInfo.replacementString = marker.description();
     422            m_correctionPanelInfo.replacementString = marker.description;
    423423            startCorrectionPanelTimer(CorrectionPanelInfo::PanelTypeReversion);
    424424        }
  • trunk/Source/WebCore/editing/SpellingCorrectionController.h

    r86647 r86704  
    129129    bool shouldStartTimerFor(const DocumentMarker& marker, int endOffset) const
    130130    {
    131         return (((marker.type() == DocumentMarker::Replacement && !marker.description().isNull())
    132                  || marker.type() == DocumentMarker::Spelling) && static_cast<int>(marker.endOffset()) == endOffset);
     131        return (((marker.type == DocumentMarker::Replacement && !marker.description.isNull())
     132                 || marker.type == DocumentMarker::Spelling) && static_cast<int>(marker.endOffset) == endOffset);
    133133    }
    134134
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r86647 r86704  
    202202    if (RenderObject* renderer = m_innerNonSharedNode->renderer())
    203203        dir = renderer->style()->direction();
    204     return marker->description();
     204    return marker->description;
    205205}
    206206
     
    216216        return String();
    217217   
    218     return marker->description();
     218    return marker->description;
    219219}   
    220220   
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r86647 r86704  
    993993    // Determine whether we need to measure text
    994994    bool markerSpansWholeBox = true;
    995     if (m_start <= (int)marker.startOffset())
     995    if (m_start <= (int)marker.startOffset)
    996996        markerSpansWholeBox = false;
    997     if ((end() + 1) != marker.endOffset()) // end points at the last char, not past it
     997    if ((end() + 1) != marker.endOffset)      // end points at the last char, not past it
    998998        markerSpansWholeBox = false;
    999999    if (m_truncation != cNoTruncation)
     
    10011001
    10021002    if (!markerSpansWholeBox || grammar) {
    1003         int startPosition = max<int>(marker.startOffset() - m_start, 0);
    1004         int endPosition = min<int>(marker.endOffset() - m_start, m_len);
     1003        int startPosition = max<int>(marker.startOffset - m_start, 0);
     1004        int endPosition = min<int>(marker.endOffset - m_start, m_len);
    10051005       
    10061006        if (m_truncation != cNoTruncation)
     
    10441044        underlineOffset = baseline + 2;
    10451045    }
    1046     pt->drawLineForTextChecking(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type()));
     1046    pt->drawLineForTextChecking(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type));
    10471047}
    10481048
     
    10541054    int selHeight = selectionHeight();
    10551055
    1056     int sPos = max(marker.startOffset() - m_start, (unsigned)0);
    1057     int ePos = min(marker.endOffset() - m_start, (unsigned)m_len);   
     1056    int sPos = max(marker.startOffset - m_start, (unsigned)0);
     1057    int ePos = min(marker.endOffset - m_start, (unsigned)m_len);   
    10581058    TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || style->visuallyOrdered());
    10591059   
     
    10651065    // Optionally highlight the text
    10661066    if (renderer()->frame()->editor()->markedTextMatchesAreHighlighted()) {
    1067         Color color = marker.activeMatch() ?
     1067        Color color = marker.activeMatch ?
    10681068            renderer()->theme()->platformActiveTextSearchHighlightColor() :
    10691069            renderer()->theme()->platformInactiveTextSearchHighlightColor();
     
    10811081    int h = selectionHeight();
    10821082   
    1083     int sPos = max(marker.startOffset() - m_start, (unsigned)0);
    1084     int ePos = min(marker.endOffset() - m_start, (unsigned)m_len);   
     1083    int sPos = max(marker.startOffset - m_start, (unsigned)0);
     1084    int ePos = min(marker.endOffset - m_start, (unsigned)m_len);   
    10851085    TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, expansionBehavior(), direction(), m_dirOverride || style->visuallyOrdered());
    10861086    IntPoint startPoint = IntPoint(m_x, y);
     
    11061106       
    11071107        // Paint either the background markers or the foreground markers, but not both
    1108         switch (marker.type()) {
     1108        switch (marker.type) {
    11091109            case DocumentMarker::Grammar:
    11101110            case DocumentMarker::Spelling:
     
    11221122        }
    11231123
    1124         if (marker.endOffset() <= start())
     1124        if (marker.endOffset <= start())
    11251125            // marker is completely before this run.  This might be a marker that sits before the
    11261126            // first run we draw, or markers that were within runs we skipped due to truncation.
    11271127            continue;
    11281128       
    1129         if (marker.startOffset() > end())
     1129        if (marker.startOffset > end())
    11301130            // marker is completely after this run, bail.  A later run will paint it.
    11311131            break;
    11321132       
    11331133        // marker intersects this run.  Paint it.
    1134         switch (marker.type()) {
     1134        switch (marker.type) {
    11351135            case DocumentMarker::Spelling:
    11361136                paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, false);
  • trunk/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp

    r86647 r86704  
    100100
    101101        // SVG is only interessted in the TextMatch marker, for now.
    102         if (marker.type() != DocumentMarker::TextMatch)
     102        if (marker.type != DocumentMarker::TextMatch)
    103103            continue;
    104104
     
    110110            SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(box);
    111111
    112             int markerStartPosition = max<int>(marker.startOffset() - textBox->start(), 0);
    113             int markerEndPosition = min<int>(marker.endOffset() - textBox->start(), textBox->len());
     112            int markerStartPosition = max<int>(marker.startOffset - textBox->start(), 0);
     113            int markerEndPosition = min<int>(marker.endOffset - textBox->start(), textBox->len());
    114114
    115115            if (markerStartPosition >= markerEndPosition)
  • trunk/Source/WebKit/chromium/ChangeLog

    r86700 r86704  
     12011-05-17  Andrew Wilson  <atwilson@chromium.org>
     2
     3        Unreviewed, rolling out r86647.
     4        http://trac.webkit.org/changeset/86647
     5        https://bugs.webkit.org/show_bug.cgi?id=56814
     6
     7        Broke tests downstream in Chromium
     8
     9        * src/WebFrameImpl.cpp:
     10        (WebKit::WebFrameImpl::addMarker):
     11
    1122011-05-17  Yufeng Shen  <miletus@chromium.org>
    213
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r86647 r86704  
    22412241void WebFrameImpl::addMarker(Range* range, bool activeMatch)
    22422242{
    2243     frame()->document()->markers()->addTextMatchMarker(range, activeMatch);
     2243    // Use a TextIterator to visit the potentially multiple nodes the range
     2244    // covers.
     2245    TextIterator markedText(range);
     2246    for (; !markedText.atEnd(); markedText.advance()) {
     2247        RefPtr<Range> textPiece = markedText.range();
     2248        int exception = 0;
     2249
     2250        DocumentMarker marker = {
     2251            DocumentMarker::TextMatch,
     2252            textPiece->startOffset(exception),
     2253            textPiece->endOffset(exception),
     2254            "",
     2255            activeMatch
     2256        };
     2257
     2258        if (marker.endOffset > marker.startOffset) {
     2259            // Find the node to add a marker to and add it.
     2260            Node* node = textPiece->startContainer(exception);
     2261            frame()->document()->markers()->addMarker(node, marker);
     2262
     2263            // Rendered rects for markers in WebKit are not populated until each time
     2264            // the markers are painted. However, we need it to happen sooner, because
     2265            // the whole purpose of tickmarks on the scrollbar is to show where
     2266            // matches off-screen are (that haven't been painted yet).
     2267            Vector<DocumentMarker> markers = frame()->document()->markers()->markersForNode(node);
     2268            frame()->document()->markers()->setRenderedRectForMarker(
     2269                textPiece->startContainer(exception),
     2270                markers[markers.size() - 1],
     2271                range->boundingBox());
     2272        }
     2273    }
    22442274}
    22452275
Note: See TracChangeset for help on using the changeset viewer.