|
Prevent direct use of "replacement" text encoding.
The "replacement" encoding defined in the WHATWG Encoding Standard
is a spec convenience, and not intended to be referenced directly.
There are several aliases for it (for some legacy encodings) but
neither content nor script should be able to use it by name.
Since most of wtf/text assumes that a codec's name is an alias for
itself, leave that invariant intact. Make TextEncoding (the API
for resolving an encoding by name) mark a direct reference as invalid,
(treating it as any other unknown string, i.e. use locale's default
codec) and throw if the name is used from script (per spec)
This is dependent on http://crrev.com/265973003
BUG= 277037
R=jshin@chromium.org,eseidel@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174047
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+67 lines, -28 lines) |
Patch |
|
A |
LayoutTests/fast/encoding/api/replacement-encoding.html
|
View
|
|
1 chunk |
+26 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/encoding/api/replacement-encoding-expected.txt
|
View
|
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/encoding/charset-replacement-expected.txt
|
View
|
1
2
|
1 chunk |
+5 lines, -7 lines |
0 comments
|
Download
|
|
D |
LayoutTests/platform/linux/fast/encoding/charset-replacement-expected.png
|
View
|
1
|
Binary file |
0 comments
|
Download
|
|
D |
LayoutTests/platform/mac/fast/encoding/charset-replacement-expected.png
|
View
|
1
|
Binary file |
0 comments
|
Download
|
|
D |
LayoutTests/platform/mac/fast/encoding/charset-replacement-expected.txt
|
View
|
1
|
1 chunk |
+0 lines, -7 lines |
0 comments
|
Download
|
|
D |
LayoutTests/platform/win-xp/fast/encoding/charset-replacement-expected.png
|
View
|
1
|
Binary file |
0 comments
|
Download
|
|
D |
LayoutTests/platform/win-xp/fast/encoding/charset-replacement-expected.txt
|
View
|
1
|
1 chunk |
+0 lines, -7 lines |
0 comments
|
Download
|
|
D |
LayoutTests/platform/win/fast/encoding/charset-replacement-expected.png
|
View
|
1
|
Binary file |
0 comments
|
Download
|
|
M |
Source/modules/encoding/TextDecoder.cpp
|
View
|
1
2
3
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/wtf/text/TextCodecReplacement.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/wtf/text/TextCodecReplacementTest.cpp
|
View
|
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/wtf/text/TextEncoding.cpp
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/wtf/text/TextEncodingRegistry.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/wtf/text/TextEncodingRegistry.cpp
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
Total messages: 6 (0 generated)
|