From f2d304b3eebdb46665eb3935632ec138eddc2a30 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 19 Jun 2007 23:31:41 +0000 Subject: [PATCH] prototype: Merge [7066] from branches/1-5-1-1 --- CHANGELOG | 2 +- test/unit/string.html | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2e835bc..139c2ba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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') diff --git a/test/unit/string.html b/test/unit/string.html index 0cf7b0f..30ec773 100644 --- a/test/unit/string.html +++ b/test/unit/string.html @@ -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);