[Webkit-unassigned] [Bug 56055] Hook up new AppKit autocorrection UI with WK2.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 16 12:10:27 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=56055
Darin Adler <darin at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #85249|review? |review-
Flag| |
--- Comment #2 from Darin Adler <darin at apple.com> 2011-03-16 12:10:27 PST ---
(From update of attachment 85249)
View in context: https://bugs.webkit.org/attachment.cgi?id=85249&action=review
Looking pretty good. Still needs a little work.
> Source/WebCore/editing/Editor.h:426
> void dismissCorrectionPanel(ReasonForDismissingCorrectionPanel);
> + void dismissCorrectionPanel(ReasonForDismissingCorrectionPanel, String& result);
A more usual idiom for this would be to name the asynchronous version dismissCorrectionPanelSoon and use a normal return value for the synchronous version. Overloading based on an out parameter seems a little awkward to me.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.h:37
> +class CorrectionPanelMac {
Not sure this class needs the word Mac in its name.
Should be marked noncopyable.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.h:48
> + void doDismiss(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally);
Not a great name for this function. It’s unclear how dismiss is different from doDismiss.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.h:50
> + bool m_dismissedExternally;
Normally we would call this m_wasDismissedExternally.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.h:54
> + WebView* m_view;
> + NSString* m_resultForSynchronousDismissal;
> + NSCondition* m_resultCondition;
For Objective-C classes we normally use a different style of where to put the*.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.mm:40
> + case CorrectionPanelInfo::PanelTypeCorrection:
> + return NSCorrectionBubbleTypeCorrection;
> + case CorrectionPanelInfo::PanelTypeReversion:
> + return NSCorrectionBubbleTypeReversion;
> + case CorrectionPanelInfo::PanelTypeSpellingSuggestions:
> + return NSCorrectionBubbleTypeGuesses;
This is not the WebKit style of how to line up switch statements.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.mm:52
> + m_resultCondition = [[NSCondition alloc] init];
This won’t work under GC. You need to have m_resultCondition be a RetainPtr instead.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.mm:60
> + [m_resultCondition release];
> + if (m_resultForSynchronousDismissal)
> + [m_resultForSynchronousDismissal release];
These won’t work under GC. Both m_resultCondition and m_resultForSynchronousDismissal should be RetainPtr.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.mm:133
> + result = String(m_resultForSynchronousDismissal);
The explicit String() should not be needed here.
> Source/WebKit/mac/WebCoreSupport/CorrectionPanelMac.mm:152
> + if (reason == ReasonForDismissingCorrectionPanelAccepted)
> + [[NSSpellChecker sharedSpellChecker] dismissCorrectionBubbleForView:m_view];
> + else
> + [[NSSpellChecker sharedSpellChecker] cancelCorrectionBubbleForView:m_view];
> + m_view = 0;
What’s the guarantee that m_view is still good here? I suggest making it a RetainPtr.
> Source/WebKit/mac/WebView/WebView.mm:5315
> + coreFrame->editor()->handleCorrectionPanelResult(String(result));
Should not need an explicit String() here.
> Source/WebKit2/UIProcess/API/mac/PageClientImpl.h:116
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm:446
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm:455
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm:462
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm:471
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/API/mac/WKView.mm:2050
> + _data->_page->handleCorrectionPanelResult(WTF::String(result));
Should not need an existing WTF::String here.
> Source/WebKit2/UIProcess/WebPageProxy.cpp:2805
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/WebPageProxy.cpp:2885
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/WebPageProxy.h:657
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/WebPageProxy.messages.in:212
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/WebPageProxy.messages.in:214
> + ShowCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType panelType, WebCore::FloatRect boundingBoxOfReplacedString, WTF::String replacedString, WTF::String replacementString, Vector<WTF::String> alternativeReplacementStrings)
We normally just use integers instead of adding enums to the cross process machinery for things like panelType.
> Source/WebKit2/UIProcess/WebPageProxy.messages.in:217
> + RecordAutocorrectionResponse(WebCore::EditorClient::AutocorrectionResponseType responseType, WTF::String replacedString, WTF::String replacementString);
We normally just use integers instead of adding enums to the cross process machinery for things like responseType.
> Source/WebKit2/UIProcess/mac/CorrectionPanelMac.h:29
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/UIProcess/mac/CorrectionPanelMac.mm:27
> +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:249
> #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2110
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/WebProcess/WebPage/WebPage.h:359
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
> Source/WebKit2/WebProcess/WebPage/WebPage.messages.in:196
> +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
WebKit2 doesn’t support Tiger or Leopard, so there is no need to mention them here.
--
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