Bug 148855 - Script element with an empty for or event attributes should not execute
Summary: Script element with an empty for or event attributes should not execute
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 150335
  Show dependency treegraph
 
Reported: 2015-09-04 17:04 PDT by Ryosuke Niwa
Modified: 2015-10-19 11:32 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.66 KB, patch)
2015-10-16 15:32 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2015-09-04 17:04:00 PDT
See https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script

When a script element has "for" or "event" attributes, we should not execute the script as a result of step 12.

This bug was found by the newly added test:
LayoutTests/http/tests/w3c/html/semantics/scripting-1/the-script-element/script-for-event.html
Comment 1 Radar WebKit Bug Importer 2015-09-04 17:05:45 PDT
<rdar://problem/22588156>
Comment 2 Chris Dumez 2015-10-16 15:32:29 PDT
Created attachment 263342 [details]
Patch
Comment 3 Darin Adler 2015-10-18 15:54:43 PDT
Comment on attachment 263342 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=263342&action=review

> Source/WebCore/dom/ScriptElement.cpp:372
>          forAttribute = forAttribute.stripWhiteSpace();

Looks like this uses the wrong stripping function; should be stripLeadingAndTrailingHTMLSpaces.
Comment 4 WebKit Commit Bot 2015-10-18 16:44:33 PDT
Comment on attachment 263342 [details]
Patch

Clearing flags on attachment: 263342

Committed r191270: <http://trac.webkit.org/changeset/191270>
Comment 5 WebKit Commit Bot 2015-10-18 16:44:38 PDT
All reviewed patches have been landed.  Closing bug.