зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1381744 - New web-platform test case for data:font same-origin check. r=heycam
MozReview-Commit-ID: AFSf532NLVl --HG-- extra : rebase_source : e14e43c4f21cda61c8f8d73849b234cc20fbc33f extra : intermediate-source : 2e8e6a40f41ab9aee1834c8124ed71591dfc547e extra : source : 3905490bbcaecbf00073d7afda9adcdd3d45ff96
This commit is contained in:
Родитель
7aba8fd282
Коммит
c59973e89a
|
@ -330453,6 +330453,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/css-fonts-3/test_datafont_same_origin.html": [
|
||||
[
|
||||
"/css/css-fonts-3/test_datafont_same_origin.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/css-fonts-3/test_font_family_parsing.html": [
|
||||
[
|
||||
"/css/css-fonts-3/test_font_family_parsing.html",
|
||||
|
@ -510454,6 +510460,10 @@
|
|||
"2a8f7afbb6ccfc4084534c36bd4cfeebcbae4194",
|
||||
"manual"
|
||||
],
|
||||
"css/css-fonts-3/test_datafont_same_origin.html": [
|
||||
"a793f06cceb92b34dc27728307995774a5d95b63",
|
||||
"testharness"
|
||||
],
|
||||
"css/css-fonts-3/test_font_family_parsing.html": [
|
||||
"fa926a9e86823cddea6d9f1418c752cf04e341ad",
|
||||
"testharness"
|
||||
|
@ -574339,11 +574349,11 @@
|
|||
"support"
|
||||
],
|
||||
"dom/nodes/Document-createEvent.html": [
|
||||
"9274ffffe1b08dee78b64ffc70582957f0386bca",
|
||||
"9d128acd63f3e972334d9a034e0c222495fd927e",
|
||||
"testharness"
|
||||
],
|
||||
"dom/nodes/Document-createEvent.js": [
|
||||
"6e7d9350e2fd9ffad36fddd4d90438d620c7dbf3",
|
||||
"5a8ecc8e5627e340eb10fdc91675968dc9b8fb98",
|
||||
"support"
|
||||
],
|
||||
"dom/nodes/Document-createProcessingInstruction-xhtml.xhtml": [
|
||||
|
@ -579755,7 +579765,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"html/browsers/browsing-the-web/history-traversal/PopStateEvent.html": [
|
||||
"2a7ed0827fc61af7b3bdd238577887aff1902ea7",
|
||||
"5a9c575a86adbbbca30734992b4d80c22f3973a1",
|
||||
"testharness"
|
||||
],
|
||||
"html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html": [
|
||||
|
@ -596407,7 +596417,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"intersection-observer/timestamp.html": [
|
||||
"a7084b2a0f359115a1862f3c0891ace8143dba83",
|
||||
"b9bf8d472d7751ec4a1ebee925d12668bedeee7a",
|
||||
"testharness"
|
||||
],
|
||||
"intersection-observer/unclipped-root.html": [
|
||||
|
@ -625023,7 +625033,7 @@
|
|||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/mouse.py": [
|
||||
"51ba095d3d754e30154c20b2910830c6d3e3410c",
|
||||
"d7af66e45c8e306b4258b92c54ed86073fd21c8d",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/sequence.py": [
|
||||
|
@ -625047,7 +625057,7 @@
|
|||
"support"
|
||||
],
|
||||
"webdriver/tests/actions/support/test_actions_wdspec.html": [
|
||||
"a5a1cbce9f0ef66c19065cb8ba761c8fd27cc4ac",
|
||||
"94b6f474bb4417cf2c06cb5fc6042c01bde98aa2",
|
||||
"support"
|
||||
],
|
||||
"webdriver/tests/conftest.py": [
|
||||
|
@ -639415,7 +639425,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"workers/Worker_dispatchEvent_ErrorEvent.htm": [
|
||||
"a1100df5a79ed7b484a8d5c5746bd646a165242b",
|
||||
"a27efcba6fcdbb34bb07ac8553a6bbfa04761008",
|
||||
"testharness"
|
||||
],
|
||||
"workers/Worker_script_mimetype.htm": [
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<title>data:font same-origin test</title>
|
||||
<link rel="author" title="Henry Chang" href="mailto:hchang@mozilla.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#font-prop" />
|
||||
<meta name="assert" content="tests data:font would be treated same origin." />
|
||||
<script type="text/javascript" src="/resources/testharness.js"></script>
|
||||
<script type="text/javascript" src="/resources/testharnessreport.js"></script>
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'DataFont';
|
||||
src: url(data:font/opentype;base64,AAEAAAANAIAAAwBQRkZUTU6u6MkAAAXcAAAAHE9TLzJWYWQKAAABWAAAAFZjbWFwAA8D7wAAAcAAAAFCY3Z0IAAhAnkAAAMEAAAABGdhc3D//wADAAAF1AAAAAhnbHlmCC6aTwAAAxQAAACMaGVhZO8ooBcAAADcAAAANmhoZWEIkAV9AAABFAAAACRobXR4EZQAhQAAAbAAAAAQbG9jYQBwAFQAAAMIAAAACm1heHAASQA9AAABOAAAACBuYW1lehAVOgAAA6AAAAIHcG9zdP+uADUAAAWoAAAAKgABAAAAAQAAMhPyuV8PPPUACwPoAAAAAMU4Lm0AAAAAxTgubQAh/5wFeAK8AAAACAACAAAAAAAAAAEAAAK8/5wAWgXcAAAAAAV4AAEAAAAAAAAAAAAAAAAAAAAEAAEAAAAEAAwAAwAAAAAAAgAAAAEAAQAAAEAALgAAAAAAAQXcAfQABQAAAooCvAAAAIwCigK8AAAB4AAxAQIAAAIABgkAAAAAAAAAAAABAAAAAAAAAAAAAAAAUGZFZABAAEEAQQMg/zgAWgK8AGQAAAABAAAAAAAABdwAIQAAAAAF3AAABdwAZAAAAAMAAAADAAAAHAABAAAAAAA8AAMAAQAAABwABAAgAAAABAAEAAEAAABB//8AAABB////wgABAAAAAAAAAQYAAAEAAAAAAAAAAQIAAAACAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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QACACQAAAAAAAH//wACAAAAAQAAAADEPovuAAAAAMU4Lm0AAAAAxTgubQ==);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<pre id="display"></pre>
|
||||
<style type="text/css" id="testbox"></style>
|
||||
|
||||
<script type="text/javascript">
|
||||
async_test(function(t) {
|
||||
var text = document.createElement('p');
|
||||
// Cross-domain font will not load according to [1] so we try to apply
|
||||
// data:font to this text and see if the font can be loaded.
|
||||
// [1] https://www.w3.org/TR/css-fonts-3/#same-origin-restriction
|
||||
text.style = 'font-family: DataFont';
|
||||
text.innerHTML = "This text should trigger 'TestFont' to load.";
|
||||
document.body.appendChild(text);
|
||||
|
||||
document.fonts.onloadingdone = function (fontFaceSetEvent) {
|
||||
assert_equals(fontFaceSetEvent.fontfaces.length, 1, "Same origin font should be loaded.");
|
||||
t.done();
|
||||
};
|
||||
document.fonts.onloadingerror = function (fontFaceSetEvent) {
|
||||
assert_unreached("data:font is not same origin!");
|
||||
};
|
||||
}, "Test if data:font would be treated same origin.")
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче