| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
| 6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
| 7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
| 8 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 newSelectedSentence = VisibleSelection(startOfSentence(newStart)
, endOfSentence(newStart)); | 1676 newSelectedSentence = VisibleSelection(startOfSentence(newStart)
, endOfSentence(newStart)); |
| 1677 } | 1677 } |
| 1678 | 1678 |
| 1679 // When typing we check spelling elsewhere, so don't redo it here. | 1679 // When typing we check spelling elsewhere, so don't redo it here. |
| 1680 // If this is a change in selection resulting from a delete operation, | 1680 // If this is a change in selection resulting from a delete operation, |
| 1681 // oldSelection may no longer be in the document. | 1681 // oldSelection may no longer be in the document. |
| 1682 if (closeTyping && oldSelection.isContentEditable() && oldSelection.star
t().node() && oldSelection.start().node()->inDocument()) { | 1682 if (closeTyping && oldSelection.isContentEditable() && oldSelection.star
t().node() && oldSelection.start().node()->inDocument()) { |
| 1683 VisiblePosition oldStart(oldSelection.visibleStart()); | 1683 VisiblePosition oldStart(oldSelection.visibleStart()); |
| 1684 VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(old
Start, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary)); | 1684 VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(old
Start, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary)); |
| 1685 if (oldAdjacentWords != newAdjacentWords) { | 1685 if (oldAdjacentWords != newAdjacentWords) { |
| 1686 editor()->markMisspellings(oldAdjacentWords); | |
| 1687 if (isContinuousGrammarCheckingEnabled) { | 1686 if (isContinuousGrammarCheckingEnabled) { |
| 1688 VisibleSelection oldSelectedSentence = VisibleSelection(star
tOfSentence(oldStart), endOfSentence(oldStart)); | 1687 VisibleSelection oldSelectedSentence = VisibleSelection(star
tOfSentence(oldStart), endOfSentence(oldStart)); |
| 1689 if (oldSelectedSentence != newSelectedSentence) | 1688 editor()->markMisspellingsAndBadGrammar(oldAdjacentWords, ol
dSelectedSentence != newSelectedSentence, oldSelectedSentence); |
| 1690 editor()->markBadGrammar(oldSelectedSentence); | 1689 } else { |
| 1690 editor()->markMisspellingsAndBadGrammar(oldAdjacentWords, fa
lse, oldAdjacentWords); |
| 1691 } | 1691 } |
| 1692 } | 1692 } |
| 1693 } | 1693 } |
| 1694 | 1694 |
| 1695 // This only erases markers that are in the first unit (word or sentence
) of the selection. | 1695 // This only erases markers that are in the first unit (word or sentence
) of the selection. |
| 1696 // Perhaps peculiar, but it matches AppKit. | 1696 // Perhaps peculiar, but it matches AppKit. |
| 1697 if (RefPtr<Range> wordRange = newAdjacentWords.toNormalizedRange()) | 1697 if (RefPtr<Range> wordRange = newAdjacentWords.toNormalizedRange()) |
| 1698 document()->removeMarkers(wordRange.get(), DocumentMarker::Spelling)
; | 1698 document()->removeMarkers(wordRange.get(), DocumentMarker::Spelling)
; |
| 1699 if (RefPtr<Range> sentenceRange = newSelectedSentence.toNormalizedRange(
)) | 1699 if (RefPtr<Range> sentenceRange = newSelectedSentence.toNormalizedRange(
)) |
| 1700 document()->removeMarkers(sentenceRange.get(), DocumentMarker::Gramm
ar); | 1700 document()->removeMarkers(sentenceRange.get(), DocumentMarker::Gramm
ar); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 frameView->setParentVisible(true); | 1774 frameView->setParentVisible(true); |
| 1775 | 1775 |
| 1776 if (ownerRenderer()) | 1776 if (ownerRenderer()) |
| 1777 ownerRenderer()->setWidget(frameView); | 1777 ownerRenderer()->setWidget(frameView); |
| 1778 | 1778 |
| 1779 if (HTMLFrameOwnerElement* owner = ownerElement()) | 1779 if (HTMLFrameOwnerElement* owner = ownerElement()) |
| 1780 view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOf
f); | 1780 view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOf
f); |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 } // namespace WebCore | 1783 } // namespace WebCore |
| OLD | NEW |