Addressed some of Geoff's comments.
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2007 02:59:17 +0000 (02:59 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2007 02:59:17 +0000 (02:59 +0000)
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent): Added a
FIXME.
* platform/ContextMenu.cpp:
(WebCore::ContextMenu::addInspectElementItem): Null-check
frame->page().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23681 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/ContextMenuController.cpp
WebCore/platform/ContextMenu.cpp

index 90554e0a03c361e1d0618ec8553b40cddaaec921..14ad2d21f956da701bb7661b0837374c508b91a5 100644 (file)
         Return "", not nil. This function never used to return nil, so let's not
         start now. I've filed <rdar://problem/5283271> to cover the documentation bug,
 
+2007-06-20  Adam Roben  <aroben@apple.com>
+
+        Addressed some of Geoff's comments.
+
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::handleContextMenuEvent): Added a
+        FIXME.
+        * platform/ContextMenu.cpp:
+        (WebCore::ContextMenu::addInspectElementItem): Null-check
+        frame->page().
+
 2007-06-20  Adam Roben  <aroben@apple.com>
 
         Fix crash in fast/dom/dir-no-body.html
index 660194448966f5496101626c694fb139709ffec4..65a89a14939ac3b68b28fb6fb3ffbfddc3580fba 100644 (file)
@@ -94,6 +94,9 @@ void ContextMenuController::handleContextMenuEvent(Event* event)
     m_contextMenu->populate();
     PlatformMenuDescription customMenu = m_client->getCustomMenuFromDefaultItems(m_contextMenu.get());
     m_contextMenu->setPlatformDescription(customMenu);
+
+    // FIXME: We should be asking Settings whether to include the Inspect
+    // Element item, rather than our client.
     if (m_client->shouldIncludeInspectElementItem())
         m_contextMenu->addInspectElementItem();
     event->setDefaultHandled();
index 205b5dbd78571b92b90f04d56ead4f6fd6b00930..ec68572f8d90964a0110769cd0cb4c5d6ba295eb 100644 (file)
@@ -387,11 +387,14 @@ void ContextMenu::addInspectElementItem()
     if (!frame)
         return;
 
-    if (!frame->page()->inspectorController())
+    Page* page = frame->page();
+    if (!page)
+        return;
+
+    if (!page->inspectorController())
         return;
 
     ContextMenuItem InspectElementItem(ActionType, ContextMenuItemTagInspectElement, contextMenuItemTagInspectElement());
-    // FIXME: Need to only add this if the developer tools preference is set
     appendItem(*separatorItem());
     appendItem(InspectElementItem);
 }