[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
oliver at apple.com
oliver at apple.com
Wed Dec 22 11:09:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 4637c32afc04dc248d717c7a29dd2e8a4b5bf480
Author: oliver at apple.com <oliver at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 14 01:02:12 2010 +0000
2010-07-13 Oliver Hunt <oliver at apple.com>
Reviewed by Gavin Barraclough.
ES5 requires BOMs to be treated as whitespace
https://bugs.webkit.org/show_bug.cgi?id=42218
Add BOM character to the Lexer's definition of whitespace,
and remove the logic that dealt with stripping BOMs and
caching the cleaned string.
* parser/Lexer.h:
(JSC::Lexer::isWhiteSpace):
* parser/SourceProvider.h:
(JSC::UStringSourceProvider::create):
(JSC::UStringSourceProvider::UStringSourceProvider):
* wtf/text/StringImpl.h:
2010-07-13 Oliver Hunt <oliver at apple.com>
Reviewed by Gavin Barraclough.
ES5 requires BOMs to be treated as whitespace
https://bugs.webkit.org/show_bug.cgi?id=42218
Update the fast/js/removing-Cf-characters to reflect
new behaviour. Update a whole group of sputnik results
that we now pass.
* fast/js/removing-Cf-characters-expected.txt:
* fast/js/script-tests/removing-Cf-characters.js:
* fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.1_T2-expected.txt:
* fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.4_T2-expected.txt:
* fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.1_T2-expected.txt:
* fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.4_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.1_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.2_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.1_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.2_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.1_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.2_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.1_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.2_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.1_T2-expected.txt:
* fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.2_T2-expected.txt:
2010-07-13 Oliver Hunt <oliver at apple.com>
Reviewed by Gavin Barraclough.
ES5 requires BOMs to be treated as whitespace
https://bugs.webkit.org/show_bug.cgi?id=42218
Remove BOM handling logic from WebCore Script objects.
* bindings/js/StringSourceProvider.h:
(WebCore::StringSourceProvider::StringSourceProvider):
* loader/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
(WebCore::CachedScript::script):
* loader/CachedScript.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index a14ac23..1972907 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-13 Oliver Hunt <oliver at apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ ES5 requires BOMs to be treated as whitespace
+ https://bugs.webkit.org/show_bug.cgi?id=42218
+
+ Add BOM character to the Lexer's definition of whitespace,
+ and remove the logic that dealt with stripping BOMs and
+ caching the cleaned string.
+
+ * parser/Lexer.h:
+ (JSC::Lexer::isWhiteSpace):
+ * parser/SourceProvider.h:
+ (JSC::UStringSourceProvider::create):
+ (JSC::UStringSourceProvider::UStringSourceProvider):
+ * wtf/text/StringImpl.h:
+
2010-07-13 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Darin Adler.
diff --git a/JavaScriptCore/parser/Lexer.h b/JavaScriptCore/parser/Lexer.h
index 5ab7ad7..c30ee1d 100644
--- a/JavaScriptCore/parser/Lexer.h
+++ b/JavaScriptCore/parser/Lexer.h
@@ -126,7 +126,7 @@ namespace JSC {
inline bool Lexer::isWhiteSpace(int ch)
{
- return isASCII(ch) ? (ch == ' ' || ch == '\t' || ch == 0xB || ch == 0xC) : WTF::Unicode::isSeparatorSpace(ch);
+ return isASCII(ch) ? (ch == ' ' || ch == '\t' || ch == 0xB || ch == 0xC) : (WTF::Unicode::isSeparatorSpace(ch) || ch == 0xFEFF);
}
inline bool Lexer::isLineTerminator(int ch)
diff --git a/JavaScriptCore/parser/SourceProvider.h b/JavaScriptCore/parser/SourceProvider.h
index 6b9c028..5a57542 100644
--- a/JavaScriptCore/parser/SourceProvider.h
+++ b/JavaScriptCore/parser/SourceProvider.h
@@ -60,9 +60,9 @@ namespace JSC {
class UStringSourceProvider : public SourceProvider {
public:
- static PassRefPtr<UStringSourceProvider> create(const UString& source, const UString& url, bool hasBOMs = true)
+ static PassRefPtr<UStringSourceProvider> create(const UString& source, const UString& url)
{
- return adoptRef(new UStringSourceProvider(source, url, hasBOMs));
+ return adoptRef(new UStringSourceProvider(source, url));
}
UString getRange(int start, int end) const
@@ -73,14 +73,10 @@ namespace JSC {
int length() const { return m_source.size(); }
private:
- UStringSourceProvider(const UString& source, const UString& url, bool hasBOMs)
+ UStringSourceProvider(const UString& source, const UString& url)
: SourceProvider(url)
, m_source(source)
{
- if (hasBOMs && m_source.size()) {
- bool scratch = false;
- m_source = UString(m_source.rep()->copyStringWithoutBOMs(false, scratch));
- }
}
UString m_source;
diff --git a/JavaScriptCore/wtf/text/StringImpl.h b/JavaScriptCore/wtf/text/StringImpl.h
index 17572f1..244009f 100644
--- a/JavaScriptCore/wtf/text/StringImpl.h
+++ b/JavaScriptCore/wtf/text/StringImpl.h
@@ -257,38 +257,6 @@ public:
memcpy(destination, source, numCharacters * sizeof(UChar));
}
- PassRefPtr<StringImpl> copyStringWithoutBOMs(bool definitelyHasBOMs, bool& hasBOMs)
- {
- static const UChar byteOrderMark = 0xFEFF;
- size_t i = 0;
- if (!definitelyHasBOMs) {
- hasBOMs = false;
- // ECMA-262 calls for stripping all Cf characters, but we only strip BOM characters.
- // See <https://bugs.webkit.org/show_bug.cgi?id=4931> for details.
- for (; i < m_length; i++) {
- if (UNLIKELY(m_data[i] == byteOrderMark)) {
- hasBOMs = true;
- break;
- }
- }
- if (!hasBOMs)
- return this;
- }
- hasBOMs = true;
- Vector<UChar> result;
- result.reserveInitialCapacity(m_length);
- size_t firstBOM = i;
- i = 0;
- for (; i < firstBOM; i++)
- result.append(m_data[i]);
- for (; i < m_length; i++) {
- UChar c = m_data[i];
- if (c != byteOrderMark)
- result.append(c);
- }
- return StringImpl::adopt(result);
- }
-
// Returns a StringImpl suitable for use on another thread.
PassRefPtr<StringImpl> crossThreadString();
// Makes a deep copy. Helpful only if you need to use a String on another thread
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 116b214..a9cb932 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,31 @@
+2010-07-13 Oliver Hunt <oliver at apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ ES5 requires BOMs to be treated as whitespace
+ https://bugs.webkit.org/show_bug.cgi?id=42218
+
+ Update the fast/js/removing-Cf-characters to reflect
+ new behaviour. Update a whole group of sputnik results
+ that we now pass.
+
+ * fast/js/removing-Cf-characters-expected.txt:
+ * fast/js/script-tests/removing-Cf-characters.js:
+ * fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.1_T2-expected.txt:
+ * fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.4_T2-expected.txt:
+ * fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.1_T2-expected.txt:
+ * fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.4_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.1_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.2_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.1_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.2_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.1_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.2_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.1_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.2_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.1_T2-expected.txt:
+ * fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.2_T2-expected.txt:
+
2010-07-13 Albert J. Wong <ajwong at chromium.org>
Unreviewed, add details to chromium test expectations.
diff --git a/LayoutTests/fast/js/removing-Cf-characters-expected.txt b/LayoutTests/fast/js/removing-Cf-characters-expected.txt
index cc4e22c..a84bc58 100644
--- a/LayoutTests/fast/js/removing-Cf-characters-expected.txt
+++ b/LayoutTests/fast/js/removing-Cf-characters-expected.txt
@@ -1,11 +1,14 @@
-This test checks that BOM is stripped from the source, but other Cf characters are not, despite what ECMA-262 says, see <https://bugs.webkit.org/show_bug.cgi?id=4931>.
+This test checks that BOM is treated as whitespace as required by ES5, but other Cf characters are not, despite what ECMA-262v3 says, see <https://bugs.webkit.org/show_bug.cgi?id=4931>.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS escape(testString) is '%u200F%u200E%AD%u2062%u200D%u200C%u200B'
-PASS escape(testString2) is '%u200F%u200E%AD%u2062%u200D%u200C%u200B'
+PASS escape(testString) is '%uFEFF%u200F%u200E%AD%u2062%u200D%u200C%u200B'
+PASS escape(testString2) is '%uFEFF%u200F%u200E%AD%u2062%u200D%u200C%u200B'
PASS 1 is 1
+PASS eval('""').length is 1
+PASS eval('""').charCodeAt(0) is 0xFEFF
+PASS ++1 /* BOM between the +'s */ is 1
PASS var ZWJ_Inside; threw exception SyntaxError: Parse error.
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/js/script-tests/removing-Cf-characters.js b/LayoutTests/fast/js/script-tests/removing-Cf-characters.js
index 651233b..93cfe60 100644
--- a/LayoutTests/fast/js/script-tests/removing-Cf-characters.js
+++ b/LayoutTests/fast/js/script-tests/removing-Cf-characters.js
@@ -1,7 +1,7 @@
description(
-"This test checks that BOM is stripped from the source, but other Cf characters are not, despite \
-what ECMA-262 says, see <https://bugs.webkit.org/show_bug.cgi?id=4931>."
+"This test checks that BOM is treated as whitespace as required by ES5, but other Cf characters are not, despite \
+what ECMA-262v3 says, see <https://bugs.webkit.org/show_bug.cgi?id=4931>."
);
@@ -14,13 +14,16 @@ what ECMA-262 says, see <https://bugs.webkit.org/show_bug.cgi?id=4931>."
// U+200C ZERO WIDTH NON-JOINER
// U+200B ZERO WIDTH SPACE
var testString = "";
-shouldBe('escape(testString)',"'%u200F%u200E%AD%u2062%u200D%u200C%u200B'");
+shouldBe('escape(testString)',"'%uFEFF%u200F%u200E%AD%u2062%u200D%u200C%u200B'");
var testString2 = eval('"\uFEFF\u200F\u200E\u00AD\u2062\u200D\u200C\u200B"');
-shouldBe('escape(testString2)',"'%u200F%u200E%AD%u2062%u200D%u200C%u200B'");
+shouldBe('escape(testString2)',"'%uFEFF%u200F%u200E%AD%u2062%u200D%u200C%u200B'");
// A BOM is inside "shouldBe".
-shouldBe("1", "1");
+shouldBe("1", "1");
+shouldBe('eval(\'"\uFEFF"\').length', '1');
+shouldBe('eval(\'"\uFEFF"\').charCodeAt(0)', '0xFEFF');
+shouldBe('+'+eval("\"\uFEFF\"")+'+1 /* BOM between the +\'s */', '1');
shouldThrow('var ZWJ_Inside;');
diff --git a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.1_T2-expected.txt
index 9dfbcbe..cddcd8e 100644
--- a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.8.5_A1.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.4_T2-expected.txt b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.4_T2-expected.txt
index d8c01c7..25e1080 100644
--- a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.4_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.4_T2-expected.txt
@@ -1,6 +1,6 @@
S7.8.5_A1.4_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.1_T2-expected.txt
index ae5d434..bee8286 100644
--- a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.8.5_A2.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.4_T2-expected.txt b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.4_T2-expected.txt
index 979d079..5f66621 100644
--- a/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.4_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.4_T2-expected.txt
@@ -1,6 +1,6 @@
S7.8.5_A2.4_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.1_T2-expected.txt
index e1abbc7..d380a03 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.2_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.2_T2-expected.txt
index 9c02fa0..3abcd84 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.2_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_218/S7.1_A2.2_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.2_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.1_T2-expected.txt
index e1abbc7..d380a03 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.2_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.2_T2-expected.txt
index 9c02fa0..3abcd84 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.2_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_320/S7.1_A2.2_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.2_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.1_T2-expected.txt
index e1abbc7..d380a03 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.2_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.2_T2-expected.txt
index 9c02fa0..3abcd84 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.2_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_410/S7.1_A2.2_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.2_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.1_T2-expected.txt
index e1abbc7..d380a03 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.2_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.2_T2-expected.txt
index 9c02fa0..3abcd84 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.2_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_500/S7.1_A2.2_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.2_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.1_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.1_T2-expected.txt
index e1abbc7..d380a03 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.1_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.1_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.1_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.2_T2-expected.txt b/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.2_T2-expected.txt
index 9c02fa0..3abcd84 100644
--- a/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.2_T2-expected.txt
+++ b/LayoutTests/fast/js/sputnik/Unicode/Unicode_510/S7.1_A2.2_T2-expected.txt
@@ -1,6 +1,6 @@
S7.1_A2.2_T2
-FAIL SputnikError: #FEFF
+PASS
TEST COMPLETE
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a287271..9650911 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-13 Oliver Hunt <oliver at apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ ES5 requires BOMs to be treated as whitespace
+ https://bugs.webkit.org/show_bug.cgi?id=42218
+
+ Remove BOM handling logic from WebCore Script objects.
+
+ * bindings/js/StringSourceProvider.h:
+ (WebCore::StringSourceProvider::StringSourceProvider):
+ * loader/CachedScript.cpp:
+ (WebCore::CachedScript::CachedScript):
+ (WebCore::CachedScript::script):
+ * loader/CachedScript.h:
+
2010-07-13 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Darin Adler.
diff --git a/WebCore/bindings/js/StringSourceProvider.h b/WebCore/bindings/js/StringSourceProvider.h
index 2a18006..478c1d1 100644
--- a/WebCore/bindings/js/StringSourceProvider.h
+++ b/WebCore/bindings/js/StringSourceProvider.h
@@ -49,10 +49,6 @@ namespace WebCore {
: ScriptSourceProvider(stringToUString(url))
, m_source(source)
{
- if (m_source.length()) {
- bool scratch = false;
- m_source = String(source.impl()->copyStringWithoutBOMs(false, scratch));
- }
}
String m_source;
diff --git a/WebCore/loader/CachedScript.cpp b/WebCore/loader/CachedScript.cpp
index e3d618a..58895d6 100644
--- a/WebCore/loader/CachedScript.cpp
+++ b/WebCore/loader/CachedScript.cpp
@@ -37,7 +37,6 @@ namespace WebCore {
CachedScript::CachedScript(const String& url, const String& charset)
: CachedResource(url, Script)
- , m_scriptHasBOMs(SourceCouldHaveBOMs)
, m_decoder(TextResourceDecoder::create("application/javascript", charset))
, m_decodedDataDeletionTimer(this, &CachedScript::decodedDataDeletionTimerFired)
{
@@ -73,14 +72,8 @@ const String& CachedScript::script()
if (!m_script && m_data) {
m_script = m_decoder->decode(m_data->data(), encodedSize());
m_script += m_decoder->flush();
- if (m_scriptHasBOMs != SourceHasNoBOMs && m_script.length()) {
- bool hasBOMs = false;
- m_script = String(m_script.impl()->copyStringWithoutBOMs(m_scriptHasBOMs == SourceHasBOMs, hasBOMs));
- m_scriptHasBOMs = hasBOMs ? SourceHasBOMs : SourceHasNoBOMs;
- }
setDecodedSize(m_script.length() * sizeof(UChar));
}
-
m_decodedDataDeletionTimer.startOneShot(0);
return m_script;
}
diff --git a/WebCore/loader/CachedScript.h b/WebCore/loader/CachedScript.h
index dff49c3..6b81fda 100644
--- a/WebCore/loader/CachedScript.h
+++ b/WebCore/loader/CachedScript.h
@@ -58,7 +58,6 @@ namespace WebCore {
void decodedDataDeletionTimerFired(Timer<CachedScript>*);
String m_script;
- enum { SourceHasNoBOMs, SourceCouldHaveBOMs, SourceHasBOMs } m_scriptHasBOMs;
RefPtr<TextResourceDecoder> m_decoder;
Timer<CachedScript> m_decodedDataDeletionTimer;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list