| Index: chrome/common/extensions/docs/examples/api/fontSettings/popup.js
|
| diff --git a/chrome/common/extensions/docs/examples/api/fontSettings/popup.js b/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
|
| index 3b76828249080e5d70c0a1ae374b7c251d3b3d5d..e0654fefa480ffe62fc763d46d9021301627b6de 100644
|
| --- a/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
|
| +++ b/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
|
| @@ -22,13 +22,13 @@ var sampleTextDivIds = [
|
| var defaultSampleText = 'Lorem ipsum dolor sit amat.';
|
| var scriptSpecificSampleText = {
|
| // "Cyrllic script".
|
| - 'Cyrl': 'Lorem ipsum Кириллица',
|
| - 'Hang': 'Lorem ipsum 雪海泳 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날.',
|
| - 'Hans': 'Lorem ipsum 雪海泳 简体字。',
|
| - 'Hant': 'Lorem ipsum 雪海泳 繁體字。',
|
| - 'Hrkt': 'Lorem ipsum 雪海泳 バスを待ち大路の春をうたがはず。',
|
| - // "Khmer language".
|
| - 'Khmr': 'Lorem ipsum \u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A',
|
| + 'Cyrl': 'Кириллица',
|
| + 'Hans': '床前明月光,疑是地上霜。举头望明月,低头思故乡。',
|
| + 'Hant': '床前明月光,疑是地上霜。舉頭望明月,低頭思故鄉。',
|
| + 'Jpan': '吾輩は猫である。名前はまだ無い。',
|
| + // "Khmer language".
|
| + 'Khmr': '\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A',
|
| + 'Kore': '정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날.',
|
| };
|
|
|
| function getSelectedScript() {
|
| @@ -106,6 +106,13 @@ function getFontHandler(list) {
|
| };
|
| }
|
|
|
| +// Temporary workaround for https://bugs.webkit.org/show_bug.cgi?id=88845.
|
| +function getScriptUsedByWebKit(script) {
|
| + if (script == 'Jpan') return 'Hrkt';
|
| + if (script == 'Kore') return 'Hang';
|
| + return script;
|
| +}
|
| +
|
| // Called when the script list selection changes. Sets the selected value of
|
| // each font list to the current font setting, and updates the document's lang
|
| // so that the samples are shown in the current font setting.
|
| @@ -121,7 +128,7 @@ function updateFontListsForScript() {
|
| details.script = script;
|
| // For font selection it's the script code that matters, not language, so
|
| // just use en for lang.
|
| - document.body.lang = 'en-' + script;
|
| + document.body.lang = 'en-' + getScriptUsedByWebKit(script);
|
|
|
| chrome.experimental.fontSettings.getFont(details, getFontHandler(list));
|
| }
|
| @@ -181,9 +188,9 @@ function clearAllSettings() {
|
| "Beng", "Blis", "Bopo", "Brah", "Brai", "Bugi", "Buhd", "Cakm", "Cans",
|
| "Cari", "Cham", "Cher", "Cirt", "Copt", "Cprt", "Cyrl", "Cyrs", "Deva",
|
| "Dsrt", "Dupl", "Egyd", "Egyh", "Egyp", "Elba", "Ethi", "Geor", "Geok",
|
| - "Glag", "Goth", "Gran", "Grek", "Gujr", "Guru", "Hang", "Hani", "Hano",
|
| - "Hans", "Hant", "Hebr", "Hluw", "Hmng", "Hrkt", "Hung", "Inds", "Ital",
|
| - "Java", "Jurc", "Kali", "Khar", "Khmr", "Khoj", "Knda", "Kpel", "Kthi",
|
| + "Glag", "Goth", "Gran", "Grek", "Gujr", "Guru", "Hani", "Hano", "Hans",
|
| + "Hant", "Hebr", "Hluw", "Hmng", "Hung", "Inds", "Ital", "Java", "Jpan",
|
| + "Jurc", "Kali", "Khar", "Khmr", "Khoj", "Knda", "Kore", "Kpel", "Kthi",
|
| "Lana", "Laoo", "Latf", "Latg", "Latn", "Lepc", "Limb", "Lina", "Linb",
|
| "Lisu", "Loma", "Lyci", "Lydi", "Mand", "Mani", "Maya", "Mend", "Merc",
|
| "Mero", "Mlym", "Moon", "Mong", "Mroo", "Mtei", "Mymr", "Narb", "Nbat",
|
|
|