|
Implement "replacement" text encoding.
The WHATWG Encoding Standard redefines certain legacy encodings
as that are only used as XSS attack vectors as aliases for an
abstract "replacement" encoding.
* Decode (of resources) terminates with a single U+FFFD.
* Encode (e.g. for form submissions) is treated as UTF-8.
* The JS TextDecoder API throws if the aliases are used.
* The "replacement" string itself isn't assigned any meaning.
The last note can violate assumptions that a codec's name
is always an alias for itself, so it is enforced at
the encoding lookup-by-name function and script entry points.
BUG= 277037
R=jshin@chromium.org,eseidel@chromium.org
Total comments: 1
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+624 lines, -34 lines) |
Patch |
 |
M |
LayoutTests/fast/encoding/api/ascii-supersets.html
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/api/ascii-supersets-expected.txt
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/api/encoding-labels.html
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/api/encoding-labels-expected.txt
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/api/legacy-encode-expected.txt
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/encoding/api/replacement-encoding.html
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+26 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/encoding/api/replacement-encoding-expected.txt
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
A |
LayoutTests/fast/encoding/api/resources/encodings.json
|
View
|
7
8
9
10
|
1 chunk |
+453 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/api/resources/shared.js
|
View
|
1
2
3
4
5
6
7
8
9
10
|
4 chunks |
+21 lines, -17 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/char-decoding.html
|
View
|
1
2
3
4
|
3 chunks |
+10 lines, -4 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/char-decoding-expected.txt
|
View
|
1
2
3
4
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/char-encoding.html
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
LayoutTests/fast/encoding/char-encoding-expected.txt
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
LayoutTests/fast/encoding/charset-replacement.html
|
View
|
1
2
3
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
A + |
LayoutTests/fast/encoding/charset-replacement-expected.png
|
View
|
|
Binary file |
0 comments
|
Download
|
 |
A + |
LayoutTests/fast/encoding/charset-replacement-expected.txt
|
View
|
1
2
3
|
0 chunks |
+-1 lines, --1 lines |
0 comments
|
Download
|
 |
M |
Source/modules/encoding/TextDecoder.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
A |
Source/wtf/text/TextCodecReplacement.h
|
View
|
1
2
3
4
6
7
8
9
|
1 chunk |
+28 lines, -0 lines |
0 comments
|
Download
|
 |
A |
Source/wtf/text/TextCodecReplacement.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+48 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/text/TextCodecUTF8.h
|
View
|
1
2
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/text/TextEncodingRegistry.cpp
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
Source/wtf/wtf.gypi
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
Total messages: 33 (0 generated)
|