diff options
author | Steve Block <steveblock@google.com> | 2011-06-10 16:52:27 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-14 01:14:02 +0100 |
commit | 54cdeeebc7adcbcd900e8b6a141a8cae27d9a631 (patch) | |
tree | 845b0d338b204a48560eca3b51b34cf92ed96840 /Source/WebCore/html/HTMLScriptElement.cpp | |
parent | d2c5226a647dc21d0c15267e09a3d19cf3e0d593 (diff) | |
download | external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.zip external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.gz external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.bz2 |
Merge WebKit at branches/chromium/742 r88085: Initial merge by git.
Change-Id: I0501b484b9528e31b0026e5ad64416dd6541cdde
Diffstat (limited to 'Source/WebCore/html/HTMLScriptElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLScriptElement.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/WebCore/html/HTMLScriptElement.cpp b/Source/WebCore/html/HTMLScriptElement.cpp index b56b375..f49038b 100644 --- a/Source/WebCore/html/HTMLScriptElement.cpp +++ b/Source/WebCore/html/HTMLScriptElement.cpp @@ -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 @@ void HTMLScriptElement::parseMappedAttribute(Attribute* attr) 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(); } |