~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to WebCore/dom/ScriptElement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-03-17 15:05:11 UTC
  • mfrom: (1.2.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100317150511-nyun8s32wgt8dhh9
Tags: 1.1.90-1
* New upstream release
- This marks the preparation for the 1.2 stable branch
* debian/copyright:
- updated with changes since 1.1.22
* debian/libwebkit-1.0-2.symbols:
- added new API introduced in 1.1.23

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
        return;
178
178
 
179
179
    if (Frame* frame = m_element->document()->frame()) {
180
 
        if (!frame->script()->canExecuteScripts())
 
180
        if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
181
181
            return;
182
182
 
183
183
        m_evaluated = true;
246
246
    // and we support the for syntax in script tags, this check can be removed and we should just
247
247
    // return 'true' here.
248
248
    String forAttribute = m_scriptElement->forAttributeValue();
249
 
    return forAttribute.isEmpty();
 
249
    String eventAttribute = m_scriptElement->eventAttributeValue();
 
250
    if (forAttribute.isEmpty() || eventAttribute.isEmpty())
 
251
        return true;
 
252
    
 
253
    forAttribute = forAttribute.stripWhiteSpace();
 
254
    eventAttribute = eventAttribute.stripWhiteSpace();
 
255
    return equalIgnoringCase(forAttribute, "window") && (equalIgnoringCase(eventAttribute, "onload") || equalIgnoringCase(eventAttribute, "onload()"));
250
256
}
251
257
 
252
258
String ScriptElementData::scriptCharset() const