merge mozilla-central to autoland. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-10-13 11:51:55 +02:00
Родитель 85b882aef9 1c1a5cef77
Коммит 847d86fda7
172 изменённых файлов: 2407 добавлений и 2088 удалений

Просмотреть файл

@ -23,11 +23,8 @@
"id": "ProfilerFeature",
"type": "string",
"enum": [
"displaylistdump",
"gpu",
"java",
"js",
"layersdump",
"leaf",
"mainthreadio",
"memory",

Просмотреть файл

@ -23,7 +23,6 @@ support-files =
[browser_contextSearchTabPosition.js]
skip-if = os == "mac" # bug 967013
[browser_ddg.js]
[browser_eBay.js]
[browser_google.js]
skip-if = artifact # bug 1315953
[browser_google_codes.js]

Просмотреть файл

@ -1,71 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Test eBay search plugin URLs
*/
"use strict";
const BROWSER_SEARCH_PREF = "browser.search.";
function test() {
let engine = Services.search.getEngineByName("eBay");
ok(engine, "eBay");
let base = "https://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=20004&campid=5338192028&customid=&mpre=https://www.ebay.com/sch/foo";
let url;
// Test search URLs (including purposes).
url = engine.getSubmission("foo").uri.spec;
is(url, base, "Check search URL for 'foo'");
// Check all other engine properties.
const EXPECTED_ENGINE = {
name: "eBay",
alias: null,
description: "eBay - Online auctions",
searchForm: "https://www.ebay.com/",
hidden: false,
wrappedJSObject: {
"_iconURL": "resource://search-plugins/images/ebay.ico",
_urls: [
{
type: "text/html",
method: "GET",
template: "https://rover.ebay.com/rover/1/711-53200-19255-0/1",
params: [
{
name: "ff3",
value: "4",
purpose: undefined,
},
{
name: "toolid",
value: "20004",
purpose: undefined,
},
{
name: "campid",
value: "5338192028",
purpose: undefined,
},
{
name: "customid",
value: "",
purpose: undefined,
},
{
name: "mpre",
value: "https://www.ebay.com/sch/{searchTerms}",
purpose: undefined,
},
],
mozparams: {},
},
],
},
};
isSubObjectOf(EXPECTED_ENGINE, engine, "eBay");
}

Просмотреть файл

@ -37,16 +37,6 @@ const SEARCH_ENGINE_DETAILS = [{
submission: "&t=ffsb",
},
name: "DuckDuckGo",
}, {
alias: "e",
baseURL: "https://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=20004&campid=5338192028&customid=&mpre=https://www.ebay.com/sch/foo",
codes: {
context: "",
keyword: "",
newTab: "",
submission: "",
},
name: "eBay",
}, {
// TODO: Google is tested in browser_google_behaviors.js - we can't test it here
// yet because of bug 1315953.

Просмотреть файл

@ -98,7 +98,6 @@
locale/browser/searchplugins/list.json (.deps/generated_@AB_CD@/list.json)
#endif
locale/browser/searchplugins/images/amazon.ico (searchplugins/images/amazon.ico)
locale/browser/searchplugins/images/ebay.ico (searchplugins/images/ebay.ico)
locale/browser/searchplugins/images/wikipedia.ico (searchplugins/images/wikipedia.ico)
locale/browser/searchplugins/images/yahoo.ico (searchplugins/images/yahoo.ico)
locale/browser/searchplugins/images/yandex-en.ico (searchplugins/images/yandex-en.ico)

Просмотреть файл

@ -9,9 +9,7 @@
"google": "google-nocodes"
},
"CA": {
"google": "google-nocodes",
"ebay": "ebay-ca",
"ebay-fr": "ebay-ca"
"google": "google-nocodes"
},
"KZ": {
"google": "google-nocodes"
@ -33,40 +31,13 @@
},
"HK": {
"google": "google-nocodes"
},
"AT": {
"ebay-de": "ebay-at"
},
"AU": {
"ebay": "ebay-au",
"ebay-uk": "ebay-au"
},
"BE": {
"ebay": "ebay-be",
"ebay-nl": "ebay-be",
"ebay-fr": "ebay-be"
},
"CH": {
"ebay": "ebay-ch",
"ebay-de": "ebay-ch",
"ebay-fr": "ebay-ch"
},
"IE": {
"ebay": "ebay-ie",
"ebay-uk": "ebay-ie"
},
"NL": {
"ebay": "ebay-nl"
},
"GB": {
"ebay": "ebay-gb"
}
},
"locales": {
"en-US": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo", "amazondotcom", "bing", "ddg", "ebay", "twitter", "wikipedia"
"google", "yahoo", "amazondotcom", "bing", "ddg", "twitter", "wikipedia"
]
},
"experimental-hidden": {
@ -92,7 +63,7 @@
"an": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-es", "bing", "ebay-es", "wikipedia-an", "ddg", "twitter"
"google", "yahoo-es", "bing", "wikipedia-an", "ddg", "twitter"
]
}
},
@ -113,7 +84,7 @@
"ast": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-es", "bing", "diccionariu-alla", "ddg", "ebay-es", "wikipedia-ast"
"google", "yahoo-es", "bing", "diccionariu-alla", "ddg", "wikipedia-ast"
]
}
},
@ -155,7 +126,7 @@
"br": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-france", "amazon-france", "ddg", "ebay-fr", "freelang", "klask", "wikipedia-br"
"google", "yahoo-france", "amazon-france", "ddg", "freelang", "klask", "wikipedia-br"
]
}
},
@ -169,7 +140,7 @@
"ca": {
"default": {
"visibleDefaultEngines": [
"google", "bing", "diec2", "ddg", "ebay-es", "twitter", "wikipedia-ca"
"google", "bing", "diec2", "ddg", "twitter", "wikipedia-ca"
]
}
},
@ -190,7 +161,7 @@
"cy": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-en-GB", "amazon-en-GB", "ddg", "ebay-uk", "palasprint", "termau", "wikipedia-cy"
"google", "yahoo-en-GB", "amazon-en-GB", "ddg", "palasprint", "termau", "wikipedia-cy"
]
}
},
@ -204,14 +175,14 @@
"de": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-de", "amazondotcom-de", "bing", "ddg", "ebay-de", "leo_ende_de", "wikipedia-de"
"google", "yahoo-de", "amazondotcom-de", "bing", "ddg", "leo_ende_de", "wikipedia-de"
]
}
},
"dsb": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "ebay-de", "leo_ende_de", "wikipedia-dsb"
"google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "leo_ende_de", "wikipedia-dsb"
]
}
},
@ -225,7 +196,7 @@
"en-GB": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-en-GB", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
"google", "yahoo-en-GB", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "twitter", "wikipedia"
]
},
"experimental-hidden": {
@ -265,7 +236,7 @@
"es-ES": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-es", "bing", "drae", "ddg", "ebay-es", "twitter", "wikipedia-es"
"google", "yahoo-es", "bing", "drae", "ddg", "twitter", "wikipedia-es"
]
}
},
@ -286,7 +257,7 @@
"eu": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo", "bing", "amazon-en-GB", "ddg", "ebay-es", "elebila", "wikipedia-eu"
"google", "yahoo", "bing", "amazon-en-GB", "ddg", "elebila", "wikipedia-eu"
]
}
},
@ -314,35 +285,35 @@
"fr": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-france", "bing", "amazon-france", "ddg", "ebay-fr", "cnrtl-tlfi-fr", "wikipedia-fr"
"google", "yahoo-france", "bing", "amazon-france", "ddg", "cnrtl-tlfi-fr", "wikipedia-fr"
]
}
},
"fy-NL": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-fy-NL", "bing", "bolcom-fy-NL", "ddg", "ebay-nl", "marktplaats-fy-NL", "wikipedia-fy-NL"
"google", "yahoo-fy-NL", "bing", "bolcom-fy-NL", "ddg", "marktplaats-fy-NL", "wikipedia-fy-NL"
]
}
},
"ga-IE": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-en-GB", "amazon-en-GB", "ddg", "ebay-ie", "tearma", "twitter", "wikipedia-ga-IE"
"google", "yahoo-en-GB", "amazon-en-GB", "ddg", "tearma", "twitter", "wikipedia-ga-IE"
]
}
},
"gd": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-en-GB", "amazon-en-GB", "bbc-alba", "ddg", "ebay-uk", "faclair-beag", "wikipedia-gd"
"google", "yahoo-en-GB", "faclair-beag", "amazon-en-GB", "bbc-alba", "ddg", "wikipedia-gd"
]
}
},
"gl": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-es", "amazon-en-GB", "ddg", "ebay-es", "wikipedia-gl"
"google", "yahoo-es", "amazon-en-GB", "ddg", "wikipedia-gl"
]
}
},
@ -384,7 +355,7 @@
"hsb": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "ebay-de", "leo_ende_de", "wikipedia-hsb"
"google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "leo_ende_de", "wikipedia-hsb"
]
}
},
@ -426,7 +397,7 @@
"it": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-it", "bing", "amazon-it", "ddg", "ebay-it", "hoepli", "wikipedia-it"
"google", "yahoo-it", "bing", "amazon-it", "ddg", "hoepli", "wikipedia-it"
]
}
},
@ -489,7 +460,7 @@
"lij": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-it", "bing", "amazon-it", "ddg", "ebay-it", "paroledigenova-lij", "wikipedia-lij"
"google", "yahoo-it", "bing", "amazon-it", "ddg", "paroledigenova-lij", "wikipedia-lij"
]
}
},
@ -580,7 +551,7 @@
"nl": {
"default": {
"visibleDefaultEngines": [
"google", "bing", "bolcom-nl", "ddg", "ebay-nl", "marktplaats-nl", "wikipedia-nl"
"google", "bing", "bolcom-nl", "ddg", "marktplaats-nl", "wikipedia-nl"
]
}
},
@ -629,7 +600,7 @@
"rm": {
"default": {
"visibleDefaultEngines": [
"google", "yahoo-ch", "bing", "ddg", "ebay-ch", "leo_ende_de-rm", "pledarigrond", "wikipedia-rm"
"google", "yahoo-ch", "bing", "ddg", "leo_ende_de-rm", "pledarigrond", "wikipedia-rm"
]
}
},

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/5221-53469-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.at/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.at/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/705-53470-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.com.au/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.com.au/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/1553-53471-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.befr.ebay.be/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.at/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/706-53473-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.ca/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.ca/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/5222-53480-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.ch/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.ch/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/707-53477-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.de/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.de/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/1185-53479-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.es/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.es/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/709-53476-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.fr/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.fr/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/5282-53468-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.ie/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.ie/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/724-53478-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.it/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.it/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/1346-53482-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.nl/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.nl/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,19 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/710-53481-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.co.uk/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.co.uk/</SearchForm>
</SearchPlugin>

Просмотреть файл

@ -1,17 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>eBay</ShortName>
<Description>eBay - Online auctions</Description>
<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/711-53200-19255-0/1" resultdomain="ebay.com">
<Param name="ff3" value="4"/>
<Param name="toolid" value="20004"/>
<Param name="campid" value="5338192028"/>
<Param name="customid" value=""/>
<Param name="mpre" value="https://www.ebay.com/sch/{searchTerms}" />
</Url>
<SearchForm>https://www.ebay.com/</SearchForm>
</SearchPlugin>

Двоичные данные
browser/locales/searchplugins/images/ebay.ico

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

@ -125,6 +125,16 @@ public:
inline bool FastSubsumesConsideringDomain(nsIPrincipal* aOther);
inline bool FastSubsumesConsideringDomainIgnoringFPD(nsIPrincipal* aOther);
/**
* Returns true if this principal's CSP should override a document's CSP for
* loads that it triggers. Currently true only for expanded principals which
* subsume the document principal.
*/
bool OverridesCSP(nsIPrincipal* aDocumentPrincipal)
{
return mKind == eExpandedPrincipal && FastSubsumes(aDocumentPrincipal);
}
protected:
virtual ~BasePrincipal();

Просмотреть файл

@ -6,7 +6,6 @@
"use strict";
const Services = require("Services");
const { Task } = require("devtools/shared/task");
const { getColor } = require("devtools/client/shared/theme");
@ -28,7 +27,7 @@ function FontInspector(inspector, window) {
this.document = window.document;
this.inspector = inspector;
this.pageStyle = this.inspector.pageStyle;
this.store = inspector.store;
this.store = this.inspector.store;
this.update = this.update.bind(this);
@ -36,6 +35,8 @@ function FontInspector(inspector, window) {
this.onPreviewFonts = this.onPreviewFonts.bind(this);
this.onShowAllFont = this.onShowAllFont.bind(this);
this.onThemeChanged = this.onThemeChanged.bind(this);
this.init();
}
FontInspector.prototype = {
@ -50,20 +51,14 @@ FontInspector.prototype = {
});
let provider = createElement(Provider, {
store: this.store,
id: "fontinspector",
title: INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle"),
key: "fontinspector",
store: this.store,
title: INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle")
}, app);
let defaultTab = Services.prefs.getCharPref("devtools.inspector.activeSidebar");
this.inspector.addSidebarTab(
"fontinspector",
INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle"),
provider,
defaultTab == "fontinspector"
);
// Expose the provider to let inspector.js use it in setupSidebar.
this.provider = provider;
this.inspector.selection.on("new-node-front", this.onNewNode);
this.inspector.sidebar.on("fontinspector-selected", this.onNewNode);
@ -135,6 +130,11 @@ FontInspector.prototype = {
},
update: Task.async(function* () {
// Stop refreshing if the inspector or store is already destroyed.
if (!this.inspector || !this.store) {
return;
}
let node = this.inspector.selection.nodeFront;
let fonts = [];
let { fontOptions } = this.store.getState();

Просмотреть файл

@ -11,10 +11,9 @@ Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/inspector/test/head.js",
this);
Services.prefs.setBoolPref("devtools.fontinspector.enabled", true);
Services.prefs.setCharPref("devtools.inspector.activeSidebar", "fontinspector");
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.fontinspector.enabled");
Services.prefs.clearUserPref("devtools.inspector.activeSidebar");
});
/**
@ -47,7 +46,7 @@ var openFontInspectorForURL = Task.async(function* (url) {
return {
toolbox,
inspector,
view: inspector.getPanel("fontinspector")
view: inspector.fontinspector
};
});

Просмотреть файл

@ -597,10 +597,6 @@ Inspector.prototype = {
const BoxModel = require("devtools/client/inspector/boxmodel/box-model");
panel = new BoxModel(this, this.panelWin);
break;
case "fontinspector":
const FontInspector = require("devtools/client/inspector/fonts/fonts");
panel = new FontInspector(this, this.panelWin);
break;
default:
// This is a custom panel or a non lazy-loaded one.
return null;
@ -621,11 +617,6 @@ Inspector.prototype = {
let defaultTab = Services.prefs.getCharPref("devtools.inspector.activeSidebar");
if (!Services.prefs.getBoolPref("devtools.fontinspector.enabled") &&
defaultTab == "fontinspector") {
defaultTab = "ruleview";
}
// Append all side panels
this.sidebar.addExistingTab(
"ruleview",
@ -668,13 +659,29 @@ Inspector.prototype = {
defaultTab == "animationinspector");
}
if (Services.prefs.getBoolPref("devtools.fontinspector.enabled") &&
this.canGetUsedFontFaces) {
const FontInspector = this.browserRequire("devtools/client/inspector/fonts/fonts");
this.fontinspector = new FontInspector(this, this.panelWin);
this.fontinspector.init();
this.sidebar.toggleTab(true, "fontinspector");
if (this.canGetUsedFontFaces) {
// Inject a lazy loaded react tab by exposing a fake React object
// with a lazy defined Tab thanks to `panel` being a function
let fontId = "fontinspector";
let fontTitle = INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle");
this.sidebar.addTab(
fontId,
fontTitle,
{
props: {
id: fontId,
title: fontTitle
},
panel: () => {
if (!this.fontinspector) {
const FontInspector =
this.browserRequire("devtools/client/inspector/fonts/fonts");
this.fontinspector = new FontInspector(this, this.panelWin);
}
return this.fontinspector.provider;
}
},
defaultTab == fontId);
}
// Persist splitter state in preferences.

Просмотреть файл

@ -61,9 +61,6 @@ pref("devtools.inspector.colorWidget.enabled", false);
// Enable the CSS shapes highlighter
pref("devtools.inspector.shapesHighlighter.enabled", true);
// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);
// Counter to promote the inspector layout view.
// @remove after release 56 (See Bug 1355747)
pref("devtools.promote.layoutview", 1);

Просмотреть файл

@ -10011,6 +10011,9 @@ nsDocShell::InternalLoad(nsIURI* aURI,
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(contentType,
aURI,
// This is a top-level load, so the loading
// principal is null.
nullptr,
aTriggeringPrincipal,
requestingContext,
EmptyCString(), // mime guess

Просмотреть файл

@ -112,13 +112,11 @@ CustomElementConstructor::Construct(const char* aExecutionReason,
JS::Rooted<JSObject*> result(cx);
JS::Rooted<JS::Value> constructor(cx, JS::ObjectValue(*mCallback));
if (!JS::Construct(cx, constructor, JS::HandleValueArray::empty(), &result)) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
RefPtr<Element> element;
if (NS_FAILED(UNWRAP_OBJECT(Element, &result, element))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
@ -902,7 +900,7 @@ DoUpgrade(Element* aElement,
return;
}
if (constructResult.get() != aElement) {
if (!constructResult || constructResult.get() != aElement) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}

Просмотреть файл

@ -508,7 +508,7 @@ ShadowRoot::ContentAppended(nsIDocument* aDocument,
// Add insertion point to destination insertion points of fallback content.
if (nsContentUtils::IsContentInsertionPoint(aContainer)) {
HTMLContentElement* content = HTMLContentElement::FromContent(aContainer);
if (content->MatchedNodes().IsEmpty()) {
if (content && content->MatchedNodes().IsEmpty()) {
currentChild->DestInsertionPoints().AppendElement(aContainer);
}
}
@ -538,7 +538,7 @@ ShadowRoot::ContentInserted(nsIDocument* aDocument,
// Add insertion point to destination insertion points of fallback content.
if (nsContentUtils::IsContentInsertionPoint(aContainer)) {
HTMLContentElement* content = HTMLContentElement::FromContent(aContainer);
if (content->MatchedNodes().IsEmpty()) {
if (content && content->MatchedNodes().IsEmpty()) {
aChild->DestInsertionPoints().AppendElement(aContainer);
}
}
@ -563,7 +563,7 @@ ShadowRoot::ContentRemoved(nsIDocument* aDocument,
// fallback content.
if (nsContentUtils::IsContentInsertionPoint(aContainer)) {
HTMLContentElement* content = HTMLContentElement::FromContent(aContainer);
if (content->MatchedNodes().IsEmpty()) {
if (content && content->MatchedNodes().IsEmpty()) {
aChild->DestInsertionPoints().Clear();
}
}

Просмотреть файл

@ -1603,7 +1603,8 @@ WebSocketImpl::Init(JSContext* aCx,
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_WEBSOCKET,
uri,
aPrincipal,
aPrincipal, // loading principal
aPrincipal, // triggering principal
originDoc,
EmptyCString(),
nullptr,

Просмотреть файл

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<script>
// requires: user_pref("dom.webcomponents.enabled", true);
addEventListener("DOMContentLoaded", function(){
let o_0 = document.createElement("span").createShadowRoot();
let o_1 = document.createElementNS("http://www.mozilla.org/xbl", "binding");
let o_2 = document.createElementNS("http://www.mozilla.org/xbl", "children");
let o_3 = document.createTextNode("");
o_0.appendChild(o_1);
o_1.appendChild(o_2);
o_2.appendChild(o_3);
o_2.removeChild(o_3);
});
</script>
</html>

Просмотреть файл

@ -231,3 +231,4 @@ load 1400701.html
load 1403377.html
load 1405771.html
load 1406109-1.html
pref(dom.webcomponents.enabled,true) load 1324463.html

Просмотреть файл

@ -150,7 +150,7 @@ NS_CP_ContentTypeName(uint32_t contentType)
return NS_ERROR_FAILURE; \
\
return policy-> action (contentType, contentLocation, requestOrigin, \
context, mimeType, extra, originPrincipal, \
context, mimeType, extra, triggeringPrincipal, \
decision); \
PR_END_MACRO
@ -158,7 +158,7 @@ NS_CP_ContentTypeName(uint32_t contentType)
#define CHECK_CONTENT_POLICY_WITH_SERVICE(action, _policy) \
PR_BEGIN_MACRO \
return _policy-> action (contentType, contentLocation, requestOrigin, \
context, mimeType, extra, originPrincipal, \
context, mimeType, extra, triggeringPrincipal, \
decision); \
PR_END_MACRO
@ -171,8 +171,12 @@ NS_CP_ContentTypeName(uint32_t contentType)
#define CHECK_PRINCIPAL_AND_DATA(action) \
nsCOMPtr<nsIURI> requestOrigin; \
PR_BEGIN_MACRO \
if (originPrincipal) { \
bool isSystem = originPrincipal->GetIsSystemPrincipal(); \
if (loadingPrincipal) { \
/* We exempt most loads into any document with the system principal \
* from content policy checks, mostly as an optimization. Which means \
* that we need to apply this check to the loading principal, not the \
* principal that triggered the load. */ \
bool isSystem = loadingPrincipal->GetIsSystemPrincipal(); \
if (isSystem && contentType != nsIContentPolicy::TYPE_DOCUMENT) { \
*decision = nsIContentPolicy::ACCEPT; \
nsCOMPtr<nsINode> n = do_QueryInterface(context); \
@ -193,30 +197,32 @@ NS_CP_ContentTypeName(uint32_t contentType)
dataPolicy-> action (externalType, contentLocation, \
requestOrigin, context, \
mimeType, extra, \
originPrincipal, decision); \
triggeringPrincipal, decision); \
} \
} \
} \
return NS_OK; \
} \
nsresult rv = originPrincipal->GetURI(getter_AddRefs(requestOrigin)); \
nsresult rv = loadingPrincipal->GetURI(getter_AddRefs(requestOrigin)); \
NS_ENSURE_SUCCESS(rv, rv); \
} \
PR_END_MACRO
/**
* Alias for calling ShouldLoad on the content policy service. Parameters are
* the same as nsIContentPolicy::shouldLoad, except for the originPrincipal
* parameter, which should be non-null if possible, and the last parameter,
* the same as nsIContentPolicy::shouldLoad, except for the loadingPrincipal
* and triggeringPrincipal parameters (which should be non-null if possible,
* and have the same semantics as in nsLoadInfo), and the last parameter,
* which can be used to pass in a pointer to a useful service if the caller
* already has it. The origin URI to pass to shouldLoad will be the URI of
* originPrincipal, unless originPrincipal is null (in which case a null origin
* URI will be passed).
* loadingPrincipal, unless loadingPrincipal is null (in which case a null
* origin URI will be passed).
*/
inline nsresult
NS_CheckContentLoadPolicy(uint32_t contentType,
nsIURI *contentLocation,
nsIPrincipal *originPrincipal,
nsIPrincipal *loadingPrincipal,
nsIPrincipal *triggeringPrincipal,
nsISupports *context,
const nsACString &mimeType,
nsISupports *extra,
@ -232,17 +238,19 @@ NS_CheckContentLoadPolicy(uint32_t contentType,
/**
* Alias for calling ShouldProcess on the content policy service. Parameters
* are the same as nsIContentPolicy::shouldLoad, except for the originPrincipal
* parameter, which should be non-null if possible, and the last parameter,
* which can be used to pass in a pointer to a useful service if the caller
* already has it. The origin URI to pass to shouldLoad will be the URI of
* originPrincipal, unless originPrincipal is null (in which case a null origin
* URI will be passed).
* are the same as nsIContentPolicy::shouldLoad, except for the and
* triggeringPrincipal parameters (which should be non-null if possible, and
* have the same semantics as in nsLoadInfo), and the last parameter, which
* can be used to pass in a pointer to a useful service if the caller already
* has it. The origin URI to pass to shouldLoad will be the URI of
* loadingPrincipal, unless loadingPrincipal is null (in which case a null
* origin URI will be passed).
*/
inline nsresult
NS_CheckContentProcessPolicy(uint32_t contentType,
nsIURI *contentLocation,
nsIPrincipal *originPrincipal,
nsIPrincipal *loadingPrincipal,
nsIPrincipal *triggeringPrincipal,
nsISupports *context,
const nsACString &mimeType,
nsISupports *extra,

Просмотреть файл

@ -3627,6 +3627,7 @@ nsContentUtils::CanLoadImage(nsIURI* aURI, nsISupports* aContext,
rv = NS_CheckContentLoadPolicy(aContentType,
aURI,
aLoadingPrincipal,
aLoadingPrincipal, // triggering principal
aContext,
EmptyCString(), //mime guess
nullptr, //extra

Просмотреть файл

@ -399,8 +399,11 @@ interface nsIContentPolicy : nsISupports
* not be null
*
* @param aRequestOrigin OPTIONAL. the location of the resource that
* initiated this load request; can be null if
* inapplicable
* that is loading the request. This will generally
* be the URI of the loading principal for the
* resulting request (as determined by its
* LoadInfo), but may vary depending on the
* caller. Can be null if inapplicable.
*
* @param aContext OPTIONAL. the nsIDOMNode or nsIDOMWindow that
* initiated the request, or something that can QI
@ -420,8 +423,12 @@ interface nsIContentPolicy : nsISupports
* @param aRequestPrincipal an OPTIONAL argument, defines the principal that
* caused the load. This is optional only for
* non-gecko code: all gecko code should set this
* argument. For navigation events, this is
* the principal of the page that caused this load.
* argument. This should generally be the same as
* the triggering principal for the resulting
* request (as determined by its LoadInfo), but may
* vary depending on the caller. Sometimes it will
* be the loading principal or final channel
* principal instead.
*
* @return ACCEPT or REJECT_*
*

Просмотреть файл

@ -1482,7 +1482,8 @@ nsObjectLoadingContent::CheckLoadPolicy(int16_t *aContentPolicy)
*aContentPolicy = nsIContentPolicy::ACCEPT;
nsresult rv = NS_CheckContentLoadPolicy(contentPolicyType,
mURI,
doc->NodePrincipal(),
doc->NodePrincipal(), // loading principal
doc->NodePrincipal(), // triggering principal
thisContent,
mContentType,
nullptr, //extra
@ -1535,7 +1536,8 @@ nsObjectLoadingContent::CheckProcessPolicy(int16_t *aContentPolicy)
nsresult rv =
NS_CheckContentProcessPolicy(objectType,
mURI ? mURI : mBaseURI,
doc->NodePrincipal(),
doc->NodePrincipal(), // loading principal
doc->NodePrincipal(), // triggering principal
static_cast<nsIImageLoadingContent*>(this),
mContentType,
nullptr, //extra

Просмотреть файл

@ -217,11 +217,13 @@ OffscreenCanvas::ToCloneData()
}
already_AddRefed<ImageBitmap>
OffscreenCanvas::TransferToImageBitmap()
OffscreenCanvas::TransferToImageBitmap(ErrorResult& aRv)
{
ErrorResult rv;
nsCOMPtr<nsIGlobalObject> globalObject = GetGlobalObject();
RefPtr<ImageBitmap> result = ImageBitmap::CreateFromOffscreenCanvas(globalObject, *this, rv);
RefPtr<ImageBitmap> result = ImageBitmap::CreateFromOffscreenCanvas(globalObject, *this, aRv);
if (aRv.Failed()) {
return nullptr;
}
// Clear the content.
if ((mCurrentContextType == CanvasContextType::WebGL1 ||

Просмотреть файл

@ -112,7 +112,7 @@ public:
}
already_AddRefed<ImageBitmap>
TransferToImageBitmap();
TransferToImageBitmap(ErrorResult& aRv);
already_AddRefed<Promise>
ToBlob(JSContext* aCx,

Просмотреть файл

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function boom(){
let c = new OffscreenCanvas(0, 0);
c.transferToImageBitmap();
}
addEventListener("DOMContentLoaded", boom);
</script>
</head>
</html>

Просмотреть файл

@ -0,0 +1,10 @@
<script>
o0 = document.createElement('canvas');
document.documentElement.appendChild(o0)
o2 = o0.getContext("webgl2", {"premultipliedAlpha":false,"preserveDrawingBuffer":false,"depth":false})
o12 = document.createElement('canvas');
(document.body || document.documentElement).appendChild(o12)
o13 = o12.getContext('2d');
o14 = o13.getImageData(0.4002597041894355, 128, 8, 0.6125768461759614)
o2.readBuffer(1029)
</script>

Просмотреть файл

@ -46,4 +46,6 @@ load 1305312-1.html
load 1305850.html
load 1334366-1.html
load 1334647-1.html
load 1349067.html
pref(gfx.offscreencanvas.enabled,true) load 1348976-1.html
load 1357092.html

Просмотреть файл

@ -229,6 +229,9 @@ public:
void
OnResponseEnd(FetchDriverObserver::EndReason eReason) override;
bool
NeedOnDataAvailable() override;
void
OnDataAvailable() override;
@ -289,6 +292,9 @@ public:
FlushConsoleReport();
}
bool
NeedOnDataAvailable() override;
void
OnDataAvailable() override;
@ -499,6 +505,13 @@ MainThreadFetchResolver::OnResponseAvailableInternal(InternalResponse* aResponse
}
}
bool
MainThreadFetchResolver::NeedOnDataAvailable()
{
NS_ASSERT_OWNINGTHREAD(MainThreadFetchResolver);
return !!mFetchObserver;
}
void
MainThreadFetchResolver::OnDataAvailable()
{
@ -698,6 +711,14 @@ WorkerFetchResolver::OnResponseAvailableInternal(InternalResponse* aResponse)
}
}
bool
WorkerFetchResolver::NeedOnDataAvailable()
{
AssertIsOnMainThread();
MutexAutoLock lock(mPromiseProxy->Lock());
return !!mFetchObserver;
}
void
WorkerFetchResolver::OnDataAvailable()
{

Просмотреть файл

@ -69,12 +69,15 @@ FetchDriver::FetchDriver(InternalRequest* aRequest, nsIPrincipal* aPrincipal,
, mLoadGroup(aLoadGroup)
, mRequest(aRequest)
, mMainThreadEventTarget(aMainThreadEventTarget)
, mNeedToObserveOnDataAvailable(false)
, mIsTrackingFetch(aIsTrackingFetch)
#ifdef DEBUG
, mResponseAvailableCalled(false)
, mFetchCalled(false)
#endif
{
AssertIsOnMainThread();
MOZ_ASSERT(aRequest);
MOZ_ASSERT(aPrincipal);
MOZ_ASSERT(aMainThreadEventTarget);
@ -82,6 +85,8 @@ FetchDriver::FetchDriver(InternalRequest* aRequest, nsIPrincipal* aPrincipal,
FetchDriver::~FetchDriver()
{
AssertIsOnMainThread();
// We assert this since even on failures, we should call
// FailWithNetworkError().
MOZ_ASSERT(mResponseAvailableCalled);
@ -497,6 +502,8 @@ FetchDriver::OnStartRequest(nsIRequest* aRequest,
MOZ_ASSERT(!mPipeOutputStream);
MOZ_ASSERT(mObserver);
mNeedToObserveOnDataAvailable = mObserver->NeedOnDataAvailable();
RefPtr<InternalResponse> response;
nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aRequest);
@ -747,15 +754,18 @@ FetchDriver::OnDataAvailable(nsIRequest* aRequest,
// called between OnStartRequest and OnStopRequest, so we don't need to worry
// about races.
if (mObserver) {
if (NS_IsMainThread()) {
mObserver->OnDataAvailable();
} else {
RefPtr<Runnable> runnable = new DataAvailableRunnable(mObserver);
nsresult rv =
mMainThreadEventTarget->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
if (mNeedToObserveOnDataAvailable) {
mNeedToObserveOnDataAvailable = false;
if (mObserver) {
if (NS_IsMainThread()) {
mObserver->OnDataAvailable();
} else {
RefPtr<Runnable> runnable = new DataAvailableRunnable(mObserver);
nsresult rv =
mMainThreadEventTarget->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
}
}
@ -924,7 +934,7 @@ FetchDriver::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
NS_IMETHODIMP
FetchDriver::CheckListenerChain()
{
return NS_ERROR_NO_INTERFACE;
return NS_OK;
}
NS_IMETHODIMP

Просмотреть файл

@ -68,6 +68,13 @@ public:
virtual void FlushConsoleReport() = 0;
// Called in OnStartRequest() to determine if the OnDataAvailable() method
// needs to be called. Invoking that method may generate additional main
// thread runnables.
virtual bool NeedOnDataAvailable() = 0;
// Called once when the first byte of data is received iff
// NeedOnDataAvailable() returned true when called in OnStartRequest().
virtual void OnDataAvailable() = 0;
protected:
@ -88,7 +95,7 @@ class FetchDriver final : public nsIStreamListener,
public AbortFollower
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSICHANNELEVENTSINK
@ -131,6 +138,12 @@ private:
nsCOMPtr<nsIEventTarget> mMainThreadEventTarget;
SRIMetadata mSRIMetadata;
nsCString mWorkerScript;
// This is written once in OnStartRequest on the main thread and then
// written/read in OnDataAvailable() on any thread. Necko guarantees
// that these do not overlap.
bool mNeedToObserveOnDataAvailable;
bool mIsTrackingFetch;
#ifdef DEBUG

Просмотреть файл

@ -102,10 +102,13 @@ ImageListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt)
secMan->GetChannelResultPrincipal(channel, getter_AddRefs(channelPrincipal));
}
nsCOMPtr<nsILoadInfo> loadInfo = channel->GetLoadInfo();
int16_t decision = nsIContentPolicy::ACCEPT;
nsresult rv = NS_CheckContentProcessPolicy(nsIContentPolicy::TYPE_INTERNAL_IMAGE,
channelURI,
channelPrincipal,
loadInfo ? loadInfo->TriggeringPrincipal() : nullptr,
domWindow->GetFrameElementInternal(),
mimeType,
nullptr,

Просмотреть файл

@ -225,18 +225,23 @@ public:
};
static void
DoCustomElementCreate(Element** aElement, nsIDocument* aDoc,
DoCustomElementCreate(Element** aElement, nsIDocument* aDoc, nsAtom* aLocalName,
CustomElementConstructor* aConstructor, ErrorResult& aRv)
{
RefPtr<Element> element =
aConstructor->Construct("Custom Element Create", aRv);
if (aRv.Failed() || !element->IsHTMLElement()) {
if (aRv.Failed()) {
return;
}
if (!element || !element->IsHTMLElement()) {
aRv.ThrowTypeError<MSG_THIS_DOES_NOT_IMPLEMENT_INTERFACE>(NS_LITERAL_STRING("HTMLElement"));
return;
}
if (aDoc != element->OwnerDoc() || element->GetParentNode() ||
element->HasChildren() || element->GetAttrCount()) {
element->HasChildren() || element->GetAttrCount() ||
element->NodeInfo()->NameAtom() != aLocalName) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
@ -308,19 +313,20 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
(*aResult)->SetCustomElementData(new CustomElementData(typeAtom));
if (synchronousCustomElements) {
CustomElementRegistry::Upgrade(*aResult, definition, rv);
if (rv.MaybeSetPendingException(cx)) {
aes.ReportException();
}
} else {
nsContentUtils::EnqueueUpgradeReaction(*aResult, definition);
}
if (rv.MaybeSetPendingException(cx)) {
aes.ReportException();
}
return NS_OK;
}
// Step 6.1.
if (synchronousCustomElements) {
DoCustomElementCreate(aResult, nodeInfo->GetDocument(),
nodeInfo->NameAtom(),
definition->mConstructor, rv);
if (rv.MaybeSetPendingException(cx)) {
NS_IF_ADDREF(*aResult = NS_NewHTMLUnknownElement(nodeInfo.forget(), aFromParser));

Просмотреть файл

@ -289,11 +289,6 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
aType == NS_FORM_INPUT_TEL ||
aType == NS_FORM_INPUT_URL ||
// TODO: those are temporary until bug 773205 is fixed.
#if defined(MOZ_WIDGET_ANDROID)
// On Android/B2G, date/time input appears as a normal text box.
aType == NS_FORM_INPUT_TIME ||
aType == NS_FORM_INPUT_DATE ||
#endif
aType == NS_FORM_INPUT_MONTH ||
aType == NS_FORM_INPUT_WEEK ||
aType == NS_FORM_INPUT_DATETIME_LOCAL ||

Просмотреть файл

@ -33,19 +33,12 @@ skip-if = android_version == '18' # Android, bug 1147974
[test_input_color_picker_update.html]
skip-if = android_version == '18' # Android, bug 1147974
[test_input_date_bad_input.html]
skip-if = os == "android"
[test_input_date_key_events.html]
skip-if = os == "android"
[test_input_datetime_input_change_events.html]
skip-if = os == "android"
[test_input_datetime_focus_blur.html]
skip-if = os == "android"
[test_input_datetime_focus_blur_events.html]
skip-if = os == "android"
[test_input_datetime_focus_state.html]
skip-if = os == "android"
[test_input_datetime_tabindex.html]
skip-if = os == "android"
[test_input_defaultValue.html]
[test_input_email.html]
[test_input_event.html]
@ -71,11 +64,10 @@ skip-if = os == "android"
[test_input_range_mozinputrangeignorepreventdefault.html]
[test_input_range_rounding.html]
[test_input_sanitization.html]
skip-if = os == 'android' && debug # Extremely slow on debug android
[test_input_textarea_set_value_no_scroll.html]
[test_input_time_key_events.html]
skip-if = os == "android"
[test_input_time_sec_millisec_field.html]
skip-if = os == "android"
[test_input_types_pref.html]
[test_input_typing_sanitization.html]
skip-if = os == "android" && debug # bug 1397615

Просмотреть файл

@ -37,6 +37,7 @@ SimpleTest.waitForFocus(function() {
});
const DATE_BAD_INPUT_MSG = "Please enter a valid date.";
const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
function checkValidity(aElement, aIsBadInput) {
is(aElement.validity.valid, aIsBadInput ? false : true,
@ -93,9 +94,12 @@ function test() {
elem.blur();
checkValidity(elem, true);
// Clearing all fields should clear bad input validity state as well.
synthesizeMouse(input, resetButton_X, resetButton_Y, {});
checkValidity(elem, false);
// Reset button is desktop only.
if (isDesktop) {
// Clearing all fields should clear bad input validity state as well.
synthesizeMouse(input, resetButton_X, resetButton_Y, {});
checkValidity(elem, false);
}
}
</script>

Просмотреть файл

@ -26,6 +26,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1370858
* Test that change and input events are (not) fired for date/time inputs.
**/
const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
var inputTypes = ["time", "date"];
var changeEvents = [0, 0];
var inputEvents = [0, 0];
@ -73,12 +75,15 @@ function test() {
is(changeEvents[i], 2, "Change event should be dispatched (2).");
is(inputEvents[i], 2, "Input event should be dispatched (2).");
// Test that change and input events are fired when clearing the value using
// the reset button.
synthesizeMouse(input, resetButton_X, resetButton_Y, {});
is(input.value, "", "Check that value was set correctly (3).");
is(changeEvents[i], 3, "Change event should be dispatched (3).");
is(inputEvents[i], 3, "Input event should be dispatched (3).");
// Reset button is desktop only.
if (isDesktop) {
// Test that change and input events are fired when clearing the value using
// the reset button.
synthesizeMouse(input, resetButton_X, resetButton_Y, {});
is(input.value, "", "Check that value was set correctly (3).");
is(changeEvents[i], 3, "Change event should be dispatched (3).");
is(inputEvents[i], 3, "Input event should be dispatched (3).");
}
}
}

Просмотреть файл

@ -25,7 +25,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=765772
* This test checks that when a user types in some input types, it will not be
* in a state where the value will be un-sanitized and usable (by a script).
*/
const isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
var input = document.getElementById('i');
var form = document.getElementById('f');
@ -137,47 +136,6 @@ function* runTest()
"42,13", // comma can't be used as a decimal separator
]
},
{
mobileOnly: true,
type: 'date',
validData: [
'0001-01-01',
'2012-12-21',
'2013-01-28',
'100000-01-01',
],
invalidData: [
'1-01-01',
'a',
'-',
'2012-01',
'2013-01-1',
'1011-23-21',
'1000-12-99',
]
},
{
mobileOnly: true,
type: 'time',
validData: [
'00:00',
'09:09:00',
'08:23:23.1',
'21:43:56.12',
'23:12:45.100',
],
invalidData: [
'00:',
'00:00:',
'25:00',
'-00:00',
'00:00:00.',
'00:60',
'10:58:99',
':19:10',
'23:08:09.1012',
]
},
{
type: 'month',
validData: [
@ -236,10 +194,6 @@ function* runTest()
for (test of data) {
gCurrentTest = test;
if (gCurrentTest.mobileOnly && isDesktop) {
continue;
}
input.type = test.type;
gValidData = test.validData;
gInvalidData = test.invalidData;

Просмотреть файл

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<video src="1257700.webm" autoplay></video>
</body>
</html>

Двоичные данные
dom/media/test/crashtests/1257700.webm Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -83,6 +83,7 @@ load 1157994.html
load 1158427.html
load 1185176.html
load 1185192.html
load 1257700.html
load 1270303.html
load 1304948.html
load 1319486.html

Просмотреть файл

@ -188,7 +188,8 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentProcessPolicy(nsIContentPolicy::TYPE_OBJECT_SUBREQUEST,
mURL,
principal,
principal, // loading principal
principal, // triggering principal
element,
contentType,
nullptr,

Просмотреть файл

@ -303,7 +303,8 @@ ScriptLoader::CheckContentPolicy(nsIDocument* aDocument,
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
nsresult rv = NS_CheckContentLoadPolicy(contentPolicyType,
aURI,
aDocument->NodePrincipal(),
aDocument->NodePrincipal(), // loading principal
aDocument->NodePrincipal(), // triggering principal
aContext,
NS_LossyConvertUTF16toASCII(aType),
nullptr, //extra

Просмотреть файл

@ -1136,11 +1136,13 @@ class CSPReportSenderRunnable final : public Runnable
if (blockedURI) {
blockedURI->GetSpec(blockedDataStr);
bool isData = false;
rv = blockedURI->SchemeIs("data", &isData);
if (NS_SUCCEEDED(rv) && isData) {
blockedDataStr.Truncate(40);
blockedDataStr.AppendASCII("...");
if (blockedDataStr.Length() > 40) {
bool isData = false;
rv = blockedURI->SchemeIs("data", &isData);
if (NS_SUCCEEDED(rv) && isData) {
blockedDataStr.Truncate(40);
blockedDataStr.AppendASCII("...");
}
}
} else if (blockedString) {
blockedString->GetData(blockedDataStr);

Просмотреть файл

@ -552,7 +552,7 @@ nsCSPParser::keywordSource()
return nullptr;
}
mStrictDynamic = true;
return new nsCSPKeywordSrc(CSP_KeywordToEnum(mCurToken));
return new nsCSPKeywordSrc(CSP_UTF16KeywordToEnum(mCurToken));
}
if (CSP_IsKeyword(mCurToken, CSP_UNSAFE_INLINE)) {
@ -571,7 +571,8 @@ nsCSPParser::keywordSource()
}
// cache if we encounter 'unsafe-inline' so we can invalidate (ignore) it in
// case that script-src directive also contains hash- or nonce-.
mUnsafeInlineKeywordSrc = new nsCSPKeywordSrc(CSP_KeywordToEnum(mCurToken));
mUnsafeInlineKeywordSrc =
new nsCSPKeywordSrc(CSP_UTF16KeywordToEnum(mCurToken));
return mUnsafeInlineKeywordSrc;
}
@ -581,7 +582,7 @@ nsCSPParser::keywordSource()
if (doc) {
doc->SetHasUnsafeEvalCSP(true);
}
return new nsCSPKeywordSrc(CSP_KeywordToEnum(mCurToken));
return new nsCSPKeywordSrc(CSP_UTF16KeywordToEnum(mCurToken));
}
return nullptr;
}
@ -665,7 +666,8 @@ nsCSPParser::nonceSource()
NS_ConvertUTF16toUTF8(mCurValue).get()));
// Check if mCurToken begins with "'nonce-" and ends with "'"
if (!StringBeginsWith(mCurToken, NS_ConvertUTF8toUTF16(CSP_EnumToKeyword(CSP_NONCE)),
if (!StringBeginsWith(mCurToken,
nsDependentString(CSP_EnumToUTF16Keyword(CSP_NONCE)),
nsASCIICaseInsensitiveStringComparator()) ||
mCurToken.Last() != SINGLEQUOTE) {
return nullptr;
@ -861,8 +863,7 @@ nsCSPParser::sourceList(nsTArray<nsCSPBaseSrc*>& outSrcs)
}
// Otherwise, we ignore 'none' and report a warning
else {
NS_ConvertUTF8toUTF16 unicodeNone(CSP_EnumToKeyword(CSP_NONE));
const char16_t* params[] = { unicodeNone.get() };
const char16_t* params[] = { CSP_EnumToUTF16Keyword(CSP_NONE) };
logWarningErrorToConsole(nsIScriptError::warningFlag, "ignoringUnknownOption",
params, ArrayLength(params));
}
@ -1252,10 +1253,10 @@ nsCSPParser::directive()
// Even though we invalidate all of the srcs internally, we don't want to log
// messages for the srcs: (1) strict-dynamic, (2) unsafe-inline,
// (3) nonces, and (4) hashes
if (!srcStr.EqualsASCII(CSP_EnumToKeyword(CSP_STRICT_DYNAMIC)) &&
!srcStr.EqualsASCII(CSP_EnumToKeyword(CSP_UNSAFE_EVAL)) &&
!StringBeginsWith(NS_ConvertUTF16toUTF8(srcStr), NS_LITERAL_CSTRING("'nonce-")) &&
!StringBeginsWith(NS_ConvertUTF16toUTF8(srcStr), NS_LITERAL_CSTRING("'sha")))
if (!srcStr.EqualsASCII(CSP_EnumToUTF8Keyword(CSP_STRICT_DYNAMIC)) &&
!srcStr.EqualsASCII(CSP_EnumToUTF8Keyword(CSP_UNSAFE_EVAL)) &&
!StringBeginsWith(srcStr, nsDependentString(CSP_EnumToUTF16Keyword(CSP_NONCE))) &&
!StringBeginsWith(srcStr, NS_LITERAL_STRING("'sha")))
{
const char16_t* params[] = { srcStr.get() };
logWarningErrorToConsole(nsIScriptError::warningFlag, "ignoringSrcForStrictDynamic",

Просмотреть файл

@ -132,12 +132,18 @@ CSPService::ShouldLoad(uint32_t aContentType,
return NS_OK;
}
// query the principal of the document; if no document is passed, then
// fall back to using the requestPrincipal (e.g. service workers do not
// pass a document).
// Find a principal to retrieve the CSP from. If we don't have a context node
// (because, for instance, the load originates in a service worker), or the
// requesting principal's CSP overrides our document CSP, use the request
// principal. Otherwise, use the document principal.
nsCOMPtr<nsINode> node(do_QueryInterface(aRequestContext));
nsCOMPtr<nsIPrincipal> principal = node ? node->NodePrincipal()
: aRequestPrincipal;
nsCOMPtr<nsIPrincipal> principal;
if (!node || (aRequestPrincipal &&
BasePrincipal::Cast(aRequestPrincipal)->OverridesCSP(node->NodePrincipal()))) {
principal = aRequestPrincipal;
} else {
principal = node->NodePrincipal();
}
if (!principal) {
// if we can't query a principal, then there is nothing to do.
return NS_OK;

Просмотреть файл

@ -322,7 +322,7 @@ CSP_IsDirective(const nsAString& aValue, CSPDirective aDir)
bool
CSP_IsKeyword(const nsAString& aValue, enum CSPKeyword aKey)
{
return aValue.LowerCaseEqualsASCII(CSP_EnumToKeyword(aKey));
return aValue.LowerCaseEqualsASCII(CSP_EnumToUTF8Keyword(aKey));
}
bool
@ -331,14 +331,10 @@ CSP_IsQuotelessKeyword(const nsAString& aKey)
nsString lowerKey = PromiseFlatString(aKey);
ToLowerCase(lowerKey);
static_assert(CSP_LAST_KEYWORD_VALUE ==
(sizeof(CSPStrKeywords) / sizeof(CSPStrKeywords[0])),
"CSP_LAST_KEYWORD_VALUE does not match length of CSPStrKeywords");
nsAutoString keyword;
for (uint32_t i = 0; i < CSP_LAST_KEYWORD_VALUE; i++) {
// skipping the leading ' and trimming the trailing '
keyword.AssignASCII(CSPStrKeywords[i] + 1);
keyword.AssignASCII(gCSPUTF8Keywords[i] + 1);
keyword.Trim("'", false, true);
if (lowerKey.Equals(keyword)) {
return true;
@ -482,7 +478,7 @@ nsCSPBaseSrc::allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
bool aParserCreated) const
{
CSPUTILSLOG(("nsCSPBaseSrc::allows, aKeyWord: %s, a HashOrNonce: %s",
aKeyword == CSP_HASH ? "hash" : CSP_EnumToKeyword(aKeyword),
aKeyword == CSP_HASH ? "hash" : CSP_EnumToUTF8Keyword(aKeyword),
NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
return false;
}
@ -827,7 +823,7 @@ nsCSPKeywordSrc::allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
bool aParserCreated) const
{
CSPUTILSLOG(("nsCSPKeywordSrc::allows, aKeyWord: %s, aHashOrNonce: %s, mInvalidated: %s",
CSP_EnumToKeyword(aKeyword),
CSP_EnumToUTF8Keyword(aKeyword),
NS_ConvertUTF16toUTF8(aHashOrNonce).get(),
mInvalidated ? "yes" : "false"));
@ -853,7 +849,7 @@ nsCSPKeywordSrc::visit(nsCSPSrcVisitor* aVisitor) const
void
nsCSPKeywordSrc::toString(nsAString& outStr) const
{
outStr.AppendASCII(CSP_EnumToKeyword(mKeyword));
outStr.Append(CSP_EnumToUTF16Keyword(mKeyword));
}
/* ===== nsCSPNonceSrc ==================== */
@ -886,7 +882,8 @@ nsCSPNonceSrc::allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
bool aParserCreated) const
{
CSPUTILSLOG(("nsCSPNonceSrc::allows, aKeyWord: %s, a HashOrNonce: %s",
CSP_EnumToKeyword(aKeyword), NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
CSP_EnumToUTF8Keyword(aKeyword),
NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
if (aKeyword != CSP_NONCE) {
return false;
@ -904,7 +901,7 @@ nsCSPNonceSrc::visit(nsCSPSrcVisitor* aVisitor) const
void
nsCSPNonceSrc::toString(nsAString& outStr) const
{
outStr.AppendASCII(CSP_EnumToKeyword(CSP_NONCE));
outStr.Append(CSP_EnumToUTF16Keyword(CSP_NONCE));
outStr.Append(mNonce);
outStr.AppendASCII("'");
}
@ -928,7 +925,8 @@ nsCSPHashSrc::allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
bool aParserCreated) const
{
CSPUTILSLOG(("nsCSPHashSrc::allows, aKeyWord: %s, a HashOrNonce: %s",
CSP_EnumToKeyword(aKeyword), NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
CSP_EnumToUTF8Keyword(aKeyword),
NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
if (aKeyword != CSP_HASH) {
return false;
@ -1061,7 +1059,8 @@ nsCSPDirective::allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
bool aParserCreated) const
{
CSPUTILSLOG(("nsCSPDirective::allows, aKeyWord: %s, a HashOrNonce: %s",
CSP_EnumToKeyword(aKeyword), NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
CSP_EnumToUTF8Keyword(aKeyword),
NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
for (uint32_t i = 0; i < mSrcs.Length(); i++) {
if (mSrcs[i]->allows(aKeyword, aHashOrNonce, aParserCreated)) {
@ -1450,7 +1449,8 @@ nsCSPPolicy::allows(nsContentPolicyType aContentType,
bool aParserCreated) const
{
CSPUTILSLOG(("nsCSPPolicy::allows, aKeyWord: %s, a HashOrNonce: %s",
CSP_EnumToKeyword(aKeyword), NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
CSP_EnumToUTF8Keyword(aKeyword),
NS_ConvertUTF16toUTF8(aHashOrNonce).get()));
nsCSPDirective* defaultDir = nullptr;

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsIContentPolicy.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIURI.h"
#include "nsLiteralString.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsUnicharUtils.h"
@ -116,61 +117,81 @@ inline CSPDirective CSP_StringToCSPDirective(const nsAString& aDir)
return nsIContentSecurityPolicy::NO_DIRECTIVE;
}
// Please add any new enum items not only to CSPKeyword, but also add
// a string version for every enum >> using the same index << to
// CSPStrKeywords underneath.
#define FOR_EACH_CSP_KEYWORD(macro) \
macro(CSP_SELF, "'self'") \
macro(CSP_UNSAFE_INLINE, "'unsafe-inline'") \
macro(CSP_UNSAFE_EVAL, "'unsafe-eval'") \
macro(CSP_NONE, "'none'") \
macro(CSP_NONCE, "'nonce-") \
macro(CSP_REQUIRE_SRI_FOR, "require-sri-for") \
macro(CSP_STRICT_DYNAMIC, "'strict-dynamic'")
enum CSPKeyword {
CSP_SELF = 0,
CSP_UNSAFE_INLINE,
CSP_UNSAFE_EVAL,
CSP_NONE,
CSP_NONCE,
CSP_REQUIRE_SRI_FOR,
CSP_STRICT_DYNAMIC,
#define KEYWORD_ENUM(id_, string_) id_,
FOR_EACH_CSP_KEYWORD(KEYWORD_ENUM)
#undef KEYWORD_ENUM
// CSP_LAST_KEYWORD_VALUE always needs to be the last element in the enum
// because we use it to calculate the size for the char* array.
CSP_LAST_KEYWORD_VALUE,
// Putting CSP_HASH after the delimitor, because CSP_HASH is not a valid
// keyword (hash uses e.g. sha256, sha512) but we use CSP_HASH internally
// to identify allowed hashes in ::allows.
CSP_HASH
};
static const char* CSPStrKeywords[] = {
"'self'", // CSP_SELF = 0
"'unsafe-inline'", // CSP_UNSAFE_INLINE
"'unsafe-eval'", // CSP_UNSAFE_EVAL
"'none'", // CSP_NONE
"'nonce-", // CSP_NONCE
"require-sri-for", // CSP_REQUIRE_SRI_FOR
"'strict-dynamic'" // CSP_STRICT_DYNAMIC
// Remember: CSP_HASH is not supposed to be used
// The keywords, in UTF-8 form.
static const char* gCSPUTF8Keywords[] = {
#define KEYWORD_UTF8_LITERAL(id_, string_) string_,
FOR_EACH_CSP_KEYWORD(KEYWORD_UTF8_LITERAL)
#undef KEYWORD_UTF8_LITERAL
};
inline const char* CSP_EnumToKeyword(enum CSPKeyword aKey)
{
// Make sure all elements in enum CSPKeyword got added to CSPStrKeywords.
static_assert((sizeof(CSPStrKeywords) / sizeof(CSPStrKeywords[0]) ==
static_cast<uint32_t>(CSP_LAST_KEYWORD_VALUE)),
"CSP_LAST_KEYWORD_VALUE does not match length of CSPStrKeywords");
// The keywords, in UTF-16 form.
static const char16_t* gCSPUTF16Keywords[] = {
#define KEYWORD_UTF16_LITERAL(id_, string_) u"" string_,
FOR_EACH_CSP_KEYWORD(KEYWORD_UTF16_LITERAL)
#undef KEYWORD_UTF16_LITERAL
};
if (static_cast<uint32_t>(aKey) < static_cast<uint32_t>(CSP_LAST_KEYWORD_VALUE)) {
return CSPStrKeywords[static_cast<uint32_t>(aKey)];
#undef FOR_EACH_CSP_KEYWORD
inline const char* CSP_EnumToUTF8Keyword(enum CSPKeyword aKey)
{
// Make sure all elements in enum CSPKeyword got added to gCSPUTF8Keywords.
static_assert((sizeof(gCSPUTF8Keywords) / sizeof(gCSPUTF8Keywords[0]) ==
CSP_LAST_KEYWORD_VALUE),
"CSP_LAST_KEYWORD_VALUE != length(gCSPUTF8Keywords)");
if (static_cast<uint32_t>(aKey) <
static_cast<uint32_t>(CSP_LAST_KEYWORD_VALUE)) {
return gCSPUTF8Keywords[static_cast<uint32_t>(aKey)];
}
return "error: invalid keyword in CSP_EnumToKeyword";
return "error: invalid keyword in CSP_EnumToUTF8Keyword";
}
inline CSPKeyword CSP_KeywordToEnum(const nsAString& aKey)
inline const char16_t* CSP_EnumToUTF16Keyword(enum CSPKeyword aKey)
{
// Make sure all elements in enum CSPKeyword got added to gCSPUTF16Keywords.
static_assert((sizeof(gCSPUTF16Keywords) / sizeof(gCSPUTF16Keywords[0]) ==
CSP_LAST_KEYWORD_VALUE),
"CSP_LAST_KEYWORD_VALUE != length(gCSPUTF16Keywords)");
if (static_cast<uint32_t>(aKey) <
static_cast<uint32_t>(CSP_LAST_KEYWORD_VALUE)) {
return gCSPUTF16Keywords[static_cast<uint32_t>(aKey)];
}
return u"error: invalid keyword in CSP_EnumToUTF16Keyword";
}
inline CSPKeyword CSP_UTF16KeywordToEnum(const nsAString& aKey)
{
nsString lowerKey = PromiseFlatString(aKey);
ToLowerCase(lowerKey);
static_assert(CSP_LAST_KEYWORD_VALUE ==
(sizeof(CSPStrKeywords) / sizeof(CSPStrKeywords[0])),
"CSP_LAST_KEYWORD_VALUE does not match length of CSPStrKeywords");
for (uint32_t i = 0; i < CSP_LAST_KEYWORD_VALUE; i++) {
if (lowerKey.EqualsASCII(CSPStrKeywords[i])) {
if (lowerKey.Equals(gCSPUTF16Keywords[i])) {
return static_cast<CSPKeyword>(i);
}
}

Просмотреть файл

@ -456,18 +456,11 @@ DoContentSecurityChecks(nsIChannel* aChannel, nsILoadInfo* aLoadInfo)
MOZ_ASSERT(false, "can not perform security check without a valid contentType");
}
// For document loads we use the triggeringPrincipal as the originPrincipal.
// Note the the loadingPrincipal for loads of TYPE_DOCUMENT is a nullptr.
nsCOMPtr<nsIPrincipal> principal =
(contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT ||
contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT)
? aLoadInfo->TriggeringPrincipal()
: aLoadInfo->LoadingPrincipal();
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(internalContentPolicyType,
uri,
principal,
aLoadInfo->LoadingPrincipal(),
aLoadInfo->TriggeringPrincipal(),
requestingContext,
mimeTypeGuess,
nullptr, //extra,

Просмотреть файл

@ -346,6 +346,7 @@ void CleanupOSFileConstants()
gInitialized = false;
delete gPaths;
gPaths = nullptr;
}
@ -874,9 +875,7 @@ bool SetStringProperty(JSContext *cx, JS::Handle<JSObject*> aObject, const char
*/
bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
{
MOZ_ASSERT(gInitialized);
if (gPaths == nullptr) {
if (!gInitialized || gPaths == nullptr) {
// If an initialization error was ignored, we may end up with
// |gInitialized == true| but |gPaths == nullptr|. We cannot
// |MOZ_ASSERT| this, as this would kill precompile_cache.js,

Просмотреть файл

@ -20,6 +20,7 @@ interface OffscreenCanvas : EventTarget {
nsISupports? getContext(DOMString contextId,
optional any contextOptions = null);
[Throws]
ImageBitmap transferToImageBitmap();
[Throws]
Promise<Blob> toBlob(optional DOMString type = "",

Просмотреть файл

@ -267,6 +267,7 @@ public:
int16_t decision = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(aLoadInfo->InternalContentPolicyType(), uri,
aLoadInfo->LoadingPrincipal(),
aLoadInfo->TriggeringPrincipal(),
aLoadInfo->LoadingNode(), EmptyCString(),
nullptr, &decision);
NS_ENSURE_SUCCESS(rv, false);

Просмотреть файл

@ -873,7 +873,8 @@ ServiceWorkerManager::Register(mozIDOMWindow* aWindow,
int16_t decision = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER,
aScriptURI,
documentPrincipal,
documentPrincipal, // loading principal
documentPrincipal, // triggering principal
doc,
EmptyCString(),
nullptr,

Просмотреть файл

@ -702,7 +702,8 @@ nsXMLContentSink::ProcessStyleLink(nsIContent* aElement,
int16_t decision = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_XSLT,
url,
mDocument->NodePrincipal(),
mDocument->NodePrincipal(), // loading principal
mDocument->NodePrincipal(), // triggering principal
aElement,
type,
nullptr,

Просмотреть файл

@ -34,12 +34,14 @@ using namespace dom;
CreateElementTransaction::CreateElementTransaction(EditorBase& aEditorBase,
nsAtom& aTag,
nsINode& aParent,
int32_t aOffsetInParent)
int32_t aOffsetInParent,
nsIContent* aChildAtOffset)
: EditTransactionBase()
, mEditorBase(&aEditorBase)
, mTag(&aTag)
, mParent(&aParent)
, mOffsetInParent(aOffsetInParent)
, mRefNode(aChildAtOffset)
{
}
@ -83,8 +85,10 @@ CreateElementTransaction::DoTransaction()
mOffsetInParent = std::min(mOffsetInParent,
static_cast<int32_t>(mParent->GetChildCount()));
// Note, it's ok for mRefNode to be null. That means append
mRefNode = mParent->GetChildAt(mOffsetInParent);
if (!mRefNode) {
// Note, it's ok for mRefNode to be null. That means append
mRefNode = mParent->GetChildAt(mOffsetInParent);
}
nsCOMPtr<nsIContent> refNode = mRefNode;
mParent->InsertBefore(*mNewNode, refNode, rv);

Просмотреть файл

@ -41,7 +41,8 @@ public:
CreateElementTransaction(EditorBase& aEditorBase,
nsAtom& aTag,
nsINode& aParent,
int32_t aOffsetInParent);
int32_t aOffsetInParent,
nsIContent* aChildAtOffset);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CreateElementTransaction,
@ -71,7 +72,8 @@ protected:
// The new node to insert.
nsCOMPtr<dom::Element> mNewNode;
// The node we will insert mNewNode before. We compute this ourselves.
// The node we will insert mNewNode before. We compute this ourselves if it
// is not set by the constructor.
nsCOMPtr<nsIContent> mRefNode;
};

Просмотреть файл

@ -1117,8 +1117,9 @@ EditorBase::BeginningOfDocument()
return NS_ERROR_NULL_POINTER;
}
int32_t offsetInParent = parent->IndexOf(firstNode);
return selection->Collapse(parent, offsetInParent);
MOZ_ASSERT(parent->IndexOf(firstNode) == 0,
"How come the first node isn't the left most child in its parent?");
return selection->Collapse(parent, 0);
}
NS_IMETHODIMP
@ -1414,24 +1415,11 @@ EditorBase::SetSpellcheckUserOverride(bool enable)
return SyncRealTimeSpell();
}
NS_IMETHODIMP
EditorBase::CreateNode(const nsAString& aTag,
nsIDOMNode* aParent,
int32_t aPosition,
nsIDOMNode** aNewNode)
{
RefPtr<nsAtom> tag = NS_Atomize(aTag);
nsCOMPtr<nsINode> parent = do_QueryInterface(aParent);
NS_ENSURE_STATE(parent);
*aNewNode = GetAsDOMNode(CreateNode(tag, parent, aPosition).take());
NS_ENSURE_STATE(*aNewNode);
return NS_OK;
}
already_AddRefed<Element>
EditorBase::CreateNode(nsAtom* aTag,
nsINode* aParent,
int32_t aPosition)
int32_t aPosition,
nsIContent* aChildAtPosition)
{
MOZ_ASSERT(aTag && aParent);
@ -1448,7 +1436,8 @@ EditorBase::CreateNode(nsAtom* aTag,
nsCOMPtr<Element> ret;
RefPtr<CreateElementTransaction> transaction =
CreateTxnForCreateElement(*aTag, *aParent, aPosition);
CreateTxnForCreateElement(*aTag, *aParent, aPosition,
aChildAtPosition);
nsresult rv = DoTransaction(transaction);
if (NS_SUCCEEDED(rv)) {
ret = transaction->GetNewNode();
@ -3789,20 +3778,6 @@ EditorBase::IsTextNode(nsIDOMNode* aNode)
return (nodeType == nsIDOMNode::TEXT_NODE);
}
nsCOMPtr<nsIDOMNode>
EditorBase::GetChildAt(nsIDOMNode* aParent, int32_t aOffset)
{
nsCOMPtr<nsIDOMNode> resultNode;
nsCOMPtr<nsIContent> parent = do_QueryInterface(aParent);
NS_ENSURE_TRUE(parent, resultNode);
resultNode = do_QueryInterface(parent->GetChildAt(aOffset));
return resultNode;
}
/**
* GetNodeAtRangeOffsetPoint() returns the node at this position in a range,
* assuming that aParentOrNode is the node itself if it's a text node, or
@ -4007,7 +3982,8 @@ EditorBase::SplitNodeDeep(nsIContent& aNode,
int32_t aSplitPointOffset,
EmptyContainers aEmptyContainers,
nsIContent** aOutLeftNode,
nsIContent** aOutRightNode)
nsIContent** aOutRightNode,
nsCOMPtr<nsIContent>* ioChildAtSplitPointOffset)
{
MOZ_ASSERT(&aSplitPointParent == &aNode ||
EditorUtils::IsDescendantOf(&aSplitPointParent, &aNode));
@ -4061,6 +4037,9 @@ EditorBase::SplitNodeDeep(nsIContent& aNode,
if (aOutRightNode) {
rightNode.forget(aOutRightNode);
}
if (ioChildAtSplitPointOffset) {
*ioChildAtSplitPointOffset = nodeToSplit;
}
return offset;
}
@ -4250,8 +4229,9 @@ EditorBase::DeleteSelectionAndCreateElement(nsAtom& aTag)
nsCOMPtr<nsINode> node = selection->GetAnchorNode();
uint32_t offset = selection->AnchorOffset();
nsIContent* child = selection->GetChildAtAnchorOffset();
nsCOMPtr<Element> newElement = CreateNode(&aTag, node, offset);
nsCOMPtr<Element> newElement = CreateNode(&aTag, node, offset, child);
// We want the selection to be just after the new node
rv = selection->Collapse(node, offset + 1);
@ -4394,10 +4374,12 @@ EditorBase::CreateTxnForRemoveAttribute(Element& aElement,
already_AddRefed<CreateElementTransaction>
EditorBase::CreateTxnForCreateElement(nsAtom& aTag,
nsINode& aParent,
int32_t aPosition)
int32_t aPosition,
nsIContent* aChildAtPosition)
{
RefPtr<CreateElementTransaction> transaction =
new CreateElementTransaction(*this, aTag, aParent, aPosition);
new CreateElementTransaction(*this, aTag, aParent, aPosition,
aChildAtPosition);
return transaction.forget();
}

Просмотреть файл

@ -398,10 +398,12 @@ protected:
already_AddRefed<CreateElementTransaction>
CreateTxnForCreateElement(nsAtom& aTag,
nsINode& aParent,
int32_t aPosition);
int32_t aPosition,
nsIContent* aChildAtPosition);
already_AddRefed<Element> CreateNode(nsAtom* aTag, nsINode* aParent,
int32_t aPosition);
int32_t aPosition,
nsIContent* aChildAtPosition = nullptr);
/**
* Create a transaction for inserting aNode as a child of aParent.
@ -885,7 +887,6 @@ public:
return aNode->NodeType() == nsIDOMNode::TEXT_NODE;
}
static nsCOMPtr<nsIDOMNode> GetChildAt(nsIDOMNode* aParent, int32_t aOffset);
static nsIContent* GetNodeAtRangeOffsetPoint(nsINode* aParentOrNode,
int32_t aOffset);
@ -952,7 +953,9 @@ public:
EmptyContainers aEmptyContainers =
EmptyContainers::yes,
nsIContent** outLeftNode = nullptr,
nsIContent** outRightNode = nullptr);
nsIContent** outRightNode = nullptr,
nsCOMPtr<nsIContent>* ioChildAtSplitPointOffset =
nullptr);
EditorDOMPoint JoinNodeDeep(nsIContent& aLeftNode,
nsIContent& aRightNode);

Просмотреть файл

@ -3262,6 +3262,8 @@ HTMLEditRules::WillMakeList(Selection* aSelection,
nsCOMPtr<nsINode> container =
aSelection->GetRangeAt(0)->GetStartContainer();
int32_t offset = aSelection->GetRangeAt(0)->StartOffset();
nsCOMPtr<nsIContent> child =
aSelection->GetRangeAt(0)->GetChildAtStartOffset();
NS_ENSURE_STATE(container);
// make sure we can put a list here
@ -3270,16 +3272,17 @@ HTMLEditRules::WillMakeList(Selection* aSelection,
*aCancel = true;
return NS_OK;
}
rv = SplitAsNeeded(listType, container, offset);
rv = SplitAsNeeded(listType, container, offset,
address_of(child));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
nsCOMPtr<Element> theList =
mHTMLEditor->CreateNode(listType, container, offset);
mHTMLEditor->CreateNode(listType, container, offset, child);
NS_ENSURE_STATE(theList);
NS_ENSURE_STATE(mHTMLEditor);
nsCOMPtr<Element> theListItem =
mHTMLEditor->CreateNode(itemType, theList, 0);
mHTMLEditor->CreateNode(itemType, theList, 0, theList->GetFirstChild());
NS_ENSURE_STATE(theListItem);
// remember our new block for postprocessing
@ -3309,6 +3312,7 @@ HTMLEditRules::WillMakeList(Selection* aSelection,
nsCOMPtr<Element> newBlock;
NS_ENSURE_STATE(arrayOfNodes[i]->IsContent());
OwningNonNull<nsIContent> curNode = *arrayOfNodes[i]->AsContent();
nsCOMPtr<nsIContent> curChild(curNode);
int32_t offset;
curParent = EditorBase::GetNodeLocation(curNode, &offset);
@ -3378,7 +3382,9 @@ HTMLEditRules::WillMakeList(Selection* aSelection,
nsCOMPtr<nsINode> parent = EditorBase::GetNodeLocation(curParent,
&offset);
NS_ENSURE_STATE(mHTMLEditor);
curList = mHTMLEditor->CreateNode(listType, parent, offset);
curList = mHTMLEditor->CreateNode(listType, parent, offset,
curParent ? curParent->AsContent()
: nullptr);
NS_ENSURE_STATE(curList);
}
// move list item to new list
@ -3444,10 +3450,13 @@ HTMLEditRules::WillMakeList(Selection* aSelection,
// need to make a list to put things in if we haven't already,
if (!curList) {
rv = SplitAsNeeded(listType, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode);
rv = SplitAsNeeded(listType, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curList = mHTMLEditor->CreateNode(listType, curParent, offset);
curList = mHTMLEditor->CreateNode(listType, curParent, offset,
curChild);
// remember our new block for postprocessing
mNewBlock = curList;
// curList is now the correct thing to put curNode in
@ -3609,7 +3618,8 @@ HTMLEditRules::MakeBasicBlock(Selection& aSelection, nsAtom& blockType)
aSelection.GetRangeAt(0)->GetStartContainer());
OwningNonNull<nsINode> container =
*aSelection.GetRangeAt(0)->GetStartContainer();
nsIContent* child = aSelection.GetRangeAt(0)->GetChildAtStartOffset();
nsCOMPtr<nsIContent> child =
aSelection.GetRangeAt(0)->GetChildAtStartOffset();
int32_t offset = aSelection.GetRangeAt(0)->StartOffset();
if (&blockType == nsGkAtoms::normal ||
@ -3651,12 +3661,13 @@ HTMLEditRules::MakeBasicBlock(Selection& aSelection, nsAtom& blockType)
NS_ENSURE_SUCCESS(rv, rv);
// We don't need to act on this node any more
arrayOfNodes.RemoveElement(brNode);
child = nullptr;
}
// Make sure we can put a block here
rv = SplitAsNeeded(blockType, container, offset);
rv = SplitAsNeeded(blockType, container, offset, address_of(child));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<Element> block =
htmlEditor->CreateNode(&blockType, container, offset);
htmlEditor->CreateNode(&blockType, container, offset, child);
NS_ENSURE_STATE(block);
// Remember our new block for postprocessing
mNewBlock = block;
@ -3790,13 +3801,16 @@ HTMLEditRules::WillCSSIndent(Selection* aSelection,
nsCOMPtr<nsINode> container = aSelection->GetRangeAt(0)->GetStartContainer();
int32_t offset = aSelection->GetRangeAt(0)->StartOffset();
NS_ENSURE_STATE(container);
nsCOMPtr<nsIContent> child =
aSelection->GetRangeAt(0)->GetChildAtStartOffset();
// make sure we can put a block here
rv = SplitAsNeeded(*nsGkAtoms::div, container, offset);
rv = SplitAsNeeded(*nsGkAtoms::div, container, offset, address_of(child));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
nsCOMPtr<Element> theBlock = mHTMLEditor->CreateNode(nsGkAtoms::div,
container, offset);
container, offset,
child);
NS_ENSURE_STATE(theBlock);
// remember our new block for postprocessing
mNewBlock = theBlock;
@ -3885,12 +3899,14 @@ HTMLEditRules::WillCSSIndent(Selection* aSelection,
if (!curList || (sibling && sibling != curList)) {
// create a new nested list of correct type
nsCOMPtr<nsIContent> curChild(curNode);
rv =
SplitAsNeeded(*curParent->NodeInfo()->NameAtom(), curParent, offset);
SplitAsNeeded(*curParent->NodeInfo()->NameAtom(), curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curList = mHTMLEditor->CreateNode(curParent->NodeInfo()->NameAtom(),
curParent, offset);
curParent, offset, curChild);
NS_ENSURE_STATE(curList);
// curList is now the correct thing to put curNode in
// remember our new block for postprocessing
@ -3917,11 +3933,13 @@ HTMLEditRules::WillCSSIndent(Selection* aSelection,
return NS_OK; // cancelled
}
rv = SplitAsNeeded(*nsGkAtoms::div, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode);
rv = SplitAsNeeded(*nsGkAtoms::div, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curQuote = mHTMLEditor->CreateNode(nsGkAtoms::div, curParent,
offset);
offset, curChild);
NS_ENSURE_STATE(curQuote);
ChangeIndentation(*curQuote, Change::plus);
// remember our new block for postprocessing
@ -3981,13 +3999,17 @@ HTMLEditRules::WillHTMLIndent(Selection* aSelection,
aSelection->GetRangeAt(0)->GetStartContainer();
int32_t offset = aSelection->GetRangeAt(0)->StartOffset();
NS_ENSURE_STATE(container);
nsCOMPtr<nsIContent> child =
aSelection->GetRangeAt(0)->GetChildAtStartOffset();
// make sure we can put a block here
rv = SplitAsNeeded(*nsGkAtoms::blockquote, container, offset);
rv = SplitAsNeeded(*nsGkAtoms::blockquote, container, offset,
address_of(child));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
nsCOMPtr<Element> theBlock = mHTMLEditor->CreateNode(nsGkAtoms::blockquote,
container, offset);
container, offset,
child);
NS_ENSURE_STATE(theBlock);
// remember our new block for postprocessing
mNewBlock = theBlock;
@ -4076,12 +4098,14 @@ HTMLEditRules::WillHTMLIndent(Selection* aSelection,
if (!curList || (sibling && sibling != curList)) {
// create a new nested list of correct type
nsCOMPtr<nsIContent> curChild(curNode);
rv =
SplitAsNeeded(*curParent->NodeInfo()->NameAtom(), curParent, offset);
SplitAsNeeded(*curParent->NodeInfo()->NameAtom(), curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curList = mHTMLEditor->CreateNode(curParent->NodeInfo()->NameAtom(),
curParent, offset);
curParent, offset, curChild);
NS_ENSURE_STATE(curList);
// curList is now the correct thing to put curNode in
// remember our new block for postprocessing
@ -4120,12 +4144,13 @@ HTMLEditRules::WillHTMLIndent(Selection* aSelection,
if (!curList || (sibling && sibling != curList)) {
// create a new nested list of correct type
nsCOMPtr<nsIContent> curChild(listItem);
rv = SplitAsNeeded(*curParent->NodeInfo()->NameAtom(), curParent,
offset);
offset, address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curList = mHTMLEditor->CreateNode(curParent->NodeInfo()->NameAtom(),
curParent, offset);
curParent, offset, curChild);
NS_ENSURE_STATE(curList);
}
NS_ENSURE_STATE(mHTMLEditor);
@ -4151,11 +4176,13 @@ HTMLEditRules::WillHTMLIndent(Selection* aSelection,
return NS_OK; // cancelled
}
rv = SplitAsNeeded(*nsGkAtoms::blockquote, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode);
rv = SplitAsNeeded(*nsGkAtoms::blockquote, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curQuote = mHTMLEditor->CreateNode(nsGkAtoms::blockquote, curParent,
offset);
offset, curChild);
NS_ENSURE_STATE(curQuote);
// remember our new block for postprocessing
mNewBlock = curQuote;
@ -4745,9 +4772,11 @@ HTMLEditRules::WillAlign(Selection& aSelection,
: nullptr;
NS_ENSURE_STATE(parent);
int32_t offset = aSelection.GetRangeAt(0)->StartOffset();
nsIContent* child = aSelection.GetRangeAt(0)->GetChildAtStartOffset();
nsCOMPtr<nsIContent> child =
aSelection.GetRangeAt(0)->GetChildAtStartOffset();
rv = SplitAsNeeded(*nsGkAtoms::div, parent, offset);
rv = SplitAsNeeded(*nsGkAtoms::div, parent, offset,
address_of(child));
NS_ENSURE_SUCCESS(rv, rv);
// Consume a trailing br, if any. This is to keep an alignment from
// creating extra lines, if possible.
@ -4767,7 +4796,7 @@ HTMLEditRules::WillAlign(Selection& aSelection,
}
}
nsCOMPtr<Element> div = htmlEditor->CreateNode(nsGkAtoms::div, parent,
offset);
offset, child);
NS_ENSURE_STATE(div);
// Remember our new block for postprocessing
mNewBlock = div;
@ -4868,9 +4897,12 @@ HTMLEditRules::WillAlign(Selection& aSelection,
return NS_OK;
}
rv = SplitAsNeeded(*nsGkAtoms::div, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode->AsContent());
rv = SplitAsNeeded(*nsGkAtoms::div, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
curDiv = htmlEditor->CreateNode(nsGkAtoms::div, curParent, offset);
curDiv = htmlEditor->CreateNode(nsGkAtoms::div, curParent, offset,
curChild);
NS_ENSURE_STATE(curDiv);
// Remember our new block for postprocessing
mNewBlock = curDiv;
@ -4957,7 +4989,8 @@ HTMLEditRules::AlignBlockContents(nsIDOMNode* aNode,
} else {
// else we need to put in a div, set the alignment, and toss in all the children
NS_ENSURE_STATE(mHTMLEditor);
RefPtr<Element> divElem = mHTMLEditor->CreateNode(nsGkAtoms::div, node, 0);
RefPtr<Element> divElem = mHTMLEditor->CreateNode(nsGkAtoms::div, node, 0,
node->GetFirstChild());
NS_ENSURE_STATE(divElem);
// set up the alignment on the div
if (useCSS) {
@ -6762,7 +6795,8 @@ HTMLEditRules::ReturnInListItem(Selection& aSelection,
nsAtom* listAtom = nodeAtom == nsGkAtoms::dt ? nsGkAtoms::dd
: nsGkAtoms::dt;
nsCOMPtr<Element> newListItem =
htmlEditor->CreateNode(listAtom, list, itemOffset + 1);
htmlEditor->CreateNode(listAtom, list, itemOffset + 1,
aListItem.GetNextSibling());
NS_ENSURE_STATE(newListItem);
rv = htmlEditor->DeleteNode(&aListItem);
NS_ENSURE_SUCCESS(rv, rv);
@ -6856,11 +6890,13 @@ HTMLEditRules::MakeBlockquote(nsTArray<OwningNonNull<nsINode>>& aNodeArray)
if (!curBlock) {
nsCOMPtr<nsINode> curParent = curNode->GetParentNode();
int32_t offset = curParent ? curParent->IndexOf(curNode) : -1;
nsresult rv = SplitAsNeeded(*nsGkAtoms::blockquote, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode->AsContent());
nsresult rv = SplitAsNeeded(*nsGkAtoms::blockquote, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_STATE(mHTMLEditor);
curBlock = mHTMLEditor->CreateNode(nsGkAtoms::blockquote, curParent,
offset);
offset, curChild);
NS_ENSURE_STATE(curBlock);
// remember our new block for postprocessing
mNewBlock = curBlock;
@ -7025,10 +7061,13 @@ HTMLEditRules::ApplyBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
NS_ENSURE_SUCCESS(rv, rv);
} else {
// Make sure we can put a block here
nsresult rv = SplitAsNeeded(aBlockTag, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode->AsContent());
nsresult rv = SplitAsNeeded(aBlockTag, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<Element> theBlock =
htmlEditor->CreateNode(&aBlockTag, curParent, offset);
htmlEditor->CreateNode(&aBlockTag, curParent, offset,
curChild);
NS_ENSURE_STATE(theBlock);
// Remember our new block for postprocessing
mNewBlock = theBlock;
@ -7044,9 +7083,12 @@ HTMLEditRules::ApplyBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
} else {
// The break is the first (or even only) node we encountered. Create a
// block for it.
nsresult rv = SplitAsNeeded(aBlockTag, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode->AsContent());
nsresult rv = SplitAsNeeded(aBlockTag, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
curBlock = htmlEditor->CreateNode(&aBlockTag, curParent, offset);
curBlock = htmlEditor->CreateNode(&aBlockTag, curParent, offset,
curChild);
NS_ENSURE_STATE(curBlock);
// Remember our new block for postprocessing
mNewBlock = curBlock;
@ -7069,9 +7111,12 @@ HTMLEditRules::ApplyBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
// If no curBlock, make one
if (!curBlock) {
nsresult rv = SplitAsNeeded(aBlockTag, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode->AsContent());
nsresult rv = SplitAsNeeded(aBlockTag, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
curBlock = htmlEditor->CreateNode(&aBlockTag, curParent, offset);
curBlock = htmlEditor->CreateNode(&aBlockTag, curParent, offset,
curChild);
NS_ENSURE_STATE(curBlock);
// Remember our new block for postprocessing
mNewBlock = curBlock;
@ -7101,11 +7146,12 @@ HTMLEditRules::ApplyBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
nsresult
HTMLEditRules::SplitAsNeeded(nsAtom& aTag,
OwningNonNull<nsINode>& aInOutParent,
int32_t& aInOutOffset)
int32_t& inOutOffset,
nsCOMPtr<nsIContent>* inOutChildAtOffset)
{
// XXX Is there a better way to do this?
nsCOMPtr<nsINode> parent = aInOutParent.forget();
nsresult rv = SplitAsNeeded(aTag, parent, aInOutOffset);
nsresult rv = SplitAsNeeded(aTag, parent, inOutOffset, inOutChildAtOffset);
aInOutParent = parent.forget();
return rv;
}
@ -7113,7 +7159,8 @@ HTMLEditRules::SplitAsNeeded(nsAtom& aTag,
nsresult
HTMLEditRules::SplitAsNeeded(nsAtom& aTag,
nsCOMPtr<nsINode>& inOutParent,
int32_t& inOutOffset)
int32_t& inOutOffset,
nsCOMPtr<nsIContent>* inOutChildAtOffset)
{
NS_ENSURE_TRUE(inOutParent, NS_ERROR_NULL_POINTER);
@ -7151,7 +7198,10 @@ HTMLEditRules::SplitAsNeeded(nsAtom& aTag,
NS_ENSURE_STATE(mHTMLEditor);
int32_t offset = mHTMLEditor->SplitNodeDeep(*splitNode->AsContent(),
*inOutParent->AsContent(),
inOutOffset);
inOutOffset,
EditorBase::EmptyContainers::yes,
nullptr, nullptr,
inOutChildAtOffset);
NS_ENSURE_STATE(offset != -1);
inOutParent = tagParent;
inOutOffset = offset;
@ -8785,12 +8835,15 @@ HTMLEditRules::WillAbsolutePosition(Selection& aSelection,
OwningNonNull<nsINode> parent =
*aSelection.GetRangeAt(0)->GetStartContainer();
int32_t offset = aSelection.GetRangeAt(0)->StartOffset();
nsCOMPtr<nsIContent> child =
aSelection.GetRangeAt(0)->GetChildAtStartOffset();
// Make sure we can put a block here
rv = SplitAsNeeded(*nsGkAtoms::div, parent, offset);
rv = SplitAsNeeded(*nsGkAtoms::div, parent, offset,
address_of(child));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<Element> positionedDiv =
htmlEditor->CreateNode(nsGkAtoms::div, parent, offset);
htmlEditor->CreateNode(nsGkAtoms::div, parent, offset, child);
NS_ENSURE_STATE(positionedDiv);
// Remember our new block for postprocessing
mNewBlock = positionedDiv;
@ -8853,7 +8906,8 @@ HTMLEditRules::WillAbsolutePosition(Selection& aSelection,
mNewBlock = curPositionedDiv;
}
curList = htmlEditor->CreateNode(curParent->NodeInfo()->NameAtom(),
curPositionedDiv, -1);
curPositionedDiv, -1,
curPositionedDiv->GetLastChild());
NS_ENSURE_STATE(curList);
// curList is now the correct thing to put curNode in. Remember our
// new block for postprocessing.
@ -8893,11 +8947,13 @@ HTMLEditRules::WillAbsolutePosition(Selection& aSelection,
curParentParent->IndexOf(curParent) : -1;
curPositionedDiv = htmlEditor->CreateNode(nsGkAtoms::div,
curParentParent,
parentOffset);
parentOffset,
curParent->AsContent());
mNewBlock = curPositionedDiv;
}
curList = htmlEditor->CreateNode(curParent->NodeInfo()->NameAtom(),
curPositionedDiv, -1);
curPositionedDiv, -1,
curPositionedDiv->GetLastChild());
NS_ENSURE_STATE(curList);
}
rv = htmlEditor->MoveNode(listItem, curList, -1);
@ -8914,10 +8970,12 @@ HTMLEditRules::WillAbsolutePosition(Selection& aSelection,
curList = nullptr;
continue;
}
rv = SplitAsNeeded(*nsGkAtoms::div, curParent, offset);
nsCOMPtr<nsIContent> curChild(curNode);
rv = SplitAsNeeded(*nsGkAtoms::div, curParent, offset,
address_of(curChild));
NS_ENSURE_SUCCESS(rv, rv);
curPositionedDiv = htmlEditor->CreateNode(nsGkAtoms::div, curParent,
offset);
offset, curChild);
NS_ENSURE_STATE(curPositionedDiv);
// Remember our new block for postprocessing
mNewBlock = curPositionedDiv;

Просмотреть файл

@ -380,9 +380,11 @@ protected:
nsAtom& aBlockTag);
nsresult MakeBlockquote(nsTArray<OwningNonNull<nsINode>>& aNodeArray);
nsresult SplitAsNeeded(nsAtom& aTag, OwningNonNull<nsINode>& inOutParent,
int32_t& inOutOffset);
int32_t& inOutOffset,
nsCOMPtr<nsIContent>* inOutChildAtOffset = nullptr);
nsresult SplitAsNeeded(nsAtom& aTag, nsCOMPtr<nsINode>& inOutParent,
int32_t& inOutOffset);
int32_t& inOutOffset,
nsCOMPtr<nsIContent>* inOutChildAtOffset = nullptr);
nsresult AddTerminatingBR(nsIDOMNode *aBlock);
EditorDOMPoint JoinNodesSmart(nsIContent& aNodeLeft,
nsIContent& aNodeRight);

Просмотреть файл

@ -1550,24 +1550,40 @@ HTMLEditor::InsertElementAtSelection(nsIDOMElement* aElement,
* {*ioParent,*ioOffset} up to parent, and then insert aNode.
* ioParent & ioOffset are then adjusted to point to the actual location that
* aNode was inserted at. aNoEmptyNodes specifies if the splitting process
* is allowed to reslt in empty nodes.
* is allowed to reslt in empty nodes. ioChildAtOffset, if provided, is the
* child node at offset if ioParent is non-null, and the function will update
* *ioChildAtOffset upon returning.
*
* @param aNode Node to insert.
* @param ioParent Insertion parent.
* @param ioOffset Insertion offset.
* @param aNoEmptyNodes Splitting can result in empty nodes?
* @param ioChildAtOffset Child node at insertion offset (optional).
*/
nsresult
HTMLEditor::InsertNodeAtPoint(nsIDOMNode* aNode,
nsCOMPtr<nsIDOMNode>* ioParent,
int32_t* ioOffset,
bool aNoEmptyNodes)
bool aNoEmptyNodes,
nsCOMPtr<nsIDOMNode>* ioChildAtOffset)
{
nsCOMPtr<nsIContent> node = do_QueryInterface(aNode);
NS_ENSURE_TRUE(node, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(ioParent, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(*ioParent, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(ioOffset, NS_ERROR_NULL_POINTER);
bool isDocumentFragment = false;
if (ioChildAtOffset) {
*ioChildAtOffset = aNode;
uint16_t nodeType = 0;
if (NS_SUCCEEDED(aNode->GetNodeType(&nodeType)) &&
nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
// For document fragments, we can't return aNode itself in
// *ioChildAtOffset, so we have to find out the inserted child after
// the insertion is successfully finished.
isDocumentFragment = true;
}
}
nsCOMPtr<nsIContent> parent = do_QueryInterface(*ioParent);
NS_ENSURE_TRUE(parent, NS_ERROR_NULL_POINTER);
@ -1595,16 +1611,28 @@ HTMLEditor::InsertNodeAtPoint(nsIDOMNode* aNode,
parent = parent->GetParent();
}
if (parent != topChild) {
nsCOMPtr<nsIContent> child;
if (ioChildAtOffset) {
child = do_QueryInterface(*ioChildAtOffset);
}
// we need to split some levels above the original selection parent
int32_t offset = SplitNodeDeep(*topChild, *origParent, *ioOffset,
aNoEmptyNodes ? EmptyContainers::no
: EmptyContainers::yes);
: EmptyContainers::yes,
nullptr, nullptr, address_of(child));
NS_ENSURE_STATE(offset != -1);
*ioParent = GetAsDOMNode(parent);
*ioOffset = offset;
if (ioChildAtOffset) {
*ioChildAtOffset = GetAsDOMNode(child);
}
}
// Now we can insert the new node
return InsertNode(*node, *parent, *ioOffset);
nsresult rv = InsertNode(*node, *parent, *ioOffset);
if (isDocumentFragment) {
*ioChildAtOffset = do_QueryInterface(parent->GetChildAt(*ioOffset));
}
return rv;
}
NS_IMETHODIMP
@ -1948,6 +1976,8 @@ HTMLEditor::MakeOrChangeList(const nsAString& aListType,
OwningNonNull<nsIContent> node =
*selection->GetRangeAt(0)->GetStartContainer()->AsContent();
int32_t offset = selection->GetRangeAt(0)->StartOffset();
nsCOMPtr<nsIContent> child =
selection->GetRangeAt(0)->GetChildAtStartOffset();
if (isCollapsed) {
// have to find a place to put the list
@ -1962,15 +1992,18 @@ HTMLEditor::MakeOrChangeList(const nsAString& aListType,
if (parent != node) {
// we need to split up to the child of parent
offset = SplitNodeDeep(*topChild, *node, offset);
offset = SplitNodeDeep(*topChild, *node, offset,
EmptyContainers::yes, nullptr, nullptr,
address_of(child));
NS_ENSURE_STATE(offset != -1);
}
// make a list
nsCOMPtr<Element> newList = CreateNode(listAtom, parent, offset);
nsCOMPtr<Element> newList = CreateNode(listAtom, parent, offset, child);
NS_ENSURE_STATE(newList);
// make a list item
nsCOMPtr<Element> newItem = CreateNode(nsGkAtoms::li, newList, 0);
nsCOMPtr<Element> newItem = CreateNode(nsGkAtoms::li, newList, 0,
newList->GetFirstChild());
NS_ENSURE_STATE(newItem);
rv = selection->Collapse(newItem, 0);
NS_ENSURE_SUCCESS(rv, rv);
@ -2085,6 +2118,8 @@ HTMLEditor::InsertBasicBlock(const nsAString& aBlockType)
OwningNonNull<nsIContent> node =
*selection->GetRangeAt(0)->GetStartContainer()->AsContent();
int32_t offset = selection->GetRangeAt(0)->StartOffset();
nsCOMPtr<nsIContent> child =
selection->GetRangeAt(0)->GetChildAtStartOffset();
if (isCollapsed) {
// have to find a place to put the block
@ -2100,12 +2135,14 @@ HTMLEditor::InsertBasicBlock(const nsAString& aBlockType)
if (parent != node) {
// we need to split up to the child of parent
offset = SplitNodeDeep(*topChild, *node, offset);
offset = SplitNodeDeep(*topChild, *node, offset,
EmptyContainers::yes, nullptr, nullptr,
address_of(child));
NS_ENSURE_STATE(offset != -1);
}
// make a block
nsCOMPtr<Element> newBlock = CreateNode(blockAtom, parent, offset);
nsCOMPtr<Element> newBlock = CreateNode(blockAtom, parent, offset, child);
NS_ENSURE_STATE(newBlock);
// reposition selection to inside the block
@ -2156,6 +2193,8 @@ HTMLEditor::Indent(const nsAString& aIndent)
OwningNonNull<nsIContent> node =
*selection->GetRangeAt(0)->GetStartContainer()->AsContent();
int32_t offset = selection->GetRangeAt(0)->StartOffset();
nsCOMPtr<nsIContent> child =
selection->GetRangeAt(0)->GetChildAtStartOffset();
if (aIndent.EqualsLiteral("indent")) {
if (isCollapsed) {
@ -2170,12 +2209,15 @@ HTMLEditor::Indent(const nsAString& aIndent)
if (parent != node) {
// we need to split up to the child of parent
offset = SplitNodeDeep(*topChild, *node, offset);
offset = SplitNodeDeep(*topChild, *node, offset,
EmptyContainers::yes, nullptr, nullptr,
address_of(child));
NS_ENSURE_STATE(offset != -1);
}
// make a blockquote
nsCOMPtr<Element> newBQ = CreateNode(nsGkAtoms::blockquote, parent, offset);
nsCOMPtr<Element> newBQ =
CreateNode(nsGkAtoms::blockquote, parent, offset, child);
NS_ENSURE_STATE(newBQ);
// put a space in it so layout will draw the list item
rv = selection->Collapse(newBQ, 0);
@ -4558,7 +4600,8 @@ HTMLEditor::CopyLastEditableChildStyles(nsIDOMNode* aPreviousBlock,
NS_ENSURE_STATE(newStyles);
} else {
deepestStyle = newStyles =
CreateNode(childElement->NodeInfo()->NameAtom(), newBlock, 0);
CreateNode(childElement->NodeInfo()->NameAtom(), newBlock, 0,
newBlock->GetFirstChild());
NS_ENSURE_STATE(newStyles);
}
CloneAttributes(newStyles, childElement);

Просмотреть файл

@ -331,7 +331,8 @@ public:
nsresult InsertNodeAtPoint(nsIDOMNode* aNode,
nsCOMPtr<nsIDOMNode>* ioParent,
int32_t* ioOffset,
bool aNoEmptyNodes);
bool aNoEmptyNodes,
nsCOMPtr<nsIDOMNode>* ioChildAtOffset = nullptr);
/**
* Use this to assure that selection is set after attribute nodes when

Просмотреть файл

@ -543,11 +543,15 @@ HTMLEditor::DoInsertHTMLWithContext(const nsAString& aInputString,
while (NS_FAILED(rv) && curNode) {
curNode->GetParentNode(getter_AddRefs(parent));
if (parent && !TextEditUtils::IsBody(parent)) {
rv = InsertNodeAtPoint(parent, address_of(parentNode), &offsetOfNewNode, true);
rv = InsertNodeAtPoint(parent, address_of(parentNode), &offsetOfNewNode, true,
address_of(lastInsertNode));
if (NS_SUCCEEDED(rv)) {
bDidInsert = true;
insertedContextParent = parent;
lastInsertNode = GetChildAt(parentNode, offsetOfNewNode);
#ifdef DEBUG
nsCOMPtr<nsINode> node = do_QueryInterface(parentNode);
MOZ_ASSERT(lastInsertNode == GetAsDOMNode(node->GetChildAt(offsetOfNewNode)));
#endif
}
}
curNode = parent;

Просмотреть файл

@ -0,0 +1,11 @@
<body>
<table contenteditable="true"></table>
</body>
<script>
window.onload = function() {
document.execCommand("useCSS", false, false);
document.designMode = 'on';
document.execCommand("insertunorderedlist", false);
document.execCommand("justifyfull", false);
};
</script>

Просмотреть файл

@ -69,6 +69,7 @@ load 1158651.html
load 1244894.xhtml
load 1264921.html
load 1272490.html
load 1274050.html
load 1317704.html
load 1317718.html
load 1324505.html

Просмотреть файл

@ -429,18 +429,6 @@ interface nsIEditor : nsISupports
*/
void cloneAttributes(in nsIDOMNode destNode, in nsIDOMNode sourceNode);
/**
* createNode instantiates a new element of type aTag and inserts it
* into aParent at aPosition.
* @param aTag The type of object to create
* @param aParent The node to insert the new object into
* @param aPosition The place in aParent to insert the new node
* @return The node created. Caller must release aNewNode.
*/
nsIDOMNode createNode(in AString tag,
in nsIDOMNode parent,
in long position);
/**
* insertNode inserts aNode into aParent at aPosition.
* No checking is done to verify the legality of the insertion.

Просмотреть файл

@ -108,13 +108,6 @@ ContentClient::PrintInfo(std::stringstream& aStream, const char* aPrefix)
{
aStream << aPrefix;
aStream << nsPrintfCString("ContentClient (0x%p)", this).get();
if (PROFILER_FEATURE_ACTIVE(ProfilerFeature::DisplayListDump)) {
nsAutoCString pfx(aPrefix);
pfx += " ";
Dump(aStream, pfx.get(), false);
}
}
// We pass a null pointer for the ContentClient Forwarder argument, which means

Просмотреть файл

@ -1396,8 +1396,7 @@ TextureClient::PrintInfo(std::stringstream& aStream, const char* aPrefix)
AppendToString(aStream, mFlags, " [flags=", "]");
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::LayersDumpTexture() ||
PROFILER_FEATURE_ACTIVE(ProfilerFeature::LayersDump)) {
if (gfxPrefs::LayersDumpTexture()) {
nsAutoCString pfx(aPrefix);
pfx += " ";

Просмотреть файл

@ -1399,13 +1399,6 @@ TiledContentClient::PrintInfo(std::stringstream& aStream, const char* aPrefix)
{
aStream << aPrefix;
aStream << nsPrintfCString("%sTiledContentClient (0x%p)", mName, this).get();
if (PROFILER_FEATURE_ACTIVE(ProfilerFeature::DisplayListDump)) {
nsAutoCString pfx(aPrefix);
pfx += " ";
Dump(aStream, pfx.get(), false);
}
}
void

Просмотреть файл

@ -865,10 +865,6 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
// Dump to console
if (gfxPrefs::LayersDump()) {
this->Dump(/* aSorted= */true);
} else if (PROFILER_FEATURE_ACTIVE(ProfilerFeature::LayersDump)) {
std::stringstream ss;
Dump(ss);
PROFILER_TRACING("log", ss.str().c_str(), TRACING_EVENT);
}
// Dump to LayerScope Viewer

Просмотреть файл

@ -410,8 +410,7 @@ TextureHost::PrintInfo(std::stringstream& aStream, const char* aPrefix)
}
AppendToString(aStream, mFlags, " [flags=", "]");
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::LayersDumpTexture() ||
PROFILER_FEATURE_ACTIVE(ProfilerFeature::LayersDump)) {
if (gfxPrefs::LayersDumpTexture()) {
nsAutoCString pfx(aPrefix);
pfx += " ";

Просмотреть файл

@ -626,8 +626,7 @@ TiledContentHost::PrintInfo(std::stringstream& aStream, const char* aPrefix)
aStream << nsPrintfCString("TiledContentHost (0x%p)", this).get();
#if defined(MOZ_DUMP_PAINTING)
if (gfxPrefs::LayersDumpTexture() ||
PROFILER_FEATURE_ACTIVE(ProfilerFeature::LayersDump)) {
if (gfxPrefs::LayersDumpTexture()) {
nsAutoCString pfx(aPrefix);
pfx += " ";

Просмотреть файл

@ -210,8 +210,6 @@ CompositorOGL::CleanupResources()
mBlitTextureImageHelper = nullptr;
mContextStateTracker.DestroyOGL(mGLContext);
// On the main thread the Widget will be destroyed soon and calling MakeCurrent
// after that could cause a crash (at least with GLX, see bug 1059793), unless
// context is marked as destroyed.
@ -588,10 +586,6 @@ CompositorOGL::SetRenderTarget(CompositingRenderTarget *aSurface)
= static_cast<CompositingRenderTargetOGL*>(aSurface);
if (mCurrentRenderTarget != surface) {
mCurrentRenderTarget = surface;
if (mCurrentRenderTarget) {
mContextStateTracker.PopOGLSection(gl(), "Frame");
}
mContextStateTracker.PushOGLSection(gl(), "Frame");
surface->BindRenderTarget();
}
@ -1607,8 +1601,6 @@ CompositorOGL::EndFrame()
}
#endif
mContextStateTracker.PopOGLSection(gl(), "Frame");
mFrameInProgress = false;
if (mTarget) {

Просмотреть файл

@ -6,7 +6,6 @@
#ifndef MOZILLA_GFX_COMPOSITOROGL_H
#define MOZILLA_GFX_COMPOSITOROGL_H
#include "ContextStateTracker.h"
#include "gfx2DGlue.h"
#include "GLContextTypes.h" // for GLContext, etc
#include "GLDefs.h" // for GLuint, LOCAL_GL_TEXTURE_2D, etc
@ -430,8 +429,6 @@ private:
RefPtr<CompositorTexturePoolOGL> mTexturePool;
ContextStateTrackerOGL mContextStateTracker;
bool mDestroyed;
/**

Просмотреть файл

@ -295,17 +295,6 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile)
bY = s15Fixed16Number_to_float(profile->blueColorant.Y);
bZ = s15Fixed16Number_to_float(profile->blueColorant.Z);
// Check if any of the XYZ values are negative (see mozilla bug 498245)
// CIEXYZ tristimulus values cannot be negative according to the spec.
negative =
(rX < 0) || (rY < 0) || (rZ < 0) ||
(gX < 0) || (gY < 0) || (gZ < 0) ||
(bX < 0) || (bY < 0) || (bZ < 0);
if (negative)
return true;
// Sum the values; they should add up to something close to white
sum[0] = rX + gX + bX;
sum[1] = rY + gY + bY;
@ -331,6 +320,28 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile)
return true;
}
#ifndef __APPLE__
// Check if any of the XYZ values are negative (see mozilla bug 498245)
// CIEXYZ tristimulus values cannot be negative according to the spec.
negative =
(rX < 0) || (rY < 0) || (rZ < 0) ||
(gX < 0) || (gY < 0) || (gZ < 0) ||
(bX < 0) || (bY < 0) || (bZ < 0);
#else
// Chromatic adaption to D50 can result in negative XYZ, but the white
// point D50 tolerance test has passed. Accept negative values herein.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=498245#c18 onwards
// for discussion about whether profile XYZ can or cannot be negative,
// per the spec. Also the https://bugzil.la/450923 user report.
// FIXME: allow this relaxation on all ports?
negative = false;
#endif
if (negative)
return true; // bogus
// All Good
return false;
}

Просмотреть файл

@ -0,0 +1 @@
<div style="font-variant:small-caps">Don't crash&#x1f600;!

Просмотреть файл

@ -137,3 +137,4 @@ load 1317403-1.html # bug 1331533
load 1325159-1.html
load 1331683.html
skip-if(Android) pref(dom.disable_open_during_load,false) load 1343666.html
load 1408078-1.html

Просмотреть файл

@ -1,142 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ContextStateTracker.h"
#include "GLContext.h"
#include "GeckoProfiler.h"
#ifdef MOZ_GECKO_PROFILER
#include "ProfilerMarkerPayload.h"
#endif
namespace mozilla {
void
ContextStateTrackerOGL::PushOGLSection(GLContext* aGL, const char* aSectionName)
{
#ifdef MOZ_GECKO_PROFILER
if (!profiler_feature_active(ProfilerFeature::GPU)) {
return;
}
if (!aGL->IsSupported(gl::GLFeature::query_objects)) {
return;
}
if (mSectionStack.Length() > 0) {
// We need to end the query since we're starting a new section and restore
// it when this section is finished.
aGL->fEndQuery(LOCAL_GL_TIME_ELAPSED);
Top().mCpuTimeEnd = TimeStamp::Now();
}
ContextState newSection(aSectionName);
GLuint queryObject;
aGL->fGenQueries(1, &queryObject);
newSection.mStartQueryHandle = queryObject;
newSection.mCpuTimeStart = TimeStamp::Now();
aGL->fBeginQuery(LOCAL_GL_TIME_ELAPSED_EXT, queryObject);
mSectionStack.AppendElement(newSection);
#endif
}
void
ContextStateTrackerOGL::PopOGLSection(GLContext* aGL, const char* aSectionName)
{
// We might have ignored a section start if we started profiling
// in the middle section. If so we will ignore this unmatched end.
if (mSectionStack.Length() == 0) {
return;
}
int i = mSectionStack.Length() - 1;
MOZ_ASSERT(strcmp(mSectionStack[i].mSectionName, aSectionName) == 0);
aGL->fEndQuery(LOCAL_GL_TIME_ELAPSED);
mSectionStack[i].mCpuTimeEnd = TimeStamp::Now();
mCompletedSections.AppendElement(mSectionStack[i]);
mSectionStack.RemoveElementAt(i);
if (i - 1 >= 0) {
const char* sectionToRestore = Top().mSectionName;
// We need to restore the outer section
// Well do this by completing this section and adding a new
// one with the same name
mCompletedSections.AppendElement(Top());
mSectionStack.RemoveElementAt(i - 1);
ContextState newSection(sectionToRestore);
GLuint queryObject;
aGL->fGenQueries(1, &queryObject);
newSection.mStartQueryHandle = queryObject;
newSection.mCpuTimeStart = TimeStamp::Now();
aGL->fBeginQuery(LOCAL_GL_TIME_ELAPSED_EXT, queryObject);
mSectionStack.AppendElement(newSection);
}
Flush(aGL);
}
void
ContextStateTrackerOGL::Flush(GLContext* aGL)
{
TimeStamp now = TimeStamp::Now();
while (mCompletedSections.Length() != 0) {
// On mac we see QUERY_RESULT_AVAILABLE cause a GL flush if we query it
// too early. For profiling we rather have the last 200ms of data missing
// while causing let's measurement distortions.
if (mCompletedSections[0].mCpuTimeEnd + TimeDuration::FromMilliseconds(200) > now) {
break;
}
GLuint handle = mCompletedSections[0].mStartQueryHandle;
// We've waiting 200ms, content rendering at > 20 FPS will be ready. We
// shouldn't see any flushes now.
GLuint returned = 0;
aGL->fGetQueryObjectuiv(handle, LOCAL_GL_QUERY_RESULT_AVAILABLE, &returned);
if (!returned) {
break;
}
GLuint gpuTime = 0;
aGL->fGetQueryObjectuiv(handle, LOCAL_GL_QUERY_RESULT, &gpuTime);
aGL->fDeleteQueries(1, &handle);
#ifdef MOZ_GECKO_PROFILER
if (profiler_is_active()) {
profiler_add_marker(
"gpu_timer_query",
MakeUnique<GPUMarkerPayload>(mCompletedSections[0].mCpuTimeStart,
mCompletedSections[0].mCpuTimeEnd,
0, gpuTime));
}
#endif
mCompletedSections.RemoveElementAt(0);
}
}
void
ContextStateTrackerOGL::DestroyOGL(GLContext* aGL)
{
while (mCompletedSections.Length() != 0) {
GLuint handle = (GLuint)mCompletedSections[0].mStartQueryHandle;
aGL->fDeleteQueries(1, &handle);
mCompletedSections.RemoveElementAt(0);
}
}
} // namespace mozilla

Просмотреть файл

@ -1,84 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GFX_CONTEXTSTATETRACKER_H
#define GFX_CONTEXTSTATETRACKER_H
#include "GLTypes.h"
#include "mozilla/TimeStamp.h"
#include "nsTArray.h"
#include <string.h>
namespace mozilla {
namespace gl {
class GLContext;
} // namespace gl
/**
* This class tracks the state of the context for debugging and profiling.
* Each section pushes a new stack entry and must be matched by an end section.
* All nested section must be ended before ending a parent section.
*/
class ContextStateTracker {
public:
ContextStateTracker() {}
private:
bool IsProfiling() { return true; }
protected:
typedef GLuint TimerQueryHandle;
class ContextState {
public:
explicit ContextState(const char* aSectionName)
: mSectionName(aSectionName)
{}
const char* mSectionName;
mozilla::TimeStamp mCpuTimeStart;
mozilla::TimeStamp mCpuTimeEnd;
TimerQueryHandle mStartQueryHandle;
};
ContextState& Top() {
MOZ_ASSERT(mSectionStack.Length());
return mSectionStack[mSectionStack.Length() - 1];
}
nsTArray<ContextState> mCompletedSections;
nsTArray<ContextState> mSectionStack;
};
/*
class ID3D11DeviceContext;
class ContextStateTrackerD3D11 final : public ContextStateTracker {
public:
// TODO Implement me
void PushD3D11Section(ID3D11DeviceContext* aCtxt, const char* aSectionName) {}
void PopD3D11Section(ID3D11DeviceContext* aCtxt, const char* aSectionName) {}
void DestroyD3D11(ID3D11DeviceContext* aCtxt) {}
private:
void Flush();
};
*/
class ContextStateTrackerOGL final : public ContextStateTracker {
typedef mozilla::gl::GLContext GLContext;
public:
void PushOGLSection(GLContext* aGL, const char* aSectionName);
void PopOGLSection(GLContext* aGL, const char* aSectionName);
void DestroyOGL(GLContext* aGL);
private:
void Flush(GLContext* aGL);
};
} // namespace mozilla
#endif

Просмотреть файл

@ -692,10 +692,14 @@ MacOSFontEntry::SupportsOpenTypeFeature(Script aScript, uint32_t aFeatureTag)
mHasAATSmallCapsInitialized = true;
CTFontRef ctFont =
CTFontCreateWithGraphicsFont(mFontRef, 0.0, nullptr, nullptr);
CFArrayRef features = CTFontCopyFeatures(ctFont);
CFRelease(ctFont);
mHasAATSmallCaps = CheckForAATSmallCaps(features);
CFRelease(features);
if (ctFont) {
CFArrayRef features = CTFontCopyFeatures(ctFont);
CFRelease(ctFont);
if (features) {
mHasAATSmallCaps = CheckForAATSmallCaps(features);
CFRelease(features);
}
}
return mHasAATSmallCaps;
}
return gfxFontEntry::SupportsOpenTypeFeature(aScript, aFeatureTag);

Просмотреть файл

@ -11,7 +11,6 @@ with Files('*DWrite*'):
BUG_COMPONENT = ('Core', 'Graphics: Text')
EXPORTS += [
'ContextStateTracker.h',
'DrawMode.h',
'gfx2DGlue.h',
'gfxAlphaRecovery.h',
@ -167,7 +166,6 @@ if CONFIG['INTEL_ARCHITECTURE']:
SOURCES['gfxAlphaRecoverySSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES += [
'ContextStateTracker.cpp',
# Includes mac system header conflicting with point/size,
# and includes glxXlibSurface.h which drags in Xrender.h
'gfxASurface.cpp',

Просмотреть файл

@ -637,6 +637,10 @@ DisplayListBuilder::~DisplayListBuilder()
wr_state_delete(mWrState);
}
void DisplayListBuilder::Save() { wr_dp_save(mWrState); }
void DisplayListBuilder::Restore() { wr_dp_restore(mWrState); }
void DisplayListBuilder::ClearSave() { wr_dp_clear_save(mWrState); }
void
DisplayListBuilder::Finalize(wr::LayoutSize& aOutContentSize,
BuiltDisplayList& aOutDisplayList)

Просмотреть файл

@ -208,6 +208,10 @@ public:
~DisplayListBuilder();
void Save();
void Restore();
void ClearSave();
void Finalize(wr::LayoutSize& aOutContentSize,
wr::BuiltDisplayList& aOutDisplayList);

Просмотреть файл

@ -1097,6 +1097,21 @@ pub extern "C" fn wr_state_delete(state: *mut WrState) {
}
}
#[no_mangle]
pub extern "C" fn wr_dp_save(state: &mut WrState) {
state.frame_builder.dl_builder.save();
}
#[no_mangle]
pub extern "C" fn wr_dp_restore(state: &mut WrState) {
state.frame_builder.dl_builder.restore();
}
#[no_mangle]
pub extern "C" fn wr_dp_clear_save(state: &mut WrState) {
state.frame_builder.dl_builder.clear_save();
}
#[no_mangle]
pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
bounds: LayoutRect,

Просмотреть файл

@ -910,6 +910,10 @@ WR_INLINE
void wr_dec_ref_arc(const VecU8 *aArc)
WR_FUNC;
WR_INLINE
void wr_dp_clear_save(WrState *aState)
WR_FUNC;
WR_INLINE
uint64_t wr_dp_define_clip(WrState *aState,
LayoutRect aClipRect,
@ -1175,6 +1179,14 @@ void wr_dp_push_yuv_planar_image(WrState *aState,
ImageRendering aImageRendering)
WR_FUNC;
WR_INLINE
void wr_dp_restore(WrState *aState)
WR_FUNC;
WR_INLINE
void wr_dp_save(WrState *aState)
WR_FUNC;
extern bool wr_moz2d_render_cb(ByteSlice aBlob,
uint32_t aWidth,
uint32_t aHeight,

Просмотреть файл

@ -590,6 +590,7 @@ ShouldLoadCachedImage(imgRequest* aImgRequest,
int16_t decision = nsIContentPolicy::REJECT_REQUEST;
rv = NS_CheckContentLoadPolicy(aPolicyType,
contentLocation,
aTriggeringPrincipal, // loading principal
aTriggeringPrincipal,
aLoadingContext,
EmptyCString(), //mime guess

Просмотреть файл

@ -427,8 +427,10 @@ function CanonicalizeLanguageTag(locale) {
// "zh-nan" -> "nan"
// Note that the script generating extlangMappings makes sure that
// no extlang mapping will replace a normal language code.
subtag = extlangMappings[subtag].preferred;
if (i === 1 && extlangMappings[subtag].prefix === subtags[0]) {
// The preferred value for all current deprecated extlang subtags
// is equal to the extlang subtag, so we only need remove the
// redundant prefix to get the preferred value.
if (i === 1 && extlangMappings[subtag] === subtags[0]) {
callFunction(std_Array_shift, subtags);
i--;
}

Просмотреть файл

@ -1,7 +1,7 @@
// Generated by make_intl_data.py. DO NOT EDIT.
// Mappings from complete tags to preferred values.
// Derived from IANA Language Subtag Registry, file date 2017-03-03.
// Derived from IANA Language Subtag Registry, file date 2017-08-15.
// https://www.iana.org/assignments/language-subtag-registry
var langTagMappings = {
"art-lojban": "jbo",
@ -59,7 +59,7 @@ var langTagMappings = {
};
// Mappings from non-extlang subtags to preferred values.
// Derived from IANA Language Subtag Registry, file date 2017-03-03.
// Derived from IANA Language Subtag Registry, file date 2017-08-15.
// https://www.iana.org/assignments/language-subtag-registry
var langSubtagMappings = {
"BU": "MM",
@ -148,239 +148,242 @@ var langSubtagMappings = {
};
// Mappings from extlang subtags to preferred values.
// Derived from IANA Language Subtag Registry, file date 2017-03-03.
// All current deprecated extlang subtags have the form `<prefix>-<extlang>`
// and their preferred value is exactly equal to `<extlang>`. So each key in
// extlangMappings acts both as the extlang subtag and its preferred value.
// Derived from IANA Language Subtag Registry, file date 2017-08-15.
// https://www.iana.org/assignments/language-subtag-registry
var extlangMappings = {
"aao": {preferred: "aao", prefix: "ar"},
"abh": {preferred: "abh", prefix: "ar"},
"abv": {preferred: "abv", prefix: "ar"},
"acm": {preferred: "acm", prefix: "ar"},
"acq": {preferred: "acq", prefix: "ar"},
"acw": {preferred: "acw", prefix: "ar"},
"acx": {preferred: "acx", prefix: "ar"},
"acy": {preferred: "acy", prefix: "ar"},
"adf": {preferred: "adf", prefix: "ar"},
"ads": {preferred: "ads", prefix: "sgn"},
"aeb": {preferred: "aeb", prefix: "ar"},
"aec": {preferred: "aec", prefix: "ar"},
"aed": {preferred: "aed", prefix: "sgn"},
"aen": {preferred: "aen", prefix: "sgn"},
"afb": {preferred: "afb", prefix: "ar"},
"afg": {preferred: "afg", prefix: "sgn"},
"ajp": {preferred: "ajp", prefix: "ar"},
"apc": {preferred: "apc", prefix: "ar"},
"apd": {preferred: "apd", prefix: "ar"},
"arb": {preferred: "arb", prefix: "ar"},
"arq": {preferred: "arq", prefix: "ar"},
"ars": {preferred: "ars", prefix: "ar"},
"ary": {preferred: "ary", prefix: "ar"},
"arz": {preferred: "arz", prefix: "ar"},
"ase": {preferred: "ase", prefix: "sgn"},
"asf": {preferred: "asf", prefix: "sgn"},
"asp": {preferred: "asp", prefix: "sgn"},
"asq": {preferred: "asq", prefix: "sgn"},
"asw": {preferred: "asw", prefix: "sgn"},
"auz": {preferred: "auz", prefix: "ar"},
"avl": {preferred: "avl", prefix: "ar"},
"ayh": {preferred: "ayh", prefix: "ar"},
"ayl": {preferred: "ayl", prefix: "ar"},
"ayn": {preferred: "ayn", prefix: "ar"},
"ayp": {preferred: "ayp", prefix: "ar"},
"bbz": {preferred: "bbz", prefix: "ar"},
"bfi": {preferred: "bfi", prefix: "sgn"},
"bfk": {preferred: "bfk", prefix: "sgn"},
"bjn": {preferred: "bjn", prefix: "ms"},
"bog": {preferred: "bog", prefix: "sgn"},
"bqn": {preferred: "bqn", prefix: "sgn"},
"bqy": {preferred: "bqy", prefix: "sgn"},
"btj": {preferred: "btj", prefix: "ms"},
"bve": {preferred: "bve", prefix: "ms"},
"bvl": {preferred: "bvl", prefix: "sgn"},
"bvu": {preferred: "bvu", prefix: "ms"},
"bzs": {preferred: "bzs", prefix: "sgn"},
"cdo": {preferred: "cdo", prefix: "zh"},
"cds": {preferred: "cds", prefix: "sgn"},
"cjy": {preferred: "cjy", prefix: "zh"},
"cmn": {preferred: "cmn", prefix: "zh"},
"coa": {preferred: "coa", prefix: "ms"},
"cpx": {preferred: "cpx", prefix: "zh"},
"csc": {preferred: "csc", prefix: "sgn"},
"csd": {preferred: "csd", prefix: "sgn"},
"cse": {preferred: "cse", prefix: "sgn"},
"csf": {preferred: "csf", prefix: "sgn"},
"csg": {preferred: "csg", prefix: "sgn"},
"csl": {preferred: "csl", prefix: "sgn"},
"csn": {preferred: "csn", prefix: "sgn"},
"csq": {preferred: "csq", prefix: "sgn"},
"csr": {preferred: "csr", prefix: "sgn"},
"czh": {preferred: "czh", prefix: "zh"},
"czo": {preferred: "czo", prefix: "zh"},
"doq": {preferred: "doq", prefix: "sgn"},
"dse": {preferred: "dse", prefix: "sgn"},
"dsl": {preferred: "dsl", prefix: "sgn"},
"dup": {preferred: "dup", prefix: "ms"},
"ecs": {preferred: "ecs", prefix: "sgn"},
"esl": {preferred: "esl", prefix: "sgn"},
"esn": {preferred: "esn", prefix: "sgn"},
"eso": {preferred: "eso", prefix: "sgn"},
"eth": {preferred: "eth", prefix: "sgn"},
"fcs": {preferred: "fcs", prefix: "sgn"},
"fse": {preferred: "fse", prefix: "sgn"},
"fsl": {preferred: "fsl", prefix: "sgn"},
"fss": {preferred: "fss", prefix: "sgn"},
"gan": {preferred: "gan", prefix: "zh"},
"gds": {preferred: "gds", prefix: "sgn"},
"gom": {preferred: "gom", prefix: "kok"},
"gse": {preferred: "gse", prefix: "sgn"},
"gsg": {preferred: "gsg", prefix: "sgn"},
"gsm": {preferred: "gsm", prefix: "sgn"},
"gss": {preferred: "gss", prefix: "sgn"},
"gus": {preferred: "gus", prefix: "sgn"},
"hab": {preferred: "hab", prefix: "sgn"},
"haf": {preferred: "haf", prefix: "sgn"},
"hak": {preferred: "hak", prefix: "zh"},
"hds": {preferred: "hds", prefix: "sgn"},
"hji": {preferred: "hji", prefix: "ms"},
"hks": {preferred: "hks", prefix: "sgn"},
"hos": {preferred: "hos", prefix: "sgn"},
"hps": {preferred: "hps", prefix: "sgn"},
"hsh": {preferred: "hsh", prefix: "sgn"},
"hsl": {preferred: "hsl", prefix: "sgn"},
"hsn": {preferred: "hsn", prefix: "zh"},
"icl": {preferred: "icl", prefix: "sgn"},
"iks": {preferred: "iks", prefix: "sgn"},
"ils": {preferred: "ils", prefix: "sgn"},
"inl": {preferred: "inl", prefix: "sgn"},
"ins": {preferred: "ins", prefix: "sgn"},
"ise": {preferred: "ise", prefix: "sgn"},
"isg": {preferred: "isg", prefix: "sgn"},
"isr": {preferred: "isr", prefix: "sgn"},
"jak": {preferred: "jak", prefix: "ms"},
"jax": {preferred: "jax", prefix: "ms"},
"jcs": {preferred: "jcs", prefix: "sgn"},
"jhs": {preferred: "jhs", prefix: "sgn"},
"jls": {preferred: "jls", prefix: "sgn"},
"jos": {preferred: "jos", prefix: "sgn"},
"jsl": {preferred: "jsl", prefix: "sgn"},
"jus": {preferred: "jus", prefix: "sgn"},
"kgi": {preferred: "kgi", prefix: "sgn"},
"knn": {preferred: "knn", prefix: "kok"},
"kvb": {preferred: "kvb", prefix: "ms"},
"kvk": {preferred: "kvk", prefix: "sgn"},
"kvr": {preferred: "kvr", prefix: "ms"},
"kxd": {preferred: "kxd", prefix: "ms"},
"lbs": {preferred: "lbs", prefix: "sgn"},
"lce": {preferred: "lce", prefix: "ms"},
"lcf": {preferred: "lcf", prefix: "ms"},
"liw": {preferred: "liw", prefix: "ms"},
"lls": {preferred: "lls", prefix: "sgn"},
"lsg": {preferred: "lsg", prefix: "sgn"},
"lsl": {preferred: "lsl", prefix: "sgn"},
"lso": {preferred: "lso", prefix: "sgn"},
"lsp": {preferred: "lsp", prefix: "sgn"},
"lst": {preferred: "lst", prefix: "sgn"},
"lsy": {preferred: "lsy", prefix: "sgn"},
"ltg": {preferred: "ltg", prefix: "lv"},
"lvs": {preferred: "lvs", prefix: "lv"},
"lzh": {preferred: "lzh", prefix: "zh"},
"max": {preferred: "max", prefix: "ms"},
"mdl": {preferred: "mdl", prefix: "sgn"},
"meo": {preferred: "meo", prefix: "ms"},
"mfa": {preferred: "mfa", prefix: "ms"},
"mfb": {preferred: "mfb", prefix: "ms"},
"mfs": {preferred: "mfs", prefix: "sgn"},
"min": {preferred: "min", prefix: "ms"},
"mnp": {preferred: "mnp", prefix: "zh"},
"mqg": {preferred: "mqg", prefix: "ms"},
"mre": {preferred: "mre", prefix: "sgn"},
"msd": {preferred: "msd", prefix: "sgn"},
"msi": {preferred: "msi", prefix: "ms"},
"msr": {preferred: "msr", prefix: "sgn"},
"mui": {preferred: "mui", prefix: "ms"},
"mzc": {preferred: "mzc", prefix: "sgn"},
"mzg": {preferred: "mzg", prefix: "sgn"},
"mzy": {preferred: "mzy", prefix: "sgn"},
"nan": {preferred: "nan", prefix: "zh"},
"nbs": {preferred: "nbs", prefix: "sgn"},
"ncs": {preferred: "ncs", prefix: "sgn"},
"nsi": {preferred: "nsi", prefix: "sgn"},
"nsl": {preferred: "nsl", prefix: "sgn"},
"nsp": {preferred: "nsp", prefix: "sgn"},
"nsr": {preferred: "nsr", prefix: "sgn"},
"nzs": {preferred: "nzs", prefix: "sgn"},
"okl": {preferred: "okl", prefix: "sgn"},
"orn": {preferred: "orn", prefix: "ms"},
"ors": {preferred: "ors", prefix: "ms"},
"pel": {preferred: "pel", prefix: "ms"},
"pga": {preferred: "pga", prefix: "ar"},
"pgz": {preferred: "pgz", prefix: "sgn"},
"pks": {preferred: "pks", prefix: "sgn"},
"prl": {preferred: "prl", prefix: "sgn"},
"prz": {preferred: "prz", prefix: "sgn"},
"psc": {preferred: "psc", prefix: "sgn"},
"psd": {preferred: "psd", prefix: "sgn"},
"pse": {preferred: "pse", prefix: "ms"},
"psg": {preferred: "psg", prefix: "sgn"},
"psl": {preferred: "psl", prefix: "sgn"},
"pso": {preferred: "pso", prefix: "sgn"},
"psp": {preferred: "psp", prefix: "sgn"},
"psr": {preferred: "psr", prefix: "sgn"},
"pys": {preferred: "pys", prefix: "sgn"},
"rms": {preferred: "rms", prefix: "sgn"},
"rsl": {preferred: "rsl", prefix: "sgn"},
"rsm": {preferred: "rsm", prefix: "sgn"},
"sdl": {preferred: "sdl", prefix: "sgn"},
"sfb": {preferred: "sfb", prefix: "sgn"},
"sfs": {preferred: "sfs", prefix: "sgn"},
"sgg": {preferred: "sgg", prefix: "sgn"},
"sgx": {preferred: "sgx", prefix: "sgn"},
"shu": {preferred: "shu", prefix: "ar"},
"slf": {preferred: "slf", prefix: "sgn"},
"sls": {preferred: "sls", prefix: "sgn"},
"sqk": {preferred: "sqk", prefix: "sgn"},
"sqs": {preferred: "sqs", prefix: "sgn"},
"ssh": {preferred: "ssh", prefix: "ar"},
"ssp": {preferred: "ssp", prefix: "sgn"},
"ssr": {preferred: "ssr", prefix: "sgn"},
"svk": {preferred: "svk", prefix: "sgn"},
"swc": {preferred: "swc", prefix: "sw"},
"swh": {preferred: "swh", prefix: "sw"},
"swl": {preferred: "swl", prefix: "sgn"},
"syy": {preferred: "syy", prefix: "sgn"},
"szs": {preferred: "szs", prefix: "sgn"},
"tmw": {preferred: "tmw", prefix: "ms"},
"tse": {preferred: "tse", prefix: "sgn"},
"tsm": {preferred: "tsm", prefix: "sgn"},
"tsq": {preferred: "tsq", prefix: "sgn"},
"tss": {preferred: "tss", prefix: "sgn"},
"tsy": {preferred: "tsy", prefix: "sgn"},
"tza": {preferred: "tza", prefix: "sgn"},
"ugn": {preferred: "ugn", prefix: "sgn"},
"ugy": {preferred: "ugy", prefix: "sgn"},
"ukl": {preferred: "ukl", prefix: "sgn"},
"uks": {preferred: "uks", prefix: "sgn"},
"urk": {preferred: "urk", prefix: "ms"},
"uzn": {preferred: "uzn", prefix: "uz"},
"uzs": {preferred: "uzs", prefix: "uz"},
"vgt": {preferred: "vgt", prefix: "sgn"},
"vkk": {preferred: "vkk", prefix: "ms"},
"vkt": {preferred: "vkt", prefix: "ms"},
"vsi": {preferred: "vsi", prefix: "sgn"},
"vsl": {preferred: "vsl", prefix: "sgn"},
"vsv": {preferred: "vsv", prefix: "sgn"},
"wbs": {preferred: "wbs", prefix: "sgn"},
"wuu": {preferred: "wuu", prefix: "zh"},
"xki": {preferred: "xki", prefix: "sgn"},
"xml": {preferred: "xml", prefix: "sgn"},
"xmm": {preferred: "xmm", prefix: "ms"},
"xms": {preferred: "xms", prefix: "sgn"},
"ygs": {preferred: "ygs", prefix: "sgn"},
"yhs": {preferred: "yhs", prefix: "sgn"},
"ysl": {preferred: "ysl", prefix: "sgn"},
"yue": {preferred: "yue", prefix: "zh"},
"zib": {preferred: "zib", prefix: "sgn"},
"zlm": {preferred: "zlm", prefix: "ms"},
"zmi": {preferred: "zmi", prefix: "ms"},
"zsl": {preferred: "zsl", prefix: "sgn"},
"zsm": {preferred: "zsm", prefix: "ms"},
"aao": "ar",
"abh": "ar",
"abv": "ar",
"acm": "ar",
"acq": "ar",
"acw": "ar",
"acx": "ar",
"acy": "ar",
"adf": "ar",
"ads": "sgn",
"aeb": "ar",
"aec": "ar",
"aed": "sgn",
"aen": "sgn",
"afb": "ar",
"afg": "sgn",
"ajp": "ar",
"apc": "ar",
"apd": "ar",
"arb": "ar",
"arq": "ar",
"ars": "ar",
"ary": "ar",
"arz": "ar",
"ase": "sgn",
"asf": "sgn",
"asp": "sgn",
"asq": "sgn",
"asw": "sgn",
"auz": "ar",
"avl": "ar",
"ayh": "ar",
"ayl": "ar",
"ayn": "ar",
"ayp": "ar",
"bbz": "ar",
"bfi": "sgn",
"bfk": "sgn",
"bjn": "ms",
"bog": "sgn",
"bqn": "sgn",
"bqy": "sgn",
"btj": "ms",
"bve": "ms",
"bvl": "sgn",
"bvu": "ms",
"bzs": "sgn",
"cdo": "zh",
"cds": "sgn",
"cjy": "zh",
"cmn": "zh",
"coa": "ms",
"cpx": "zh",
"csc": "sgn",
"csd": "sgn",
"cse": "sgn",
"csf": "sgn",
"csg": "sgn",
"csl": "sgn",
"csn": "sgn",
"csq": "sgn",
"csr": "sgn",
"czh": "zh",
"czo": "zh",
"doq": "sgn",
"dse": "sgn",
"dsl": "sgn",
"dup": "ms",
"ecs": "sgn",
"esl": "sgn",
"esn": "sgn",
"eso": "sgn",
"eth": "sgn",
"fcs": "sgn",
"fse": "sgn",
"fsl": "sgn",
"fss": "sgn",
"gan": "zh",
"gds": "sgn",
"gom": "kok",
"gse": "sgn",
"gsg": "sgn",
"gsm": "sgn",
"gss": "sgn",
"gus": "sgn",
"hab": "sgn",
"haf": "sgn",
"hak": "zh",
"hds": "sgn",
"hji": "ms",
"hks": "sgn",
"hos": "sgn",
"hps": "sgn",
"hsh": "sgn",
"hsl": "sgn",
"hsn": "zh",
"icl": "sgn",
"iks": "sgn",
"ils": "sgn",
"inl": "sgn",
"ins": "sgn",
"ise": "sgn",
"isg": "sgn",
"isr": "sgn",
"jak": "ms",
"jax": "ms",
"jcs": "sgn",
"jhs": "sgn",
"jls": "sgn",
"jos": "sgn",
"jsl": "sgn",
"jus": "sgn",
"kgi": "sgn",
"knn": "kok",
"kvb": "ms",
"kvk": "sgn",
"kvr": "ms",
"kxd": "ms",
"lbs": "sgn",
"lce": "ms",
"lcf": "ms",
"liw": "ms",
"lls": "sgn",
"lsg": "sgn",
"lsl": "sgn",
"lso": "sgn",
"lsp": "sgn",
"lst": "sgn",
"lsy": "sgn",
"ltg": "lv",
"lvs": "lv",
"lzh": "zh",
"max": "ms",
"mdl": "sgn",
"meo": "ms",
"mfa": "ms",
"mfb": "ms",
"mfs": "sgn",
"min": "ms",
"mnp": "zh",
"mqg": "ms",
"mre": "sgn",
"msd": "sgn",
"msi": "ms",
"msr": "sgn",
"mui": "ms",
"mzc": "sgn",
"mzg": "sgn",
"mzy": "sgn",
"nan": "zh",
"nbs": "sgn",
"ncs": "sgn",
"nsi": "sgn",
"nsl": "sgn",
"nsp": "sgn",
"nsr": "sgn",
"nzs": "sgn",
"okl": "sgn",
"orn": "ms",
"ors": "ms",
"pel": "ms",
"pga": "ar",
"pgz": "sgn",
"pks": "sgn",
"prl": "sgn",
"prz": "sgn",
"psc": "sgn",
"psd": "sgn",
"pse": "ms",
"psg": "sgn",
"psl": "sgn",
"pso": "sgn",
"psp": "sgn",
"psr": "sgn",
"pys": "sgn",
"rms": "sgn",
"rsl": "sgn",
"rsm": "sgn",
"sdl": "sgn",
"sfb": "sgn",
"sfs": "sgn",
"sgg": "sgn",
"sgx": "sgn",
"shu": "ar",
"slf": "sgn",
"sls": "sgn",
"sqk": "sgn",
"sqs": "sgn",
"ssh": "ar",
"ssp": "sgn",
"ssr": "sgn",
"svk": "sgn",
"swc": "sw",
"swh": "sw",
"swl": "sgn",
"syy": "sgn",
"szs": "sgn",
"tmw": "ms",
"tse": "sgn",
"tsm": "sgn",
"tsq": "sgn",
"tss": "sgn",
"tsy": "sgn",
"tza": "sgn",
"ugn": "sgn",
"ugy": "sgn",
"ukl": "sgn",
"uks": "sgn",
"urk": "ms",
"uzn": "uz",
"uzs": "uz",
"vgt": "sgn",
"vkk": "ms",
"vkt": "ms",
"vsi": "sgn",
"vsl": "sgn",
"vsv": "sgn",
"wbs": "sgn",
"wuu": "zh",
"xki": "sgn",
"xml": "sgn",
"xmm": "ms",
"xms": "sgn",
"ygs": "sgn",
"yhs": "sgn",
"ysl": "sgn",
"yue": "zh",
"zib": "sgn",
"zlm": "ms",
"zmi": "ms",
"zsl": "sgn",
"zsm": "ms",
};

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше