Closed
Bug 1286321
Opened 8 years ago
Closed 8 years ago
script element: language attribute overrides type attribute when type is empty string
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: deckycoss, Assigned: deckycoss)
Details
Attachments
(1 file)
according to the HTML standard, when a script element contains both a type attribute and a language attribute, the latter must be ignored, even if the value of the former is the empty string. (see step 6: https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script) however, this test shows that the language attribute is used when the type is set to the empty string: http://w3c-test.org/html/semantics/scripting-1/the-script-element/script-language-type.html
Assignee | ||
Comment 1•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64280/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/64280/
Attachment #8771021 -
Flags: review?(bkelly)
Assignee | ||
Comment 2•8 years ago
|
||
Comment on attachment 8771021 [details] Bug 1286321: always ignore language attribute when processing script element if type attribute is defined; Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64280/diff/1-2/
Comment 3•8 years ago
|
||
Would it make sense to just have GetScriptType return a boolean indicating whether there is an actual type? That way you don't have to walk the attributes twice...
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #3) > Would it make sense to just have GetScriptType return a boolean indicating > whether there is an actual type? That way you don't have to walk the > attributes twice... i wondered about that too. maybe GetScriptType can call GetAttr directly instead of calling GetType?
Comment 5•8 years ago
|
||
Indeed. And then GetType() can call GetScriptType if we want to avoid the code duplication.
Comment 6•8 years ago
|
||
Comment on attachment 8771021 [details] Bug 1286321: always ignore language attribute when processing script element if type attribute is defined; Redirecting to Boris since he has opinions here.
Attachment #8771021 -
Flags: review?(bkelly) → review?(bzbarsky)
Assignee | ||
Comment 7•8 years ago
|
||
Comment on attachment 8771021 [details] Bug 1286321: always ignore language attribute when processing script element if type attribute is defined; Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64280/diff/2-3/
Updated•8 years ago
|
Attachment #8771021 -
Flags: review?(bzbarsky) → review+
Comment 8•8 years ago
|
||
Comment on attachment 8771021 [details] Bug 1286321: always ignore language attribute when processing script element if type attribute is defined; https://reviewboard.mozilla.org/r/64280/#review61360 ::: dom/base/nsIScriptElement.h:55 (Diff revision 3) > > /** > * Content type identifying the scripting language. Can be empty, in > * which case javascript will be assumed. > */ > - virtual void GetScriptType(nsAString& type) = 0; > + virtual bool GetScriptType(nsAString& type) = 0; Please document what the return value means. r=me
Assignee | ||
Comment 9•8 years ago
|
||
Comment on attachment 8771021 [details] Bug 1286321: always ignore language attribute when processing script element if type attribute is defined; Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64280/diff/3-4/
Assignee | ||
Comment 10•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cfb014a0f49f&selectedJob=24061277
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 11•8 years ago
|
||
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/264ffcf6eb58 always ignore language attribute when processing script element if type attribute is defined. r=bz
Keywords: checkin-needed
Comment 12•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/264ffcf6eb58
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•