Skip to content
  • beidson@apple.com's avatar
    REGRESSION(r51097) - Unable to log in to statefarm.com · 2118e9f3
    beidson@apple.com authored
    <rdar://problem/7672667> and https://bugs.webkit.org/show_bug.cgi?id=35556
    
    Reviewed by Sam Weinig.
    
    WebCore: 
    
    Test: fast/loader/for-window-event-onload-scripts.html
    
    Match Gecko's rules for executing "for/event" scripts:
      -If there's only a 'for' attribute, execute it.
      -If there's only an 'event' attribute, execute it.
      -If there's a 'for=window' and 'event=onload', execute it.
      -If there's a 'for=window' and 'event=onload()', execute it.
      -If there's any other combination of both 'for' and 'event', don't execute it.
    
    * dom/ScriptElement.cpp:
    (WebCore::ScriptElementData::shouldExecuteAsJavaScript):
    * dom/ScriptElement.h:
    
    * html/HTMLScriptElement.cpp:
    (WebCore::HTMLScriptElement::eventAttributeValue):
    * html/HTMLScriptElement.h:
    
    * svg/SVGScriptElement.cpp:
    (WebCore::SVGScriptElement::eventAttributeValue):
    * svg/SVGScriptElement.h:
    
    Add the event attribute name:
    * html/HTMLAttributeNames.in:
    
    LayoutTests: 
    
    * fast/loader/for-window-event-onload-scripts-expected.txt: Added.
    * fast/loader/for-window-event-onload-scripts.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    2118e9f3