Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: Source/WebCore/html/HTMLScriptElement.cpp

Issue 6962032: Merge 87361 - 2011-05-25 James Simonsen <simonjam@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/HTMLScriptElement.cpp
===================================================================
--- Source/WebCore/html/HTMLScriptElement.cpp (revision 87454)
+++ Source/WebCore/html/HTMLScriptElement.cpp (working copy)
@@ -29,6 +29,7 @@
#include "EventNames.h"
#include "HTMLNames.h"
#include "ScriptEventListener.h"
+#include "Settings.h"
#include "Text.h"
namespace WebCore {
@@ -81,8 +82,33 @@
HTMLElement::parseMappedAttribute(attr);
}
+static bool needsOldRequirejsQuirk(HTMLScriptElement* element)
+{
+ if (element->fastGetAttribute(typeAttr) != "script/cache")
+ return false;
+
+ Document* document = element->document();
+
+ const KURL& url = document->url();
+ if (!equalIgnoringCase(url.host(), "www.zipcar.com"))
+ return false;
+
+ Settings* settings = document->settings();
+ if (!settings)
+ return false;
+ if (!settings->needsSiteSpecificQuirks())
+ return false;
+
+ return true;
+}
+
void HTMLScriptElement::insertedIntoDocument()
{
+ if (needsOldRequirejsQuirk(this)) {
+ if (!asyncAttributeValue())
+ handleAsyncAttribute(); // Clear forceAsync, so this script loads in parallel, but executes in order.
+ setAttribute(typeAttr, "text/javascript");
+ }
HTMLElement::insertedIntoDocument();
ScriptElement::insertedIntoDocument();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698