[Webkit-unassigned] [Bug 54230] [GTK] Implement WebPage class for WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 21 16:25:14 PDT 2011


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





--- Comment #15 from Anders Carlsson <andersca at apple.com>  2011-03-21 16:25:14 PST ---
(From update of attachment 86284)
View in context: https://bugs.webkit.org/attachment.cgi?id=86284&action=review

> Source/WebKit2/UIProcess/gtk/WebView.cpp:300
> +    m_pendingEditorCommands = &commandsList;

Taking a pointer of a stack-based object like this is dangerous. What ensures that we don't end up with a dangling pointer here? Could we fix it in some other way?

> Source/WebKit2/UIProcess/gtk/WebView.cpp:309
> +    if (m_pendingEditorCommands->size() > 0)
> +        return;

This should be 

if (!m_pendingEditorCommands.isEmpty())

> Source/WebKit2/UIProcess/gtk/WebView.cpp:312
> +    static HashMap<int, const char*> keyDownCommandsMap;
> +    static HashMap<int, const char*> keyPressCommandsMap;

These should use the DEFINE_STATIC_LOCAL to avoid exit-time destructors.

> Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:78
> +    if (pendingEditorCommands.size() > 0) {

It's better to do 

if (!pendingEditorCommands.isEmpty()) {

> Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:122
> +        } else {
> +            // Don't insert null or control characters as they can result in unexpected behaviour
> +            if (event->charCode() < ' ')
> +                return;
> +
> +            // Don't insert anything if a modifier is pressed
> +            if (platformEvent->ctrlKey() || platformEvent->altKey())
> +                return;
> +
> +            if (frame->editor()->insertText(platformEvent->text(), event))
> +                event->setDefaultHandled();
> +        }

This entire block has wrong indentation.

-- 
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