Reviewed by Adam Roben and Anders Carlsson
authorsullivan@apple.com <sullivan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jan 2008 23:02:07 +0000 (23:02 +0000)
committersullivan@apple.com <sullivan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jan 2008 23:02:07 +0000 (23:02 +0000)
        - fixed <rdar://problem/5469398> Repro assertion failure in context menu code due to
          missing-but-expected Reload item

        * platform/ContextMenu.cpp:
        (WebCore::ContextMenu::populate):
        use isLoadingInAPISense when deciding whether to include Stop or Reload in context
        menu, to match the WebKit API

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

WebCore/ChangeLog
WebCore/platform/ContextMenu.cpp

index 6467fd173d604f2d38d1e14ac2a6674202e2a231..edb28bbca201430b841fd5765f03894d700cae43 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-09  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Adam Roben and Anders Carlsson
+        
+        - fixed <rdar://problem/5469398> Repro assertion failure in context menu code due to 
+          missing-but-expected Reload item
+
+        * platform/ContextMenu.cpp:
+        (WebCore::ContextMenu::populate):
+        use isLoadingInAPISense when deciding whether to include Stop or Reload in context
+        menu, to match the WebKit API
+
 2008-01-09  Mark Rowe  <mrowe@apple.com>
 
         Fix Windows debug build for opensource developers.
index 0dd6be4797b6d341b4e511964577d0f57e089b76..6d23397de848cfe23a52e98be536e8ff81f540ee 100644 (file)
@@ -31,6 +31,7 @@
 #include "CSSPropertyNames.h"
 #include "ContextMenuController.h"
 #include "Document.h"
+#include "DocumentLoader.h"
 #include "Editor.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -274,7 +275,9 @@ void ContextMenu::populate()
                 if (loader->canGoBackOrForward(1))
                     appendItem(ForwardItem);
 
-                if (loader->isLoading())
+                // use isLoadingInAPISense rather than isLoading because Stop/Reload are
+                // intended to match WebKit's API, not WebCore's internal notion of loading status
+                if (loader->documentLoader()->isLoadingInAPISense())
                     appendItem(StopItem);
                 else
                     appendItem(ReloadItem);