[Webkit-unassigned] [Bug 55571] [Refactoring] Auto correction panel should be handled by its own class.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 16 15:30:10 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=55571





--- Comment #9 from jpu at apple.com  2011-03-16 15:30:10 PST ---
(From update of attachment 85922)
View in context: https://bugs.webkit.org/attachment.cgi?id=85922&action=review

> Source/WebCore/editing/CorrectionPanelController.h:72
> +class CorrectionPanelController {

We probably should call it SpellingCorrectionController, since it does more than just managing the panel UI. For instance, it also monitor undone autocorrection, and manager markers accordingly.

> Source/WebCore/editing/CorrectionPanelController.h:85
> +    void unappliedSpellCorrection(const VisibleSelection& selectionOfCorrected, const String& corrected, const String& correction);
> +    void appliedEditing(PassRefPtr<EditCommand>);

Shall we call them respondToUnappliedSpellCorrection() and respondToAppliedEditing()?

> Source/WebCore/editing/Editor.cpp:1061
>  Editor::~Editor()

I suppose we could remove the empty destructor now.

> Source/WebCore/editing/Editor.cpp:2490
> -void Editor::applyCorrectionPanelInfo(const Vector<DocumentMarker::MarkerType>& markerTypesToAdd)
> +void Editor::prepareEditingWord(bool doNotRemoveIfSelectionAtWordBoundary)

Given the new function name, the argument name isn't very clear anymore. The purpose of this function is to remove markers on the word we are about to edit and that we have just edited. The argument indicates whether we want to handle a word if the selection is on word boundary. Maybe we could name it updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection). We could also remove removeSpellAndCorrectionMarkersFromWordsToBeEdited(), since all prepareEditingWord() does is to call removeSpellAndCorrectionMarkersFromWordsToBeEdited().

>> Source/WebCore/editing/Editor.cpp:-3521
>> -#endif
> 
> Ditto.

I'm almost certain we shouldn't remove this #if. It will change the behavior on current Mac OS X.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list