Index: html/HTMLHtmlElement.cpp |
=================================================================== |
--- html/HTMLHtmlElement.cpp (revision 44202) |
+++ html/HTMLHtmlElement.cpp (working copy) |
@@ -23,14 +23,49 @@ |
#include "config.h" |
#include "HTMLHtmlElement.h" |
-#include "ApplicationCacheGroup.h" |
#include "Document.h" |
#include "HTMLNames.h" |
+// FIXME: The use of these two flags to should be a temporary situation. |
+// Eventually we should use ENABLE(APPLICATION_CACHE) for this feature in |
+// all cases. |
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) && ENABLE(APPLICATION_CACHE) |
+#error APPLICATION_CACHE and OFFLINE_WEB_APPLICATIONS are mutually exclusive flags |
+#endif |
+ |
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) |
+#include "ApplicationCacheGroup.h" |
+#elif ENABLE(APPLICATION_CACHE) |
+#include "Frame.h" |
+#include "FrameLoader.h" |
+#endif |
+ |
namespace WebCore { |
using namespace HTMLNames; |
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE) |
+ |
+static void selectCacheWithoutManifest(Frame* frame) |
+{ |
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) |
+ ApplicationCacheGroup::selectCacheWithoutManifestURL(frame); |
+#elif ENABLE(APPLICATION_CACHE) |
+ frame->loader()->selectApplicationCacheWithoutManifest(); |
+#endif |
+} |
+ |
+static void selectCacheWithManifest(Frame* frame, const KURL& manifestURL) |
+{ |
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) |
+ ApplicationCacheGroup::selectCache(frame, manifestURL); |
+#elif ENABLE(APPLICATION_CACHE) |
+ frame->loader()->selectApplicationCacheWithManifest(manifestURL); |
+#endif |
+} |
+ |
+#endif // ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE) |
+ |
HTMLHtmlElement::HTMLHtmlElement(const QualifiedName& tagName, Document* doc) |
: HTMLElement(tagName, doc) |
{ |
@@ -57,7 +92,7 @@ |
newChild->hasTagName(framesetTag) || newChild->hasTagName(noframesTag); |
} |
-#if ENABLE(OFFLINE_WEB_APPLICATIONS) |
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE) |
void HTMLHtmlElement::insertedIntoDocument() |
{ |
HTMLElement::insertedIntoDocument(); |
@@ -70,10 +105,10 @@ |
// Check the manifest attribute |
AtomicString manifest = getAttribute(manifestAttr); |
- if (manifest.isNull()) |
- ApplicationCacheGroup::selectCacheWithoutManifestURL(document()->frame()); |
+ if (manifest.isNull() || manifest.isEmpty()) |
+ selectCacheWithoutManifest(document()->frame()); |
else |
- ApplicationCacheGroup::selectCache(document()->frame(), document()->completeURL(manifest)); |
+ selectCacheWithManifest(document()->frame(), document()->completeURL(manifest)); |
} |
#endif |