prototype: Merge [7066] from branches/1-5-1-1

This commit is contained in:
Sam Stephenson 2007-06-19 23:31:41 +00:00
parent d6bf5e40ce
commit f2d304b3ee
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
*SVN*
* Make document.getElementsByClassName match the WHATWG Web Applications 1.0 specification which was adopted in Firefox 3 (http://www.whatwg.org/specs/web-apps/current-work/#getelementsbyclassname). It now supports multiple class names given as a whitespace-separated list in a string. Array argument is not supported. The method will only return the nodes that match all the class names. In browsers that implement the method natively it will not be overwritten. Closes #8401. [Mislav Marohnić]
* Make document.getElementsByClassName match a subset of the WHATWG Web Applications 1.0 specification which was adopted in Firefox 3 (http://www.whatwg.org/specs/web-apps/current-work/#getelementsbyclassname). It now supports multiple class names given as a whitespace-separated list in a string. Array argument is not supported. The method will only return the nodes that match all the class names. In browsers that implement the method natively it will not be overwritten. Closes #8401. [Mislav Marohnić]
Example:
document.getElementsByClassName('foo bar')

View File

@ -438,9 +438,12 @@
var valid = '{test: \n\r"hello world!"}';
var invalid = '{test: "hello world!"';
var dangerous = '{});attackTarget = "attack succeeded!";({}';
var longString = '"' + '123456789\\"'.times(1000) + '"';
// use smaller huge string size for KHTML
var size = navigator.userAgent.include('KHTML') ? 20 : 100;
var longString = '"' + '123456789\\"'.times(size * 10) + '"';
var object = '{' + longString + ': ' + longString + '},';
var huge = '[' + object.times(100) + '{"test": 123}]';
var huge = '[' + object.times(size) + '{"test": 123}]';
assertEqual('hello world!', valid.evalJSON().test);
assertEqual('hello world!', valid.evalJSON(true).test);