Changeset 154348 in webkit


Ignore:
Timestamp:
Aug 20, 2013 11:59:17 AM (11 years ago)
Author:
psolanki@apple.com
Message:

<https://webkit.org/b/120029> Document::markers() should return a reference

Reviewed by Andreas Kling.

Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
m_markers as const and initialize it in member initialization.

Source/WebCore:

  • dom/Document.cpp:

(WebCore::Document::Document):

  • dom/Document.h:

(WebCore::Document::markers):

  • editing/AlternativeTextController.cpp:

(WebCore::AlternativeTextController::isSpellingMarkerAllowed):
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
(WebCore::AlternativeTextController::handleAlternativeTextUIResult):
(WebCore::AlternativeTextController::respondToChangedSelection):
(WebCore::AlternativeTextController::respondToAppliedEditing):
(WebCore::AlternativeTextController::respondToUnappliedEditing):
(WebCore::AlternativeTextController::markReversed):
(WebCore::AlternativeTextController::markCorrection):
(WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
(WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
(WebCore::AlternativeTextController::applyDictationAlternative):

  • editing/CompositeEditCommand.cpp:

(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):

  • editing/DeleteSelectionCommand.cpp:

(WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):

  • editing/DictationCommand.cpp:

(WebCore::DictationMarkerSupplier::addMarkersToTextNode):

  • editing/Editor.cpp:

(WebCore::Editor::ignoreSpelling):
(WebCore::Editor::learnSpelling):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::clearMisspellingsAndBadGrammar):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::countMatchesForText):
(WebCore::Editor::setMarkedTextMatchesAreHighlighted):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::selectionStartHasMarkerFor):

  • editing/SpellChecker.cpp:

(WebCore::SpellChecker::didCheckSucceed):

  • editing/SplitTextNodeCommand.cpp:

(WebCore::SplitTextNodeCommand::doApply):
(WebCore::SplitTextNodeCommand::doUnapply):

  • editing/TextCheckingHelper.cpp:

(WebCore::TextCheckingHelper::findFirstMisspelling):
(WebCore::TextCheckingHelper::findFirstGrammarDetail):

  • page/FrameView.cpp:

(WebCore::FrameView::getTickmarks):
(WebCore::FrameView::paintContents):

  • page/Page.cpp:

(WebCore::Page::unmarkAllTextMatches):

  • rendering/HitTestResult.cpp:

(WebCore::HitTestResult::spellingToolTip):
(WebCore::HitTestResult::replacedString):
(WebCore::HitTestResult::dictationAlternatives):

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paintDocumentMarkers):

  • rendering/svg/SVGInlineFlowBox.cpp:

(WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):

  • testing/Internals.cpp:

(WebCore::Internals::markerCountForNode):
(WebCore::Internals::markerAt):
(WebCore::Internals::addTextMatchMarker):

Source/WebKit/blackberry:

  • WebKitSupport/InPageSearchManager.cpp:

(BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
(BlackBerry::WebKit::InPageSearchManager::setActiveMatchAndMarker):
(BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):

  • WebKitSupport/InputHandler.cpp:

(BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
(BlackBerry::WebKit::InputHandler::addAttributedTextMarker):
(BlackBerry::WebKit::InputHandler::removeAttributedTextMarker):

Source/WebKit/efl:

  • ewk/ewk_frame.cpp:

(ewk_frame_text_matches_unmark_all):
(ewk_frame_text_matches_nth_pos_get):

Source/WebKit/mac:

  • WebView/WebFrame.mm:

(-[WebFrame _unmarkAllBadGrammar]):
(-[WebFrame _unmarkAllMisspellings]):

  • WebView/WebHTMLView.mm:

(-[WebHTMLView unmarkAllTextMatches]):
(-[WebHTMLView rectsForTextMatches]):

Source/WebKit/win:

  • WebFrame.cpp:

(WebFrame::unmarkAllMisspellings):
(WebFrame::unmarkAllBadGrammar):

  • WebView.cpp:

(WebView::rectsForTextMatches):

Source/WebKit2:

  • WebProcess/WebPage/FindController.cpp:

(WebKit::FindController::rectsForTextMatches):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::unmarkAllMisspellings):
(WebKit::WebPage::unmarkAllBadGrammar):

Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r154347 r154348  
     12013-08-20  Pratik Solanki  <psolanki@apple.com>
     2
     3        <https://webkit.org/b/120029> Document::markers() should return a reference
     4
     5        Reviewed by Andreas Kling.
     6
     7        Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
     8        m_markers as const and initialize it in member initialization.
     9
     10        * dom/Document.cpp:
     11        (WebCore::Document::Document):
     12        * dom/Document.h:
     13        (WebCore::Document::markers):
     14        * editing/AlternativeTextController.cpp:
     15        (WebCore::AlternativeTextController::isSpellingMarkerAllowed):
     16        (WebCore::AlternativeTextController::applyAlternativeTextToRange):
     17        (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
     18        (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
     19        (WebCore::AlternativeTextController::respondToChangedSelection):
     20        (WebCore::AlternativeTextController::respondToAppliedEditing):
     21        (WebCore::AlternativeTextController::respondToUnappliedEditing):
     22        (WebCore::AlternativeTextController::markReversed):
     23        (WebCore::AlternativeTextController::markCorrection):
     24        (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
     25        (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
     26        (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
     27        (WebCore::AlternativeTextController::applyDictationAlternative):
     28        * editing/CompositeEditCommand.cpp:
     29        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
     30        * editing/DeleteSelectionCommand.cpp:
     31        (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
     32        * editing/DictationCommand.cpp:
     33        (WebCore::DictationMarkerSupplier::addMarkersToTextNode):
     34        * editing/Editor.cpp:
     35        (WebCore::Editor::ignoreSpelling):
     36        (WebCore::Editor::learnSpelling):
     37        (WebCore::Editor::advanceToNextMisspelling):
     38        (WebCore::Editor::clearMisspellingsAndBadGrammar):
     39        (WebCore::Editor::markAndReplaceFor):
     40        (WebCore::Editor::changeBackToReplacedString):
     41        (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
     42        (WebCore::Editor::countMatchesForText):
     43        (WebCore::Editor::setMarkedTextMatchesAreHighlighted):
     44        (WebCore::Editor::respondToChangedSelection):
     45        (WebCore::Editor::selectionStartHasMarkerFor):
     46        * editing/SpellChecker.cpp:
     47        (WebCore::SpellChecker::didCheckSucceed):
     48        * editing/SplitTextNodeCommand.cpp:
     49        (WebCore::SplitTextNodeCommand::doApply):
     50        (WebCore::SplitTextNodeCommand::doUnapply):
     51        * editing/TextCheckingHelper.cpp:
     52        (WebCore::TextCheckingHelper::findFirstMisspelling):
     53        (WebCore::TextCheckingHelper::findFirstGrammarDetail):
     54        * page/FrameView.cpp:
     55        (WebCore::FrameView::getTickmarks):
     56        (WebCore::FrameView::paintContents):
     57        * page/Page.cpp:
     58        (WebCore::Page::unmarkAllTextMatches):
     59        * rendering/HitTestResult.cpp:
     60        (WebCore::HitTestResult::spellingToolTip):
     61        (WebCore::HitTestResult::replacedString):
     62        (WebCore::HitTestResult::dictationAlternatives):
     63        * rendering/InlineTextBox.cpp:
     64        (WebCore::InlineTextBox::paintDocumentMarkers):
     65        * rendering/svg/SVGInlineFlowBox.cpp:
     66        (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
     67        * testing/Internals.cpp:
     68        (WebCore::Internals::markerCountForNode):
     69        (WebCore::Internals::markerAt):
     70        (WebCore::Internals::addTextMatchMarker):
     71
    1722013-08-20  Pratik Solanki  <psolanki@apple.com>
    273
  • trunk/Source/WebCore/dom/Document.cpp

    r154286 r154348  
    421421    , m_ignoreDestructiveWriteCount(0)
    422422    , m_titleSetExplicitly(false)
     423    , m_markers(adoptPtr(new DocumentMarkerController))
    423424    , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
    424425    , m_cssTarget(0)
     
    490491    if ((frame && frame->ownerElement()) || !url.isEmpty())
    491492        setURL(url);
    492 
    493     m_markers = adoptPtr(new DocumentMarkerController);
    494493
    495494    if (m_frame)
  • trunk/Source/WebCore/dom/Document.h

    r154291 r154348  
    845845    HTMLHeadElement* head();
    846846
    847     DocumentMarkerController* markers() const { return m_markers.get(); }
     847    DocumentMarkerController& markers() const { return *m_markers; }
    848848
    849849    bool directionSetOnDocumentElement() const { return m_directionSetOnDocumentElement; }
     
    13811381
    13821382    OwnPtr<AXObjectCache> m_axObjectCache;
    1383     OwnPtr<DocumentMarkerController> m_markers;
     1383    const OwnPtr<DocumentMarkerController> m_markers;
    13841384   
    13851385    Timer<Document> m_updateFocusAppearanceTimer;
  • trunk/Source/WebCore/editing/AlternativeTextController.cpp

    r154286 r154348  
    198198bool AlternativeTextController::isSpellingMarkerAllowed(PassRefPtr<Range> misspellingRange) const
    199199{
    200     return !m_frame->document()->markers()->hasMarkers(misspellingRange.get(), DocumentMarker::SpellCheckingExemption);
     200    return !m_frame->document()->markers().hasMarkers(misspellingRange.get(), DocumentMarker::SpellCheckingExemption);
    201201}
    202202
     
    290290        return;
    291291
    292     DocumentMarkerController* markers = replacementRange->startContainer()->document()->markers();
     292    DocumentMarkerController& markers = replacementRange->startContainer()->document()->markers();
    293293    size_t size = markerTypesToAdd.size();
    294294    for (size_t i = 0; i < size; ++i)
    295         markers->addMarker(replacementRange.get(), markerTypesToAdd[i], markerDescriptionForAppliedAlternativeText(alternativeType, markerTypesToAdd[i]));
     295        markers.addMarker(replacementRange.get(), markerTypesToAdd[i], markerDescriptionForAppliedAlternativeText(alternativeType, markerTypesToAdd[i]));
    296296}
    297297
     
    325325    RefPtr<Range> range = Range::create(m_frame->document(), m_frame->selection().selection().start(), m_frame->selection().selection().end());
    326326
    327     DocumentMarkerController* markers = m_frame->document()->markers();
    328     markers->removeMarkers(range.get(), DocumentMarker::Spelling | DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
    329     markers->addMarker(range.get(), DocumentMarker::Replacement);
    330     markers->addMarker(range.get(), DocumentMarker::SpellCheckingExemption);
     327    DocumentMarkerController& markers = m_frame->document()->markers();
     328    markers.removeMarkers(range.get(), DocumentMarker::Spelling | DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
     329    markers.addMarker(range.get(), DocumentMarker::Replacement);
     330    markers.addMarker(range.get(), DocumentMarker::SpellCheckingExemption);
    331331}
    332332
     
    413413            applyAlternativeTextToRange(rangeWithAlternative, result, m_alternativeTextInfo.type, markerTypesForAutocorrection());
    414414        else if (!m_isDismissedByEditing)
    415             rangeWithAlternative->startContainer()->document()->markers()->addMarker(rangeWithAlternative, DocumentMarker::RejectedCorrection, m_alternativeTextInfo.originalText);
     415            rangeWithAlternative->startContainer()->document()->markers().addMarker(rangeWithAlternative, DocumentMarker::RejectedCorrection, m_alternativeTextInfo.originalText);
    416416        break;
    417417    case AlternativeTextTypeReversion:
     
    474474
    475475    Node* node = position.containerNode();
    476     Vector<DocumentMarker*> markers = node->document()->markers()->markersFor(node);
     476    Vector<DocumentMarker*> markers = node->document()->markers().markersFor(node);
    477477    size_t markerCount = markers.size();
    478478    for (size_t i = 0; i < markerCount; ++i) {
     
    489489{
    490490    if (command->isTopLevelCommand() && !command->shouldRetainAutocorrectionIndicator())
    491         m_frame->document()->markers()->removeMarkers(DocumentMarker::CorrectionIndicator);
     491        m_frame->document()->markers().removeMarkers(DocumentMarker::CorrectionIndicator);
    492492
    493493    markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand(command);
     
    502502    if (!range)
    503503        return;
    504     DocumentMarkerController* markers = m_frame->document()->markers();
    505     markers->addMarker(range.get(), DocumentMarker::Replacement);
    506     markers->addMarker(range.get(), DocumentMarker::SpellCheckingExemption);
     504    DocumentMarkerController& markers = m_frame->document()->markers();
     505    markers.addMarker(range.get(), DocumentMarker::Replacement);
     506    markers.addMarker(range.get(), DocumentMarker::SpellCheckingExemption);
    507507}
    508508
     
    543543void AlternativeTextController::markReversed(PassRefPtr<Range> changedRange)
    544544{
    545     changedRange->startContainer()->document()->markers()->removeMarkers(changedRange.get(), DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
    546     changedRange->startContainer()->document()->markers()->addMarker(changedRange.get(), DocumentMarker::SpellCheckingExemption);
     545    changedRange->startContainer()->document()->markers().removeMarkers(changedRange.get(), DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
     546    changedRange->startContainer()->document()->markers().addMarker(changedRange.get(), DocumentMarker::SpellCheckingExemption);
    547547}
    548548
     
    550550{
    551551    Vector<DocumentMarker::MarkerType> markerTypesToAdd = markerTypesForAutocorrection();
    552     DocumentMarkerController* markers = replacedRange->startContainer()->document()->markers();
     552    DocumentMarkerController& markers = replacedRange->startContainer()->document()->markers();
    553553    for (size_t i = 0; i < markerTypesToAdd.size(); ++i) {
    554554        DocumentMarker::MarkerType markerType = markerTypesToAdd[i];
    555555        if (markerType == DocumentMarker::Replacement || markerType == DocumentMarker::Autocorrected)
    556             markers->addMarker(replacedRange.get(), markerType, replacedString);
     556            markers.addMarker(replacedRange.get(), markerType, replacedString);
    557557        else
    558             markers->addMarker(replacedRange.get(), markerType);
     558            markers.addMarker(replacedRange.get(), markerType);
    559559    }
    560560}
     
    564564    if (!rangeOfCorrection)
    565565        return;
    566     DocumentMarkerController* markers = rangeOfCorrection->startContainer()->document()->markers();
    567     Vector<DocumentMarker*> correctedOnceMarkers = markers->markersInRange(rangeOfCorrection, DocumentMarker::Autocorrected);
     566    DocumentMarkerController& markers = rangeOfCorrection->startContainer()->document()->markers();
     567    Vector<DocumentMarker*> correctedOnceMarkers = markers.markersInRange(rangeOfCorrection, DocumentMarker::Autocorrected);
    568568    if (correctedOnceMarkers.isEmpty())
    569569        return;
     
    578578    }
    579579
    580     markers->removeMarkers(rangeOfCorrection, DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
     580    markers.removeMarkers(rangeOfCorrection, DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
    581581}
    582582
     
    605605    // whitespace. So if the user types the same original word again at this position, we
    606606    // won't autocorrect it again.
    607     m_frame->document()->markers()->addMarker(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection, m_originalStringForLastDeletedAutocorrection);
     607    m_frame->document()->markers().addMarker(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection, m_originalStringForLastDeletedAutocorrection);
    608608}
    609609
    610610bool AlternativeTextController::processMarkersOnTextToBeReplacedByResult(const TextCheckingResult* result, Range* rangeWithAlternative, const String& stringToBeReplaced)
    611611{
    612     DocumentMarkerController* markerController = m_frame->document()->markers();
    613     if (markerController->hasMarkers(rangeWithAlternative, DocumentMarker::Replacement)) {
     612    DocumentMarkerController& markerController = m_frame->document()->markers();
     613    if (markerController.hasMarkers(rangeWithAlternative, DocumentMarker::Replacement)) {
    614614        if (result->type == TextCheckingTypeCorrection)
    615615            recordSpellcheckerResponseForModifiedCorrection(rangeWithAlternative, stringToBeReplaced, result->replacement);
     
    617617    }
    618618
    619     if (markerController->hasMarkers(rangeWithAlternative, DocumentMarker::RejectedCorrection))
     619    if (markerController.hasMarkers(rangeWithAlternative, DocumentMarker::RejectedCorrection))
    620620        return false;
    621621
     
    624624    RefPtr<Range> precedingCharacterRange = Range::create(m_frame->document(), precedingCharacterPosition, beginningOfRange);
    625625
    626     Vector<DocumentMarker*> markers = markerController->markersInRange(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection);
     626    Vector<DocumentMarker*> markers = markerController.markersInRange(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection);
    627627
    628628    for (size_t i = 0; i < markers.size(); ++i) {
     
    747747    if (!selection || !editor.shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
    748748        return;
    749     DocumentMarkerController* markers = selection->startContainer()->document()->markers();
    750     Vector<DocumentMarker*> dictationAlternativesMarkers = markers->markersInRange(selection.get(), DocumentMarker::DictationAlternatives);
     749    DocumentMarkerController& markers = selection->startContainer()->document()->markers();
     750    Vector<DocumentMarker*> dictationAlternativesMarkers = markers.markersInRange(selection.get(), DocumentMarker::DictationAlternatives);
    751751    for (size_t i = 0; i < dictationAlternativesMarkers.size(); ++i)
    752752        removeDictationAlternativesForMarker(dictationAlternativesMarkers[i]);
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r153942 r154348  
    535535{
    536536    RefPtr<Text> node(prpNode);
    537     DocumentMarkerController* markerController = document()->markers();
     537    DocumentMarkerController& markerController = document()->markers();
    538538    Vector<DocumentMarker> markers;
    539     copyMarkers(markerController->markersInRange(Range::create(document(), node, offset, node, offset + count).get(), DocumentMarker::AllMarkers()), markers);
     539    copyMarkers(markerController.markersInRange(Range::create(document(), node, offset, node, offset + count).get(), DocumentMarker::AllMarkers()), markers);
    540540    replaceTextInNode(node, offset, count, replacementText);
    541541    RefPtr<Range> newRange = Range::create(document(), node, offset, node, offset + replacementText.length());
    542542    for (size_t i = 0; i < markers.size(); ++i)
    543         markerController->addMarker(newRange.get(), markers[i].type(), markers[i].description());
     543        markerController.addMarker(newRange.get(), markers[i].type(), markers[i].description());
    544544}
    545545
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r154286 r154348  
    756756
    757757    RefPtr<Range> rangeOfFirstCharacter = Range::create(document(), startOfSelection.deepEquivalent(), nextPosition.deepEquivalent());
    758     Vector<DocumentMarker*> markers = document()->markers()->markersInRange(rangeOfFirstCharacter.get(), DocumentMarker::Autocorrected);
     758    Vector<DocumentMarker*> markers = document()->markers().markersInRange(rangeOfFirstCharacter.get(), DocumentMarker::Autocorrected);
    759759    for (size_t i = 0; i < markers.size(); ++i) {
    760760        const DocumentMarker* marker = markers[i];
  • trunk/Source/WebCore/editing/DictationCommand.cpp

    r154286 r154348  
    6565    {
    6666        Document* document = textNode->document();
    67         DocumentMarkerController* markerController =document->markers();
     67        DocumentMarkerController& markerController = document->markers();
    6868        for (size_t i = 0; i < m_alternatives.size(); ++i) {
    6969            const DictationAlternative& alternative = m_alternatives[i];
    70             markerController->addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::DictationAlternatives, DictationMarkerDetails::create(textToBeInserted.substring(alternative.rangeStart, alternative.rangeLength), alternative.dictationContext));
    71             markerController->addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::SpellCheckingExemption);
     70            markerController.addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::DictationAlternatives, DictationMarkerDetails::create(textToBeInserted.substring(alternative.rangeStart, alternative.rangeLength), alternative.dictationContext));
     71            markerController.addMarkerToNode(textNode, alternative.rangeStart + offsetOfInsertion, alternative.rangeLength, DocumentMarker::SpellCheckingExemption);
    7272        }
    7373    }
  • trunk/Source/WebCore/editing/Editor.cpp

    r154286 r154348  
    15931593    RefPtr<Range> selectedRange = m_frame.selection().toNormalizedRange();
    15941594    if (selectedRange)
    1595         m_frame.document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
     1595        m_frame.document()->markers().removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
    15961596
    15971597    String text = selectedText();
     
    16091609    RefPtr<Range> selectedRange = m_frame.selection().toNormalizedRange();
    16101610    if (selectedRange)
    1611         m_frame.document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
     1611        m_frame.document()->markers().removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
    16121612
    16131613    String text = selectedText();
     
    17731773       
    17741774        client()->updateSpellingUIWithGrammarString(badGrammarPhrase, grammarDetail);
    1775         m_frame.document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, grammarDetail.userDescription);
     1775        m_frame.document()->markers().addMarker(badGrammarRange.get(), DocumentMarker::Grammar, grammarDetail.userDescription);
    17761776    } else
    17771777#endif
     
    17851785       
    17861786        client()->updateSpellingUIWithMisspelledWord(misspelledWord);
    1787         m_frame.document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
     1787        m_frame.document()->markers().addMarker(misspellingRange.get(), DocumentMarker::Spelling);
    17881788    }
    17891789}
     
    19181918    RefPtr<Range> selectedRange = movingSelection.toNormalizedRange();
    19191919    if (selectedRange) {
    1920         m_frame.document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
    1921         m_frame.document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Grammar);
     1920        m_frame.document()->markers().removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
     1921        m_frame.document()->markers().removeMarkers(selectedRange.get(), DocumentMarker::Grammar);
    19221922    }
    19231923}
     
    22152215            if (!m_alternativeTextController->isSpellingMarkerAllowed(misspellingRange))
    22162216                continue;
    2217             misspellingRange->startContainer()->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling, replacement);
     2217            misspellingRange->startContainer()->document()->markers().addMarker(misspellingRange.get(), DocumentMarker::Spelling, replacement);
    22182218        } else if (shouldMarkGrammar && resultType == TextCheckingTypeGrammar && paragraph.checkingRangeCovers(resultLocation, resultLength)) {
    22192219            ASSERT(resultLength > 0 && resultLocation >= 0);
     
    22242224                if (paragraph.checkingRangeCovers(resultLocation + detail.location, detail.length)) {
    22252225                    RefPtr<Range> badGrammarRange = paragraph.subrange(resultLocation + detail.location, detail.length);
    2226                     badGrammarRange->startContainer()->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail.userDescription);
     2226                    badGrammarRange->startContainer()->document()->markers().addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail.userDescription);
    22272227                }
    22282228            }
     
    23332333    replaceSelectionWithText(replacedString, false, false);
    23342334    RefPtr<Range> changedRange = paragraph.subrange(paragraph.checkingStart(), replacedString.length());
    2335     changedRange->startContainer()->document()->markers()->addMarker(changedRange.get(), DocumentMarker::Replacement, String());
     2335    changedRange->startContainer()->document()->markers().addMarker(changedRange.get(), DocumentMarker::Replacement, String());
    23362336    m_alternativeTextController->markReversed(changedRange.get());
    23372337}
     
    23662366{
    23672367    Document* document = m_frame.document();
    2368     if (!document || !document->markers()->hasMarkers())
     2368    if (!document || !document->markers().hasMarkers())
    23692369        return;
    23702370
     
    24322432    RefPtr<Range> wordRange = Range::create(document, startOfFirstWord.deepEquivalent(), endOfLastWord.deepEquivalent());
    24332433
    2434     Vector<DocumentMarker*> markers = document->markers()->markersInRange(wordRange.get(), DocumentMarker::DictationAlternatives);
     2434    Vector<DocumentMarker*> markers = document->markers().markersInRange(wordRange.get(), DocumentMarker::DictationAlternatives);
    24352435    for (size_t i = 0; i < markers.size(); ++i)
    24362436        m_alternativeTextController->removeDictationAlternativesForMarker(markers[i]);
    24372437
    2438     document->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker);
    2439     document->markers()->clearDescriptionOnMarkersIntersectingRange(wordRange.get(), DocumentMarker::Replacement);
     2438    document->markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker);
     2439    document->markers().clearDescriptionOnMarkersIntersectingRange(wordRange.get(), DocumentMarker::Replacement);
    24402440}
    24412441
     
    29182918       
    29192919        if (markMatches)
    2920             m_frame.document()->markers()->addMarker(resultRange.get(), DocumentMarker::TextMatch);
     2920            m_frame.document()->markers().addMarker(resultRange.get(), DocumentMarker::TextMatch);
    29212921
    29222922        // Stop looking if we hit the specified limit. A limit of 0 means no limit.
     
    29612961
    29622962    m_areMarkedTextMatchesHighlighted = flag;
    2963     m_frame.document()->markers()->repaintMarkers(DocumentMarker::TextMatch);
     2963    m_frame.document()->markers().repaintMarkers(DocumentMarker::TextMatch);
    29642964}
    29652965
     
    30023002        if (!textChecker() || textChecker()->shouldEraseMarkersAfterChangeSelection(TextCheckingTypeSpelling)) {
    30033003            if (RefPtr<Range> wordRange = newAdjacentWords.toNormalizedRange())
    3004                 m_frame.document()->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling);
     3004                m_frame.document()->markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling);
    30053005        }
    30063006        if (!textChecker() || textChecker()->shouldEraseMarkersAfterChangeSelection(TextCheckingTypeGrammar)) {
    30073007            if (RefPtr<Range> sentenceRange = newSelectedSentence.toNormalizedRange())
    3008                 m_frame.document()->markers()->removeMarkers(sentenceRange.get(), DocumentMarker::Grammar);
     3008                m_frame.document()->markers().removeMarkers(sentenceRange.get(), DocumentMarker::Grammar);
    30093009        }
    30103010    }
     
    30123012    // When continuous spell checking is off, existing markers disappear after the selection changes.
    30133013    if (!isContinuousSpellCheckingEnabled)
    3014         m_frame.document()->markers()->removeMarkers(DocumentMarker::Spelling);
     3014        m_frame.document()->markers().removeMarkers(DocumentMarker::Spelling);
    30153015    if (!isContinuousGrammarCheckingEnabled)
    3016         m_frame.document()->markers()->removeMarkers(DocumentMarker::Grammar);
     3016        m_frame.document()->markers().removeMarkers(DocumentMarker::Grammar);
    30173017
    30183018    notifyComponentsOnChangedSelection(oldSelection, options);
     
    30453045    unsigned int startOffset = static_cast<unsigned int>(from);
    30463046    unsigned int endOffset = static_cast<unsigned int>(from + length);
    3047     Vector<DocumentMarker*> markers = m_frame.document()->markers()->markersFor(node);
     3047    Vector<DocumentMarker*> markers = m_frame.document()->markers().markersFor(node);
    30483048    for (size_t i = 0; i < markers.size(); ++i) {
    30493049        DocumentMarker* marker = markers[i];
  • trunk/Source/WebCore/editing/SpellChecker.cpp

    r154219 r154348  
    233233            markers |= DocumentMarker::Grammar;
    234234        if (markers)
    235             m_frame->document()->markers()->removeMarkers(m_processingRequest->checkingRange().get(), markers);
     235            m_frame->document()->markers().removeMarkers(m_processingRequest->checkingRange().get(), markers);
    236236    }
    237237    didCheck(sequence, results);
  • trunk/Source/WebCore/editing/SplitTextNodeCommand.cpp

    r142375 r154348  
    6161    m_text1 = Text::create(document(), prefixText);
    6262    ASSERT(m_text1);
    63     document()->markers()->copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
     63    document()->markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
    6464
    6565    insertText1AndTrimText2();
     
    7777    m_text2->insertData(0, prefixText, ASSERT_NO_EXCEPTION);
    7878
    79     document()->markers()->copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0);
     79    document()->markers().copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0);
    8080    m_text1->remove(ASSERT_NO_EXCEPTION);
    8181}
  • trunk/Source/WebCore/editing/TextCheckingHelper.cpp

    r154219 r154348  
    276276
    277277                // Store marker for misspelled word.
    278                 misspellingRange->startContainer()->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
     278                misspellingRange->startContainer()->document()->markers().addMarker(misspellingRange.get(), DocumentMarker::Spelling);
    279279
    280280                // Bail out if we're marking only the first misspelling, and not all instances.
     
    438438        if (markAll) {
    439439            RefPtr<Range> badGrammarRange = TextIterator::subrange(m_range.get(), badGrammarPhraseLocation - startOffset + detail->location, detail->length);
    440             badGrammarRange->startContainer()->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription);
     440            badGrammarRange->startContainer()->document()->markers().addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription);
    441441        }
    442442       
  • trunk/Source/WebCore/page/FrameView.cpp

    r154286 r154348  
    30663066void FrameView::getTickmarks(Vector<IntRect>& tickmarks) const
    30673067{
    3068     tickmarks = frame().document()->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
     3068    tickmarks = frame().document()->markers().renderedRectsForMarkers(DocumentMarker::TextMatch);
    30693069}
    30703070
     
    35433543   
    35443544    if (m_paintBehavior == PaintBehaviorNormal)
    3545         document->markers()->invalidateRenderedRectsForMarkersInRect(rect);
     3545        document->markers().invalidateRenderedRectsForMarkersInRect(rect);
    35463546
    35473547    if (document->printing())
  • trunk/Source/WebCore/page/Page.cpp

    r154291 r154348  
    699699    Frame* frame = mainFrame();
    700700    do {
    701         frame->document()->markers()->removeMarkers(DocumentMarker::TextMatch);
     701        frame->document()->markers().removeMarkers(DocumentMarker::TextMatch);
    702702        frame = incrementFrame(frame, true, false);
    703703    } while (frame);
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r154286 r154348  
    197197        return String();
    198198   
    199     DocumentMarker* marker = m_innerNonSharedNode->document()->markers()->markerContainingPoint(m_hitTestLocation.point(), DocumentMarker::Grammar);
     199    DocumentMarker* marker = m_innerNonSharedNode->document()->markers().markerContainingPoint(m_hitTestLocation.point(), DocumentMarker::Grammar);
    200200    if (!marker)
    201201        return String();
     
    213213        return String();
    214214   
    215     DocumentMarker* marker = m_innerNonSharedNode->document()->markers()->markerContainingPoint(m_hitTestLocation.point(), DocumentMarker::Replacement);
     215    DocumentMarker* marker = m_innerNonSharedNode->document()->markers().markerContainingPoint(m_hitTestLocation.point(), DocumentMarker::Replacement);
    216216    if (!marker)
    217217        return String();
     
    663663        return Vector<String>();
    664664
    665     DocumentMarker* marker = m_innerNonSharedNode->document()->markers()->markerContainingPoint(pointInInnerNodeFrame(), DocumentMarker::DictationAlternatives);
     665    DocumentMarker* marker = m_innerNonSharedNode->document()->markers().markerContainingPoint(pointInInnerNodeFrame(), DocumentMarker::DictationAlternatives);
    666666    if (!marker)
    667667        return Vector<String>();
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r154272 r154348  
    14161416        return;
    14171417
    1418     Vector<DocumentMarker*> markers = renderer()->document()->markers()->markersFor(renderer()->node());
     1418    Vector<DocumentMarker*> markers = renderer()->document()->markers().markersFor(renderer()->node());
    14191419    Vector<DocumentMarker*>::const_iterator markerIt = markers.begin();
    14201420
  • trunk/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp

    r152827 r154348  
    9393    AffineTransform fragmentTransform;
    9494    Document* document = textRenderer->document();
    95     Vector<DocumentMarker*> markers = document->markers()->markersFor(textRenderer->node());
     95    Vector<DocumentMarker*> markers = document->markers().markersFor(textRenderer->node());
    9696
    9797    Vector<DocumentMarker*>::iterator markerEnd = markers.end();
  • trunk/Source/WebCore/testing/Internals.cpp

    r154327 r154348  
    818818    }
    819819
    820     return node->document()->markers()->markersFor(node, markerTypes).size();
     820    return node->document()->markers().markersFor(node, markerTypes).size();
    821821}
    822822
     
    834834    }
    835835
    836     Vector<DocumentMarker*> markers = node->document()->markers()->markersFor(node, markerTypes);
     836    Vector<DocumentMarker*> markers = node->document()->markers().markersFor(node, markerTypes);
    837837    if (markers.size() <= index)
    838838        return 0;
     
    859859{
    860860    range->ownerDocument()->updateLayoutIgnorePendingStylesheets();
    861     range->ownerDocument()->markers()->addTextMatchMarker(range, isActive);
     861    range->ownerDocument()->markers().addTextMatchMarker(range, isActive);
    862862}
    863863
  • trunk/Source/WebKit/blackberry/ChangeLog

    r154286 r154348  
     12013-08-20  Pratik Solanki  <psolanki@apple.com>
     2
     3        <https://webkit.org/b/120029> Document::markers() should return a reference
     4
     5        Reviewed by Andreas Kling.
     6
     7        Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
     8        m_markers as const and initialize it in member initialization.
     9
     10        * WebKitSupport/InPageSearchManager.cpp:
     11        (BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
     12        (BlackBerry::WebKit::InPageSearchManager::setActiveMatchAndMarker):
     13        (BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
     14        * WebKitSupport/InputHandler.cpp:
     15        (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
     16        (BlackBerry::WebKit::InputHandler::addAttributedTextMarker):
     17        (BlackBerry::WebKit::InputHandler::removeAttributedTextMarker):
     18
    1192013-08-19  Pratik Solanki  <psolanki@apple.com>
    220
  • trunk/Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp

    r154286 r154348  
    190190                // because scopeStringMatches does not add any markers, it only counts the number.
    191191                // No need to unmarkAllTextMatches, it is already done from the caller because of newSearch
    192                 m_activeMatch->ownerDocument()->markers()->addTextMatchMarker(m_activeMatch.get(), true);
     192                m_activeMatch->ownerDocument()->markers().addTextMatchMarker(m_activeMatch.get(), true);
    193193                frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
    194194            }
     
    223223            // all matches but count them.
    224224            m_webPage->m_page->unmarkAllTextMatches();
    225             m_activeMatch->ownerDocument()->markers()->addTextMatchMarker(m_activeMatch.get(), true);
     225            m_activeMatch->ownerDocument()->markers().addTextMatchMarker(m_activeMatch.get(), true);
    226226            frame->editor().setMarkedTextMatchesAreHighlighted(true /* highlight */);
    227227        }
     
    249249    if (m_activeMatch.get()) {
    250250        if (Document* doc = m_activeMatch->ownerDocument())
    251             doc->markers()->setMarkersActive(m_activeMatch.get(), false);
     251            doc->markers().setMarkersActive(m_activeMatch.get(), false);
    252252    }
    253253
     
    255255    if (m_activeMatch.get()) {
    256256        if (Document* doc = m_activeMatch->ownerDocument())
    257             doc->markers()->setMarkersActive(m_activeMatch.get(), true);
     257            doc->markers().setMarkersActive(m_activeMatch.get(), true);
    258258    }
    259259}
     
    344344        }
    345345        if (!locateActiveMatchOnly && m_highlightAllMatches)
    346             resultRange->ownerDocument()->markers()->addTextMatchMarker(resultRange.get(), foundActiveMatch);
     346            resultRange->ownerDocument()->markers().addTextMatchMarker(resultRange.get(), foundActiveMatch);
    347347
    348348        searchRange->setStart(resultRange->endContainer(ec), resultRange->endOffset(ec), ec);
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r154286 r154348  
    765765    ASSERT(document);
    766766
    767     RenderedDocumentMarker* marker = document->markers()->renderedMarkerContainingPoint(contentPos, DocumentMarker::Spelling);
     767    RenderedDocumentMarker* marker = document->markers().renderedMarkerContainingPoint(contentPos, DocumentMarker::Spelling);
    768768    if (!marker)
    769769        return false;
     
    19571957
    19581958    RefPtr<Range> markerRange = DOMSupport::visibleSelectionForRangeInputElement(m_currentFocusElement.get(), start, end).toNormalizedRange();
    1959     m_currentFocusElement->document()->markers()->addMarker(markerRange.get(), DocumentMarker::AttributeText, WTF::String("Input Marker"), style);
     1959    m_currentFocusElement->document()->markers().addMarker(markerRange.get(), DocumentMarker::AttributeText, WTF::String("Input Marker"), style);
    19601960}
    19611961
     
    19641964    // Remove all attribute text markers.
    19651965    if (m_currentFocusElement && m_currentFocusElement->document())
    1966         m_currentFocusElement->document()->markers()->removeMarkers(DocumentMarker::AttributeText);
     1966        m_currentFocusElement->document()->markers().removeMarkers(DocumentMarker::AttributeText);
    19671967
    19681968    m_composingTextStart = 0;
  • trunk/Source/WebKit/efl/ChangeLog

    r154286 r154348  
     12013-08-20  Pratik Solanki  <psolanki@apple.com>
     2
     3        <https://webkit.org/b/120029> Document::markers() should return a reference
     4
     5        Reviewed by Andreas Kling.
     6
     7        Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
     8        m_markers as const and initialize it in member initialization.
     9
     10        * ewk/ewk_frame.cpp:
     11        (ewk_frame_text_matches_unmark_all):
     12        (ewk_frame_text_matches_nth_pos_get):
     13
    1142013-08-19  Pratik Solanki  <psolanki@apple.com>
    215
  • trunk/Source/WebKit/efl/ewk/ewk_frame.cpp

    r154286 r154348  
    519519    EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
    520520
    521     smartData->frame->document()->markers()->removeMarkers(WebCore::DocumentMarker::TextMatch);
     521    smartData->frame->document()->markers().removeMarkers(WebCore::DocumentMarker::TextMatch);
    522522    return true;
    523523}
     
    559559    EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
    560560
    561     Vector<WebCore::IntRect> intRects = smartData->frame->document()->markers()->renderedRectsForMarkers(WebCore::DocumentMarker::TextMatch);
     561    Vector<WebCore::IntRect> intRects = smartData->frame->document()->markers().renderedRectsForMarkers(WebCore::DocumentMarker::TextMatch);
    562562
    563563    /* remove useless values */
  • trunk/Source/WebKit/mac/ChangeLog

    r154314 r154348  
     12013-08-20  Pratik Solanki  <psolanki@apple.com>
     2
     3        <https://webkit.org/b/120029> Document::markers() should return a reference
     4
     5        Reviewed by Andreas Kling.
     6
     7        Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
     8        m_markers as const and initialize it in member initialization.
     9
     10        * WebView/WebFrame.mm:
     11        (-[WebFrame _unmarkAllBadGrammar]):
     12        (-[WebFrame _unmarkAllMisspellings]):
     13        * WebView/WebHTMLView.mm:
     14        (-[WebHTMLView unmarkAllTextMatches]):
     15        (-[WebHTMLView rectsForTextMatches]):
     16
    1172013-08-19  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebKit/mac/WebView/WebFrame.mm

    r154286 r154348  
    394394    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
    395395        if (Document* document = frame->document())
    396             document->markers()->removeMarkers(DocumentMarker::Grammar);
     396            document->markers().removeMarkers(DocumentMarker::Grammar);
    397397    }
    398398}
     
    403403    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
    404404        if (Document* document = frame->document())
    405             document->markers()->removeMarkers(DocumentMarker::Spelling);
     405            document->markers().removeMarkers(DocumentMarker::Spelling);
    406406    }
    407407}
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r154314 r154348  
    60826082    if (!document)
    60836083        return;
    6084     document->markers()->removeMarkers(DocumentMarker::TextMatch);
     6084    document->markers().removeMarkers(DocumentMarker::TextMatch);
    60856085}
    60866086
     
    60946094        return [NSArray array];
    60956095
    6096     Vector<IntRect> rects = document->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
     6096    Vector<IntRect> rects = document->markers().renderedRectsForMarkers(DocumentMarker::TextMatch);
    60976097    unsigned count = rects.size();
    60986098    NSMutableArray *result = [NSMutableArray arrayWithCapacity:count];
  • trunk/Source/WebKit/win/ChangeLog

    r154286 r154348  
     12013-08-20  Pratik Solanki  <psolanki@apple.com>
     2
     3        <https://webkit.org/b/120029> Document::markers() should return a reference
     4
     5        Reviewed by Andreas Kling.
     6
     7        Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
     8        m_markers as const and initialize it in member initialization.
     9
     10        * WebFrame.cpp:
     11        (WebFrame::unmarkAllMisspellings):
     12        (WebFrame::unmarkAllBadGrammar):
     13        * WebView.cpp:
     14        (WebView::rectsForTextMatches):
     15
    1162013-08-19  Pratik Solanki  <psolanki@apple.com>
    217
  • trunk/Source/WebKit/win/WebFrame.cpp

    r154286 r154348  
    25512551            return;
    25522552
    2553         doc->markers()->removeMarkers(DocumentMarker::Spelling);
     2553        doc->markers().removeMarkers(DocumentMarker::Spelling);
    25542554    }
    25552555}
     
    25632563            return;
    25642564
    2565         doc->markers()->removeMarkers(DocumentMarker::Grammar);
     2565        doc->markers().removeMarkers(DocumentMarker::Grammar);
    25662566    }
    25672567}
  • trunk/Source/WebKit/win/WebView.cpp

    r154286 r154348  
    35393539        if (Document* document = frame->document()) {
    35403540            IntRect visibleRect = frame->view()->visibleContentRect();
    3541             Vector<IntRect> frameRects = document->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
     3541            Vector<IntRect> frameRects = document->markers().renderedRectsForMarkers(DocumentMarker::TextMatch);
    35423542            IntPoint frameOffset(-frame->view()->scrollOffset().width(), -frame->view()->scrollOffset().height());
    35433543            frameOffset = frame->view()->convertToContainingWindow(frameOffset);
  • trunk/Source/WebKit2/ChangeLog

    r154335 r154348  
     12013-08-20  Pratik Solanki  <psolanki@apple.com>
     2
     3        <https://webkit.org/b/120029> Document::markers() should return a reference
     4
     5        Reviewed by Andreas Kling.
     6
     7        Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
     8        m_markers as const and initialize it in member initialization.
     9
     10        * WebProcess/WebPage/FindController.cpp:
     11        (WebKit::FindController::rectsForTextMatches):
     12        * WebProcess/WebPage/WebPage.cpp:
     13        (WebKit::WebPage::unmarkAllMisspellings):
     14        (WebKit::WebPage::unmarkAllBadGrammar):
     15
    1162013-08-20  Gavin Barraclough  <barraclough@apple.com>
    217
  • trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp

    r154286 r154348  
    357357
    358358        IntRect visibleRect = frame->view()->visibleContentRect();
    359         Vector<IntRect> frameRects = document->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
     359        Vector<IntRect> frameRects = document->markers().renderedRectsForMarkers(DocumentMarker::TextMatch);
    360360        IntPoint frameOffset(-frame->view()->scrollOffsetRelativeToDocument().width(), -frame->view()->scrollOffsetRelativeToDocument().height());
    361361        frameOffset = frame->view()->convertToContainingWindow(frameOffset);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r154286 r154348  
    29522952    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
    29532953        if (Document* document = frame->document())
    2954             document->markers()->removeMarkers(DocumentMarker::Spelling);
     2954            document->markers().removeMarkers(DocumentMarker::Spelling);
    29552955    }
    29562956}
     
    29602960    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
    29612961        if (Document* document = frame->document())
    2962             document->markers()->removeMarkers(DocumentMarker::Grammar);
     2962            document->markers().removeMarkers(DocumentMarker::Grammar);
    29632963    }
    29642964}
Note: See TracChangeset for help on using the changeset viewer.