Last Comment Bug 685774 - Implement document.scripts
: Implement document.scripts
Status: RESOLVED FIXED
[mentor=bz]
: addon-compat, dev-doc-complete, html5
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: Masatoshi Kimura [:emk]
:
Mentors:
http://www.whatwg.org/specs/web-apps/...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-08 19:59 PDT by Masatoshi Kimura [:emk]
Modified: 2012-03-05 03:53 PST (History)
10 users (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (7.77 KB, patch)
2011-09-09 09:41 PDT, Masatoshi Kimura [:emk]
bzbarsky: review+
Details | Diff | Review
patch for check in (5.59 KB, patch)
2011-09-09 10:11 PDT, Masatoshi Kimura [:emk]
VYV03354: review+
Details | Diff | Review

Description Masatoshi Kimura [:emk] 2011-09-08 19:59:01 PDT
Firefox is the only browser which lacks a support for document.scripts.
Comment 1 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-08 20:07:29 PDT
This is pretty simple to implement.  Do you want to take a shot at it?
Comment 2 Masatoshi Kimura [:emk] 2011-09-09 09:41:06 PDT
Created attachment 559490 [details] [diff] [review]
patch

> This is pretty simple to implement.  Do you want to take a shot at it?
Yes, I'll take this bug.
Comment 3 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-09-09 09:52:08 PDT
Comment on attachment 559490 [details] [diff] [review]
patch

>+++ b/dom/tests/mochitest/whatwg/test_bug685774_document_scripts.html
>+  is(a.length, c, "unexpected count of scripe elements");

s/scripe/script/

r=me with that typo fixed.  Thank you!
Comment 4 Mounir Lamouri (:mounir) 2011-09-09 09:57:40 PDT
Comment on attachment 559490 [details] [diff] [review]
patch

Review of attachment 559490 [details] [diff] [review]:
-----------------------------------------------------------------

Could you name the test test_document_scripts.html instead (no need for the bug number)?

You could also do a test after calling:
document.createElement("script");
and another after adding this element to the DOM.

::: dom/tests/mochitest/whatwg/test_bug685774_document_scripts.html
@@ +36,5 @@
> +
> +  SimpleTest.finish();
> +}
> +
> +window.addEventListener('load', start, false);

Better to use addLoadEvent(start);
Comment 5 Masatoshi Kimura [:emk] 2011-09-09 10:11:22 PDT
Created attachment 559499 [details] [diff] [review]
patch for check in

Fixed review comments.
Comment 6 Justin Wood (:Callek) 2011-09-09 22:40:32 PDT
http://hg.mozilla.org/mozilla-central/rev/a739df5e7bc0
Comment 7 Ryan Jones 2011-09-10 02:30:12 PDT
Would this bug need the dev-doc-needed keyword marker?
Comment 8 Masatoshi Kimura [:emk] 2011-09-10 02:34:05 PDT
Sure.
Comment 9 Eric Shepherd [:sheppy] 2011-11-08 07:34:18 PST
Documented:

https://developer.mozilla.org/en/DOM/Document.scripts

Updated:

https://developer.mozilla.org/en/DOM/Document
https://developer.mozilla.org/en/DOM/HTMLCollection

And mentioned on Firefox 9 for developers.

Note You need to log in before you can comment on or make changes to this bug.