Merge m-c to autoland. a=merge

This commit is contained in:
Ryan VanderMeulen 2016-08-29 12:52:13 -04:00
Родитель d14c6b15aa 416afe2f23
Коммит e7d85d7c46
149 изменённых файлов: 17709 добавлений и 12934 удалений

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

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1464967719000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1472235999000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -12,6 +12,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1229" id="/^(.*@(unblocker\.yt|sparpilot\.com))|axtara@axtara\.com$/">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i640" id="jid0-l9BxpNUhx1UUgRfKigWzSfrZqAc@jetpack">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -73,8 +79,8 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i72" os="WINNT" id="{4ED1F68A-5463-4931-9384-8FFF5ED91D92}">
<versionRange minVersion="3.4.1" maxVersion="3.4.1.194" severity="1">
<emItem blockID="i1245" id="{4ED1F68A-5463-4931-9384-8FFF5ED91D92}">
<versionRange minVersion="0" maxVersion="3.9.9" severity="1">
</versionRange>
<prefs>
</prefs>
@ -493,12 +499,6 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1229" id="/^.*@unblocker\.yt$/">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i404" id="{a9bb9fa0-4122-4c75-bd9a-bc27db3f9155}">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -784,6 +784,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1261" id="support@lastpass.com">
<versionRange minVersion="4.0.0a" maxVersion="4.1.20a" severity="1">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i732" id=" {e935dd68-f90d-46a6-b89e-c4657534b353}">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -992,7 +998,7 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i1222" id="tmbepff@trendmicro.com">
<emItem blockID="i1223" id="tmbepff@trendmicro.com">
<versionRange minVersion="0" maxVersion="9.1.0.1035" severity="1">
</versionRange>
<versionRange minVersion="9.2" maxVersion="9.2.0.1023" severity="1">
@ -1134,6 +1140,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1230" id="addon@gemaoff">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i540" id="/^(ffxtlbr@mixidj\.com|{c0c2693d-2ee8-47b4-9df7-b67a0ee31988}|{67097627-fd8e-4f6b-af4b-ecb65e50112e}|{f6f0f973-a4a3-48cf-9a7a-b7a69c30d71a}|{a3d0e35f-f1da-4ccb-ae77-e9d27777e68d}|{1122b43d-30ee-403f-9bfa-3cc99b0caddd})$/">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -1458,6 +1470,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1231" id="youtube@downloader.yt">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i754" id="{bb7b7a60-f574-47c2-8a0b-4c56f2da9802}">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -1514,6 +1532,15 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1232" id="nosquint@urandom.ca">
<versionRange minVersion="0" maxVersion="2.1.9.1-signed.1-signed" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="47" maxVersion="*" />
</targetApplication>
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i478" id="{7e8a1050-cf67-4575-92df-dcc60e7d952d}">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -1657,6 +1684,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1262" id="my7thfakeid@gmail.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i820" id="{aab02ab1-33cf-4dfa-8a9f-f4e60e976d27}">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -1931,6 +1964,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1265" id="@video_downloader_pro">
<versionRange minVersion="1.2.1" maxVersion="1.2.5" severity="1">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i60" id="youtb3@youtb3.com">
<versionRange minVersion="0" maxVersion="*">
@ -2011,6 +2050,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1233" id="cloudmask@cloudmask.com">
<versionRange minVersion="0" maxVersion="2.0.788">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i652" id="garg_sms@yahoo.in">
<versionRange minVersion="67.9" maxVersion="67.9" severity="3">
@ -2095,6 +2140,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1264" id="suchpony@suchpony.de">
<versionRange minVersion="0" maxVersion="1.6.7" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i516" id="/^({3f3cddf8-f74d-430c-bd19-d2c9147aed3d}|{515b2424-5911-40bd-8a2c-bdb20286d8f5}|{17464f93-137e-4646-a0c6-0dc13faf0113}|{d1b5aad5-d1ae-4b20-88b1-feeaeb4c1ebc}|{aad50c91-b136-49d9-8b30-0e8d3ead63d0})$/">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -2245,7 +2296,7 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i142" id="{a3a5c777-f583-4fef-9380-ab4add1bc2a8}">
<emItem blockID="i53" id="{a3a5c777-f583-4fef-9380-ab4add1bc2a8}">
<versionRange minVersion="2.0.3" maxVersion="2.0.3">
</versionRange>
<versionRange minVersion="4.2" maxVersion="4.2" severity="3">
@ -2273,6 +2324,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1263" id="axtara__web@axtara.com">
<versionRange minVersion="0" maxVersion="1.1.1" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i77" id="{fa277cfc-1d75-4949-a1f9-4ac8e41b2dfd}">
<versionRange minVersion="0" maxVersion="*">
@ -2734,8 +2791,11 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i314" id="crossriderapp8812@crossrider.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
<emItem blockID="i24" id="{6E19037A-12E3-4295-8915-ED48BC341614}">
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*" />
</targetApplication>
</versionRange>
<prefs>
</prefs>
@ -2752,11 +2812,8 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i24" id="{6E19037A-12E3-4295-8915-ED48BC341614}">
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.7a1pre" maxVersion="*" />
</targetApplication>
<emItem blockID="i314" id="crossriderapp8812@crossrider.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
<prefs>
</prefs>
@ -3513,33 +3570,69 @@
<match name="filename" exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="21.0.0.197" maxVersion="21.0.0.226" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem os="Linux" blockID="p1234">
<match name="filename" exp="libflashplayer\.so" /> <versionRange minVersion="11.2.202.616" maxVersion="11.2.202.621" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p1235">
<match name="filename" exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="18.0.0.343" maxVersion="18.0.0.352" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p1236">
<match name="filename" exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="21.0.0.226" maxVersion="21.0.0.242" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p1246">
<match name="filename" exp="(nppdf32\.dll)|(AdobePDFViewerNPAPI\.plugin)" /> <versionRange minVersion="10.1.6" maxVersion="11.0.16 " severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/reader</infoURL>
</pluginItem>
<pluginItem blockID="p1247">
<match name="filename" exp="(nppdf32\.dll)|(AdobePDFViewerNPAPI\.plugin)" /> <versionRange minVersion="15.006.30174" maxVersion="15.006.30174" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/reader</infoURL>
</pluginItem>
<pluginItem blockID="p1250">
<match name="filename" exp="(nppdf32\.dll)|(AdobePDFViewerNPAPI\.plugin)" /> <versionRange minVersion="15.016.20045" maxVersion="15.016.20045" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/reader</infoURL>
</pluginItem>
<pluginItem os="Linux" blockID="p1252">
<match name="filename" exp="libflashplayer\.so" /> <versionRange minVersion="11.2.202.621" maxVersion="11.2.202.626" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p1253">
<match name="filename" exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="18.0.0.352" maxVersion="18.0.0.360" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p1254">
<match name="filename" exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="21.0.0.242" maxVersion="22.0.0.192" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
</pluginItems>
<gfxItems>
<gfxBlacklistEntry blockID="g35"> <os>WINNT 6.1</os> <vendor>0x10de</vendor> <devices>
<device>0x0a6c</device>
</devices>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.17.12.5896</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.17.12.5896</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g36"> <os>WINNT 6.1</os> <vendor>0x10de</vendor> <devices>
<device>0x0a6c</device>
</devices>
<feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.17.12.5896</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g37"> <os>WINNT 5.1</os> <vendor>0x10de</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>7.0.0.0</driverVersion> <driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g144"> <os>All</os> <vendor>0x1002</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g146"> <os>All</os> <vendor>0x1022</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g148"> <os>All</os> <vendor>0x1022</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g150"> <os>All</os> <vendor>0x1002</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g192"> <os>WINNT 6.2</os> <vendor>0x1002</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>9.10.8.0</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g194"> <os>WINNT 6.2</os> <vendor>0x1022</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>9.10.8.0</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g198"> <os>Darwin 10</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g200"> <os>Darwin 11</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g202"> <os>Darwin 12</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g204"> <os>Darwin 10</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g206"> <os>Darwin 11</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g208"> <os>Darwin 12</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g230"> <os>Darwin 10</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g232"> <os>Darwin 11</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g234"> <os>Darwin 12</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.17.12.5896</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g37"> <os>WINNT 5.1</os> <vendor>0x10de</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>7.0.0.0</driverVersion> <driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g144"> <os>All</os> <vendor>0x1002</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g146"> <os>All</os> <vendor>0x1022</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g148"> <os>All</os> <vendor>0x1022</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g150"> <os>All</os> <vendor>0x1002</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.982.0.0</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g192"> <os>WINNT 6.2</os> <vendor>0x1002</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>9.10.8.0</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g194"> <os>WINNT 6.2</os> <vendor>0x1022</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>9.10.8.0</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g198"> <os>Darwin 10</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g200"> <os>Darwin 11</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g202"> <os>Darwin 12</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g204"> <os>Darwin 10</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g206"> <os>Darwin 11</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g208"> <os>Darwin 12</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g230"> <os>Darwin 10</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g232"> <os>Darwin 11</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g234"> <os>Darwin 12</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g278"> <os>WINNT 6.1</os> <vendor>0x1002</vendor> <devices>
<device>0x9802</device>
<device>0x9803</device>
@ -3549,7 +3642,7 @@
<device>0x9806</device>
<device>0x9807</device>
</devices>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g280"> <os>WINNT 6.1</os> <vendor>0x1002</vendor> <devices>
<device>0x9802</device>
<device>0x9803</device>
@ -3559,8 +3652,8 @@
<device>0x9806</device>
<device>0x9807</device>
</devices>
<feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g511"> <os>WINNT 5.1</os> <vendor>0x8086</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>6.14.10.5218</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator> </gfxBlacklistEntry>
<feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DEVICE</featureStatus></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g511"> <os>WINNT 5.1</os> <vendor>0x8086</vendor> <feature>DIRECT3D_9_LAYERS</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>6.14.10.5218</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g974"> <os>WINNT 10.0</os> <vendor>0x1002</vendor> <devices>
<device>0x6920</device>
<device>0x6921</device>
@ -3583,8 +3676,8 @@
<device>0x9876</device>
<device>0x9877</device>
</devices>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>15.201.1151.0</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g984"> <os>All</os> <vendor>0x8086</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.2413</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>15.201.1151.0</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g984"> <os>All</os> <vendor>0x8086</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.2413</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g992"> <os>WINNT 8.1</os> <vendor>0x1002</vendor> <devices>
<device>0x6920</device>
<device>0x6921</device>
@ -3607,8 +3700,7 @@
<device>0x9876</device>
<device>0x9877</device>
</devices>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>15.201.1151.0</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1057"> <os>WINNT 5.1</os> <vendor>0x8086</vendor> <feature>WEBGL_ANGLE</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>6.14.10.5218</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator> </gfxBlacklistEntry>
<feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>15.201.1151.0</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1068"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3616,7 +3708,7 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1851</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1851</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1069"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3624,7 +3716,7 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1855</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1855</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1070"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3632,7 +3724,7 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1872</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1872</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1071"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3640,7 +3732,7 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1883</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1883</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1072"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3648,7 +3740,7 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1892</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1892</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1073"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3656,7 +3748,7 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1994</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.1994</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1124"> <os>All</os> <vendor>0x8086</vendor> <devices>
<device>0x2a42</device>
<device>0x2e22</device>
@ -3664,14 +3756,15 @@
<device>0x2e32</device>
<device>0x0046</device>
</devices>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.2086</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1215"> <os>WINNT 5.1</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1216"> <os>WINNT 5.2</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1217"> <os>WINNT 6.0</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1218"> <os>WINNT 6.1</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1219"> <os>WINNT 6.2</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1220"> <os>WINNT 6.3</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1221"> <os>WINNT 10.0</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>8.15.10.2086</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1215"> <os>WINNT 5.1</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1216"> <os>WINNT 5.2</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1217"> <os>WINNT 6.0</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1218"> <os>WINNT 6.1</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1219"> <os>WINNT 6.2</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1220"> <os>WINNT 6.3</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1221"> <os>WINNT 10.0</os> <vendor>0x8086</vendor> <feature>HARDWARE_VIDEO_DECODING</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>10.18.10.3947</driverVersion> <driverVersionComparator>EQUAL</driverVersionComparator></gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g1251"> <os>WINNT 5.1</os> <vendor>0x8086</vendor> <feature>WEBGL_ANGLE</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>6.14.10.5218</driverVersion> <driverVersionComparator>LESS_THAN</driverVersionComparator><versionRange maxVersion="49.9" /></gfxBlacklistEntry>
</gfxItems>
<certItems>
@ -3693,10 +3786,10 @@
<certItem issuerName="MGExCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xMjAwBgNVBAMMKVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPcmdhbmlzYXRpZSBDQSAtIEcy">
<serialNumber>ATE0vw==</serialNumber>
</certItem>
<certItem issuerName="MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ">
<certItem issuerName="MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ==">
<serialNumber>ATFpsA==</serialNumber>
</certItem>
<certItem issuerName="MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ">
<certItem issuerName="MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ==">
<serialNumber>ATFEdg==</serialNumber>
</certItem>
<certItem issuerName="MDcxJDAiBgNVBAMTG1JDUyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEPMA0GA1UEChMGSFQgc3Js">
@ -4013,6 +4106,54 @@
</certItem>
<certItem issuerName="MIG1MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMS8wLQYDVQQDEyZWZXJpU2lnbiBDbGFzcyAzIFNlY3VyZSBTZXJ2ZXIgQ0EgLSBHMw==">
<serialNumber>NvEJoRYL2yvAZrAjbDIipQ==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>fWK0j/Vi8vNWg3VAGjc02w==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>UUFV3S2cUidOOv7ESN65Ng==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>bzTw0uq05TUYEGS98bh0Ww==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>GtXUVojhwOTkaQ4bTKblEQ==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>BYyEX2b5+K+myAIR7eXaRQ==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>VN2yeFexyXjPf34fHGmbhg==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>A9GPKQ8jv9oIxfwiOy7qxQ==</serialNumber>
</certItem>
<certItem issuerName="MIG8MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhIChjKTEwMTYwNAYDVQQDEy1WZXJpU2lnbiBDbGFzcyAzIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gRzM=">
<serialNumber>J2La+q+JOURNWkX60OP2lQ==</serialNumber>
</certItem>
<certItem issuerName="MFAxCzAJBgNVBAYTAkpQMRgwFgYDVQQKEw9TRUNPTSBUcnVzdC5uZXQxJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmljYXRpb24gUm9vdENBMQ==">
<serialNumber>Ermwxw==</serialNumber>
</certItem>
<certItem issuerName="MIHKMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA3IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHNA==">
<serialNumber>cXXMzbWDHMIdCotb3h64yw==</serialNumber>
</certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>BA==</serialNumber>
</certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>BQ==</serialNumber>
</certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>Bg==</serialNumber>
</certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>EA==</serialNumber>
</certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>EQ==</serialNumber>
</certItem>
<certItem issuerName="MDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTQ==">
<serialNumber>Eg==</serialNumber>
</certItem>
</certItems>

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

@ -428,8 +428,9 @@ var MigrationWizard = {
this.reportDataRecencyTelemetry();
}
if (this._autoMigrate) {
Services.telemetry.getKeyedHistogramById("FX_MIGRATION_HOMEPAGE_IMPORTED")
.add(this._source, !!this._newHomePage);
let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT");
Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE")
.add(this._source, hasImportedHomepage);
if (this._newHomePage) {
try {
// set homepage properly

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

@ -63,11 +63,11 @@
background-color: rgba(0,0,0,.3);
}
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#addon-bar) {
background-image: linear-gradient(@toolbarHighlight@, @toolbarHighlight@);
}
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):-moz-lwtheme {
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#addon-bar):-moz-lwtheme {
background-image: linear-gradient(@toolbarHighlightLWT@, @toolbarHighlightLWT@);
}

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

@ -287,7 +287,7 @@
border: none;
border-top: 1px solid var(--panel-separator-color);
padding: 8px 20px;
color: ButtonText;
color: inherit;
background-color: transparent;
}

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

@ -22,9 +22,7 @@ loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "AnimationsFront", "devtools/shared/fronts/animation", true);
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
const L10N = new LocalizationHelper("devtools/locale/animationinspector.properties");
// Global toolbox/inspector, set when startup is called.
var gToolbox, gInspector;

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

@ -10,9 +10,7 @@ const EventEmitter = require("devtools/shared/event-emitter");
const {createNode, TimeScale} = require("devtools/client/animationinspector/utils");
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
const L10N = new LocalizationHelper("devtools/locale/animationinspector.properties");
/**
* UI component responsible for displaying a single animation timeline, which

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

@ -9,9 +9,7 @@
const EventEmitter = require("devtools/shared/event-emitter");
const {createNode} = require("devtools/client/animationinspector/utils");
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
const L10N = new LocalizationHelper("devtools/locale/animationinspector.properties");
// List of playback rate presets displayed in the timeline toolbar.
const PLAYBACK_RATES = [.1, .25, .5, 1, 2, 5, 10];

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

@ -4,9 +4,8 @@
"use strict";
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "global/locale/layout_errors.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
const LAYOUT_ERRORS_L10N =
new LocalizationHelper("global/locale/layout_errors.properties");
// Test that when an animation is selected, its list of animated properties is
// displayed below it.
@ -79,7 +78,7 @@ function hasExpectedWarnings(containerEl) {
for (let warning of warnings) {
let warningID =
"CompositorAnimationWarningTransformWithGeometricProperties";
if (warning.getAttribute("title") == L10N.getStr(warningID)) {
if (warning.getAttribute("title") == LAYOUT_ERRORS_L10N.getStr(warningID)) {
return true;
}
}

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

@ -7,11 +7,6 @@ requestLongerTimeout(2);
// Test that the panel shows no animation data for invalid or not animated nodes
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel, window} = yield openAnimationInspector();
@ -28,7 +23,7 @@ add_task(function* () {
is(panel.animationsTimelineComponent.animationsEl.childNodes.length, 0,
"No animation displayed in the timeline component for a still node");
is(document.querySelector("#error-type").textContent,
L10N.getStr("panel.invalidElementSelected"),
ANIMATION_L10N.getStr("panel.invalidElementSelected"),
"The correct error message is displayed");
info("Select the comment text node and check that the panel is empty");
@ -42,6 +37,6 @@ add_task(function* () {
is(panel.animationsTimelineComponent.animationsEl.childNodes.length, 0,
"No animation displayed in the timeline component for a text node");
is(document.querySelector("#error-type").textContent,
L10N.getStr("panel.invalidElementSelected"),
ANIMATION_L10N.getStr("panel.invalidElementSelected"),
"The correct error message is displayed");
});

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

@ -9,11 +9,6 @@ requestLongerTimeout(2);
// Test that when animations displayed in the timeline are running on the
// compositor, they get a special icon and information in the tooltip.
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
add_task(function* () {
yield addTab(URL_ROOT + "doc_simple_animation.html");
let {inspector, panel} = yield openAnimationInspector();
@ -26,7 +21,7 @@ add_task(function* () {
ok(animationEl.classList.contains("fast-track"),
"The animation element has the fast-track css class");
ok(hasTooltip(animationEl,
L10N.getStr("player.allPropertiesOnCompositorTooltip")),
ANIMATION_L10N.getStr("player.allPropertiesOnCompositorTooltip")),
"The animation element has the right tooltip content");
info("Select a node we know doesn't have an animation on the compositor");
@ -36,10 +31,10 @@ add_task(function* () {
ok(!animationEl.classList.contains("fast-track"),
"The animation element does not have the fast-track css class");
ok(!hasTooltip(animationEl,
L10N.getStr("player.allPropertiesOnCompositorTooltip")),
ANIMATION_L10N.getStr("player.allPropertiesOnCompositorTooltip")),
"The animation element does not have oncompositor tooltip content");
ok(!hasTooltip(animationEl,
L10N.getStr("player.somePropertiesOnCompositorTooltip")),
ANIMATION_L10N.getStr("player.somePropertiesOnCompositorTooltip")),
"The animation element does not have oncompositor tooltip content");
info("Select a node we know has animation on the compositor and not on the" +
@ -50,7 +45,7 @@ add_task(function* () {
ok(animationEl.classList.contains("fast-track"),
"The animation element has the fast-track css class");
ok(hasTooltip(animationEl,
L10N.getStr("player.somePropertiesOnCompositorTooltip")),
ANIMATION_L10N.getStr("player.somePropertiesOnCompositorTooltip")),
"The animation element has the right tooltip content");
});

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

@ -14,6 +14,8 @@ Services.scriptloader.loadSubScript(
const FRAME_SCRIPT_URL = CHROME_URL_ROOT + "doc_frame_script.js";
const COMMON_FRAME_SCRIPT_URL = "chrome://devtools/content/shared/frame-script-utils.js";
const TAB_NAME = "animationinspector";
const ANIMATION_L10N =
new LocalizationHelper("devtools/locale/animationinspector.properties");
// Auto clean-up when a test ends
registerCleanupFunction(function* () {

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

@ -9,9 +9,7 @@
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/animationinspector.properties";
const L10N = new LocalizationHelper(STRINGS_URI);
const L10N = new LocalizationHelper("devtools/locale/animationinspector.properties");
// How many times, maximum, can we loop before we find the optimal time
// interval in the timeline graph.

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

@ -24,35 +24,36 @@ loader.lazyGetter(this, "ScratchpadPanel", () => require("devtools/client/scratc
loader.lazyGetter(this, "DomPanel", () => require("devtools/client/dom/dom-panel").DomPanel);
// Strings
const toolboxProps = "chrome://devtools/locale/toolbox.properties";
const inspectorProps = "chrome://devtools/locale/inspector.properties";
const webConsoleProps = "chrome://devtools/locale/webconsole.properties";
const debuggerProps = "chrome://devtools/locale/debugger.properties";
const styleEditorProps = "chrome://devtools/locale/styleeditor.properties";
const shaderEditorProps = "chrome://devtools/locale/shadereditor.properties";
const canvasDebuggerProps = "chrome://devtools/locale/canvasdebugger.properties";
const webAudioEditorProps = "chrome://devtools/locale/webaudioeditor.properties";
const performanceProps = "chrome://devtools/locale/performance.properties";
const netMonitorProps = "chrome://devtools/locale/netmonitor.properties";
const storageProps = "chrome://devtools/locale/storage.properties";
const scratchpadProps = "chrome://devtools/locale/scratchpad.properties";
const memoryProps = "chrome://devtools/locale/memory.properties";
const domProps = "chrome://devtools/locale/dom.properties";
const toolboxProps = "devtools/locale/toolbox.properties";
const inspectorProps = "devtools/locale/inspector.properties";
const webConsoleProps = "devtools/locale/webconsole.properties";
const debuggerProps = "devtools/locale/debugger.properties";
const styleEditorProps = "devtools/locale/styleeditor.properties";
const shaderEditorProps = "devtools/locale/shadereditor.properties";
const canvasDebuggerProps = "devtools/locale/canvasdebugger.properties";
const webAudioEditorProps = "devtools/locale/webaudioeditor.properties";
const performanceProps = "devtools/locale/performance.properties";
const netMonitorProps = "devtools/locale/netmonitor.properties";
const storageProps = "devtools/locale/storage.properties";
const scratchpadProps = "devtools/locale/scratchpad.properties";
const memoryProps = "devtools/locale/memory.properties";
const domProps = "devtools/locale/dom.properties";
loader.lazyGetter(this, "toolboxStrings", () => Services.strings.createBundle(toolboxProps));
loader.lazyGetter(this, "performanceStrings", () => Services.strings.createBundle(performanceProps));
loader.lazyGetter(this, "webConsoleStrings", () => Services.strings.createBundle(webConsoleProps));
loader.lazyGetter(this, "debuggerStrings", () => Services.strings.createBundle(debuggerProps));
loader.lazyGetter(this, "styleEditorStrings", () => Services.strings.createBundle(styleEditorProps));
loader.lazyGetter(this, "shaderEditorStrings", () => Services.strings.createBundle(shaderEditorProps));
loader.lazyGetter(this, "canvasDebuggerStrings", () => Services.strings.createBundle(canvasDebuggerProps));
loader.lazyGetter(this, "webAudioEditorStrings", () => Services.strings.createBundle(webAudioEditorProps));
loader.lazyGetter(this, "inspectorStrings", () => Services.strings.createBundle(inspectorProps));
loader.lazyGetter(this, "netMonitorStrings", () => Services.strings.createBundle(netMonitorProps));
loader.lazyGetter(this, "storageStrings", () => Services.strings.createBundle(storageProps));
loader.lazyGetter(this, "scratchpadStrings", () => Services.strings.createBundle(scratchpadProps));
loader.lazyGetter(this, "memoryStrings", () => Services.strings.createBundle(memoryProps));
loader.lazyGetter(this, "domStrings", () => Services.strings.createBundle(domProps));
const {LocalizationHelper} = require("devtools/shared/l10n");
const toolboxStrings = new LocalizationHelper(toolboxProps);
const performanceStrings = new LocalizationHelper(performanceProps);
const webConsoleStrings = new LocalizationHelper(webConsoleProps);
const debuggerStrings = new LocalizationHelper(debuggerProps);
const styleEditorStrings = new LocalizationHelper(styleEditorProps);
const shaderEditorStrings = new LocalizationHelper(shaderEditorProps);
const canvasDebuggerStrings = new LocalizationHelper(canvasDebuggerProps);
const webAudioEditorStrings = new LocalizationHelper(webAudioEditorProps);
const inspectorStrings = new LocalizationHelper(inspectorProps);
const netMonitorStrings = new LocalizationHelper(netMonitorProps);
const storageStrings = new LocalizationHelper(storageProps);
const scratchpadStrings = new LocalizationHelper(scratchpadProps);
const memoryStrings = new LocalizationHelper(memoryProps);
const domStrings = new LocalizationHelper(domProps);
var Tools = {};
exports.Tools = Tools;
@ -494,8 +495,7 @@ exports.defaultThemes = [
*/
function l10n(name, bundle, arg) {
try {
return arg ? bundle.formatStringFromName(name, [arg], 1)
: bundle.GetStringFromName(name);
return arg ? bundle.getFormatStr(name, arg) : bundle.getStr(name);
} catch (ex) {
console.log("Error reading '" + name + "'");
throw new Error("l10n error with " + name);

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

@ -8,14 +8,8 @@ const {Cc, Ci, Cu} = require("chrome");
const Services = require("Services");
const defer = require("devtools/shared/defer");
function l10n(name) {
const bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties");
try {
return bundle.GetStringFromName(name);
} catch (e) {
throw new Error("Failed loading l10n string: " + name);
}
}
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
function handleThreadState(toolbox, event, packet) {
// Suppress interrupted events by default because the thread is
@ -78,7 +72,7 @@ function attachThread(toolbox) {
if (res.error === "wrongOrder") {
const box = toolbox.getNotificationBox();
box.appendNotification(
l10n("toolbox.resumeOrderWarning"),
L10N.getStr("toolbox.resumeOrderWarning"),
"wrong-resume-order",
"",
box.PRIORITY_WARNING_HIGH

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

@ -12,8 +12,8 @@
* - devtools/client/definitions for tool-specifics entries
*/
const Services = require("Services");
const MenuStrings = Services.strings.createBundle("chrome://devtools/locale/menus.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const MENUS_L10N = new LocalizationHelper("devtools/locale/menus.properties");
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/devtools-browser", true);
@ -23,7 +23,7 @@ loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/de
const FragmentsCache = new Map();
function l10n(key) {
return MenuStrings.GetStringFromName(key);
return MENUS_L10N.getStr(key);
}
/**

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

@ -8,21 +8,18 @@
var Cu = Components.utils;
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
var Services = require("Services");
var {gDevTools} = require("devtools/client/framework/devtools");
var {TargetFactory} = require("devtools/client/framework/target");
var {Toolbox} = require("devtools/client/framework/toolbox");
var {DebuggerClient} = require("devtools/shared/client/main");
var {Task} = require("devtools/shared/task");
var {LocalizationHelper} = require("devtools/shared/l10n");
var L10N = new LocalizationHelper("devtools/locale/connection-screen.properties");
var gClient;
var gConnectionTimeout;
XPCOMUtils.defineLazyGetter(window, "l10n", function () {
return Services.strings.createBundle("chrome://devtools/locale/connection-screen.properties");
});
/**
* Once DOM is ready, we prefil the host/port inputs with
* pref-stored values.
@ -134,7 +131,7 @@ var onConnectionReady = Task.async(function* ([aType, aTraits]) {
openToolbox(globals, true, "webconsole", false);
}
};
a.title = a.textContent = window.l10n.GetStringFromName("mainProcess");
a.title = a.textContent = L10N.getStr("mainProcess");
a.className = "remote-process";
a.href = "#";
gParent.appendChild(a);

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

@ -30,7 +30,8 @@ loader.lazyRequireGetter(this, "BrowserMenus", "devtools/client/framework/browse
loader.lazyImporter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm");
loader.lazyImporter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm");
const bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
const TABS_OPEN_PEAK_HISTOGRAM = "DEVTOOLS_TABS_OPEN_PEAK_LINEAR";
const TABS_OPEN_AVG_HISTOGRAM = "DEVTOOLS_TABS_OPEN_AVERAGE_LINEAR";
@ -244,7 +245,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
// Do nothing if there is only one process, the parent process.
let contentProcesses = response.processes.filter(p => (!p.parent));
if (contentProcesses.length < 1) {
let msg = bundle.GetStringFromName("toolbox.noContentProcess.message");
let msg = L10N.getStr("toolbox.noContentProcess.message");
Services.prompt.alert(null, "", msg);
deferred.reject("No content processes available.");
return;

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

@ -4,12 +4,14 @@
"use strict";
var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
var Services = require("Services");
var {Task} = require("devtools/shared/task");
var EventEmitter = require("devtools/shared/event-emitter");
var Telemetry = require("devtools/client/shared/telemetry");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
/**
@ -130,7 +132,8 @@ ToolSidebar.prototype = {
this._allTabsBtn.setAttribute("top", "0");
this._allTabsBtn.setAttribute("width", "15");
this._allTabsBtn.setAttribute("type", "menu");
this._allTabsBtn.setAttribute("tooltiptext", l10n("sidebar.showAllTabs.tooltip"));
this._allTabsBtn.setAttribute("tooltiptext",
L10N.getStr("sidebar.showAllTabs.tooltip"));
this._allTabsBtn.setAttribute("hidden", "true");
allTabsContainer.appendChild(this._allTabsBtn);
@ -587,19 +590,3 @@ ToolSidebar.prototype = {
this._toolPanel = null;
})
};
XPCOMUtils.defineLazyGetter(this, "l10n", function () {
let bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties");
let l10n = function (aName, ...aArgs) {
try {
if (aArgs.length == 0) {
return bundle.GetStringFromName(aName);
} else {
return bundle.formatStringFromName(aName, aArgs, aArgs.length);
}
} catch (ex) {
console.log("Error reading '" + aName + "'");
}
};
return l10n;
});

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

@ -10,8 +10,9 @@
const URL = "data:text/html;charset=utf8,test page";
var {Toolbox} = require("devtools/client/framework/toolbox");
var strings = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
function getZoomValue() {
return parseFloat(Services.prefs.getCharPref("devtools.toolbox.zoomValue"));
@ -39,7 +40,7 @@ add_task(function* () {
});
function zoomWithKey(toolbox, key) {
let shortcut = strings.GetStringFromName(key);
let shortcut = L10N.getStr(key);
if (!shortcut) {
info("Key was empty, skipping zoomWithKey");
return;

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

@ -11,8 +11,9 @@
const URL = "data:text/html;charset=utf8,test page for toolbox switching";
var {Toolbox} = require("devtools/client/framework/toolbox");
var strings = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
add_task(function* () {
info("Create a test tab and open the toolbox");
@ -20,7 +21,7 @@ add_task(function* () {
let target = TargetFactory.forTab(tab);
let toolbox = yield gDevTools.showToolbox(target, "webconsole");
let shortcut = strings.GetStringFromName("toolbox.toggleHost.key");
let shortcut = L10N.getStr("toolbox.toggleHost.key");
let {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
checkHostType(toolbox, BOTTOM, SIDE);

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

@ -10,8 +10,8 @@
// and toggles appropriate things in the toolbox.
var doc = null, toolbox = null, panelWin = null, modifiedPrefs = [];
var strings = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
add_task(function* () {
const URL = "data:text/html;charset=utf8,test for dynamically registering " +
@ -60,18 +60,18 @@ function* testOptionsShortcut() {
yield toolbox.selectTool("webconsole");
is(toolbox.currentToolId, "webconsole", "webconsole is selected");
synthesizeKeyShortcut(strings.GetStringFromName("toolbox.options.key"));
synthesizeKeyShortcut(L10N.getStr("toolbox.options.key"));
is(toolbox.currentToolId, "options", "Toolbox selected via shortcut key (1)");
synthesizeKeyShortcut(strings.GetStringFromName("toolbox.options.key"));
synthesizeKeyShortcut(L10N.getStr("toolbox.options.key"));
is(toolbox.currentToolId, "webconsole", "webconsole is selected (1)");
yield toolbox.selectTool("webconsole");
is(toolbox.currentToolId, "webconsole", "webconsole is selected");
synthesizeKeyShortcut(strings.GetStringFromName("toolbox.help.key"));
synthesizeKeyShortcut(L10N.getStr("toolbox.help.key"));
is(toolbox.currentToolId, "options", "Toolbox selected via shortcut key (2)");
synthesizeKeyShortcut(strings.GetStringFromName("toolbox.options.key"));
synthesizeKeyShortcut(L10N.getStr("toolbox.options.key"));
is(toolbox.currentToolId, "webconsole", "webconsole is reselected (2)");
synthesizeKeyShortcut(strings.GetStringFromName("toolbox.help.key"));
synthesizeKeyShortcut(L10N.getStr("toolbox.help.key"));
is(toolbox.currentToolId, "options", "Toolbox selected via shortcut key (2)");
}

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

@ -3,11 +3,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
requestLongerTimeout(2);
var {Toolbox} = require("devtools/client/framework/toolbox");
var strings = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
add_task(function* () {
let tab = yield addTab("about:blank");
@ -18,10 +21,9 @@ add_task(function* () {
.filter(def => def.isTargetSupported(target))
.map(def => def.id);
let toolbox = yield gDevTools.showToolbox(target, toolIDs[0],
Toolbox.HostType.BOTTOM);
let nextShortcut = strings.GetStringFromName("toolbox.nextTool.key")
let prevShortcut = strings.GetStringFromName("toolbox.previousTool.key")
let toolbox = yield gDevTools.showToolbox(target, toolIDs[0], Toolbox.HostType.BOTTOM);
let nextShortcut = L10N.getStr("toolbox.nextTool.key");
let prevShortcut = L10N.getStr("toolbox.previousTool.key");
// Iterate over all tools, starting from options to netmonitor, in normal
// order.

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

@ -10,8 +10,9 @@ const TEST_URL = "data:text/html;charset=utf-8," +
"<body><h1>Testing reload from devtools</h1></body></html>";
var {Toolbox} = require("devtools/client/framework/toolbox");
var strings = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
var target, toolbox, description, reloadsSent, toolIDs;
@ -83,7 +84,7 @@ function testReload(shortcut, docked, toolID, callback) {
description = docked + " devtools with tool " + toolID + ", shortcut #" + shortcut;
info("Testing reload in " + description);
synthesizeKeyShortcut(strings.GetStringFromName(shortcut), toolbox.win);
synthesizeKeyShortcut(L10N.getStr(shortcut), toolbox.win);
reloadsSent++;
}

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

@ -3,13 +3,12 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
var modifiers = {
accelKey: true
};
"use strict";
var toolbox;
var strings = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
function test() {
addTab("about:blank").then(openToolbox);
@ -48,7 +47,7 @@ function testZoomLevel(type, times, expected) {
function sendZoomKey(shortcut, times) {
for (let i = 0; i < times; i++) {
synthesizeKeyShortcut(strings.GetStringFromName(shortcut));
synthesizeKeyShortcut(L10N.getStr(shortcut));
}
}
@ -61,7 +60,7 @@ function tidyUp() {
toolbox.destroy().then(function () {
gBrowser.removeCurrentTab();
toolbox = modifiers = null;
toolbox = null;
finish();
});
}

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

@ -8,26 +8,13 @@
const Services = require("Services");
const defer = require("devtools/shared/defer");
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
const {Task} = require("devtools/shared/task");
const {gDevTools} = require("devtools/client/framework/devtools");
exports.OptionsPanel = OptionsPanel;
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
XPCOMUtils.defineLazyGetter(this, "l10n", function () {
let bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties");
let l10n = function (name, ...aArgs) {
try {
if (aArgs.length == 0) {
return bundle.GetStringFromName(name);
}
return bundle.formatStringFromName(name, aArgs, aArgs.length);
} catch (ex) {
console.log("Error reading '" + name + "'");
}
};
return l10n;
});
exports.OptionsPanel = OptionsPanel;
function GetPref(name) {
let type = Services.prefs.getPrefType(name);
@ -220,8 +207,8 @@ OptionsPanel.prototype = {
checkboxSpanLabel.textContent = tool.label;
} else {
atleastOneToolNotSupported = true;
checkboxSpanLabel.textContent = l10n(
"options.toolNotSupportedMarker", tool.label);
checkboxSpanLabel.textContent =
L10N.getFormatStr("options.toolNotSupportedMarker", tool.label);
checkboxInput.setAttribute("data-unsupported", "true");
checkboxInput.setAttribute("disabled", "true");
}

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

@ -32,21 +32,9 @@ const { KeyCodes } = require("devtools/client/shared/keycodes");
const { BrowserLoader } =
Cu.import("resource://devtools/client/shared/browser-loader.js", {});
loader.lazyGetter(this, "toolboxStrings", () => {
const properties = "chrome://devtools/locale/toolbox.properties";
const bundle = Services.strings.createBundle(properties);
return (name, ...args) => {
try {
if (!args.length) {
return bundle.GetStringFromName(name);
}
return bundle.formatStringFromName(name, args, args.length);
} catch (ex) {
console.log("Error reading '" + name + "'");
return null;
}
};
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
loader.lazyRequireGetter(this, "CommandUtils",
"devtools/client/shared/developer-toolbar", true);
loader.lazyRequireGetter(this, "getHighlighterUtils",
@ -386,7 +374,7 @@ Toolbox.prototype = {
useOnlyShared: true
}).require;
iframe.setAttribute("aria-label", toolboxStrings("toolbox.label"));
iframe.setAttribute("aria-label", L10N.getStr("toolbox.label"));
let domHelper = new DOMHelpers(iframe.contentWindow);
domHelper.onceDOMReady(() => {
domReady.resolve();
@ -545,8 +533,8 @@ Toolbox.prototype = {
// Prevent the opening of bookmarks window on toolbox.options.key
event.preventDefault();
};
shortcuts.on(toolboxStrings("toolbox.options.key"), selectOptions);
shortcuts.on(toolboxStrings("toolbox.help.key"), selectOptions);
shortcuts.on(L10N.getStr("toolbox.options.key"), selectOptions);
shortcuts.on(L10N.getStr("toolbox.help.key"), selectOptions);
},
_splitConsoleOnKeypress: function (e) {
@ -591,7 +579,7 @@ Toolbox.prototype = {
["forceReload", true],
["forceReload2", true]
].forEach(([id, force]) => {
let key = toolboxStrings("toolbox." + id + ".key");
let key = L10N.getStr("toolbox." + id + ".key");
shortcuts.on(key, (name, event) => {
this.reloadTarget(force);
@ -602,13 +590,13 @@ Toolbox.prototype = {
},
_addHostListeners: function (shortcuts) {
shortcuts.on(toolboxStrings("toolbox.nextTool.key"),
shortcuts.on(L10N.getStr("toolbox.nextTool.key"),
this.selectNextTool.bind(this));
shortcuts.on(toolboxStrings("toolbox.previousTool.key"),
shortcuts.on(L10N.getStr("toolbox.previousTool.key"),
this.selectPreviousTool.bind(this));
shortcuts.on(toolboxStrings("toolbox.minimize.key"),
shortcuts.on(L10N.getStr("toolbox.minimize.key"),
this._toggleMinimizeMode.bind(this));
shortcuts.on(toolboxStrings("toolbox.toggleHost.key"),
shortcuts.on(L10N.getStr("toolbox.toggleHost.key"),
(name, event) => {
this.switchToPreviousHost();
event.preventDefault();
@ -703,7 +691,7 @@ Toolbox.prototype = {
let key = doc.createElement("key");
key.id = "key_browserconsole";
key.setAttribute("key", toolboxStrings("browserConsoleCmd.commandkey"));
key.setAttribute("key", L10N.getStr("browserConsoleCmd.commandkey"));
key.setAttribute("modifiers", "accel,shift");
// needed. See bug 371900
key.setAttribute("oncommand", "void(0)");
@ -807,7 +795,7 @@ Toolbox.prototype = {
let button = this.doc.createElementNS(HTML_NS, "button");
button.id = "toolbox-dock-" + position;
button.className = "toolbox-dock-button devtools-button";
button.setAttribute("title", toolboxStrings("toolboxDockButtons." +
button.setAttribute("title", L10N.getStr("toolboxDockButtons." +
position + ".tooltip"));
button.addEventListener("click", () => {
this.switchHost(position);
@ -818,7 +806,7 @@ Toolbox.prototype = {
},
_getMinimizeButtonShortcutTooltip: function () {
let str = toolboxStrings("toolbox.minimize.key");
let str = L10N.getStr("toolbox.minimize.key");
let key = KeyShortcuts.parseElectronKey(this.win, str);
return "(" + KeyShortcuts.stringify(key) + ")";
},
@ -828,7 +816,7 @@ Toolbox.prototype = {
btn.className = "minimized";
btn.setAttribute("title",
toolboxStrings("toolboxDockButtons.bottom.maximize") + " " +
L10N.getStr("toolboxDockButtons.bottom.maximize") + " " +
this._getMinimizeButtonShortcutTooltip());
},
@ -837,7 +825,7 @@ Toolbox.prototype = {
btn.className = "maximized";
btn.setAttribute("title",
toolboxStrings("toolboxDockButtons.bottom.minimize") + " " +
L10N.getStr("toolboxDockButtons.bottom.minimize") + " " +
this._getMinimizeButtonShortcutTooltip());
},
@ -985,7 +973,7 @@ Toolbox.prototype = {
this._pickerButton = this.doc.createElementNS(HTML_NS, "button");
this._pickerButton.id = "command-button-pick";
this._pickerButton.className = "command-button command-button-invertable devtools-button";
this._pickerButton.setAttribute("title", toolboxStrings("pickButton.tooltip"));
this._pickerButton.setAttribute("title", L10N.getStr("pickButton.tooltip"));
this._pickerButton.setAttribute("hidden", "true");
let container = this.doc.querySelector("#toolbox-picker-container");
@ -1577,10 +1565,10 @@ Toolbox.prototype = {
_refreshHostTitle: function () {
let title;
if (this.target.name && this.target.name != this.target.url) {
title = toolboxStrings("toolbox.titleTemplate2",
this.target.name, this.target.url);
title = L10N.getFormatStr("toolbox.titleTemplate2", this.target.name,
this.target.url);
} else {
title = toolboxStrings("toolbox.titleTemplate1", this.target.url);
title = L10N.getFormatStr("toolbox.titleTemplate1", this.target.url);
}
this._host.setTitle(title);
},
@ -1588,7 +1576,7 @@ Toolbox.prototype = {
// Returns an instance of the preference actor
get _preferenceFront() {
return this.target.root.then(rootForm => {
return new getPreferenceFront(this.target.client, rootForm);
return new L10N.getFormatStr(this.target.client, rootForm);
});
},

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

@ -32,10 +32,9 @@ const clipboardHelper = require("devtools/shared/platform/clipboard");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
XPCOMUtils.defineLazyGetter(CssComputedView, "_strings", function () {
return Services.strings.createBundle(
"chrome://devtools-shared/locale/styleinspector.properties");
});
const STYLE_INSPECTOR_PROPERTIES = "devtools-shared/locale/styleinspector.properties";
const {LocalizationHelper} = require("devtools/shared/l10n");
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
const FILTER_CHANGED_TIMEOUT = 150;
const HTML_NS = "http://www.w3.org/1999/xhtml";
@ -210,7 +209,7 @@ function CssComputedView(inspector, document, pageStyle) {
}
/**
* Memoized lookup of a l10n string from a string bundle.
* Lookup a l10n string in the shared styleinspector string bundle.
*
* @param {String} name
* The key to lookup.
@ -218,7 +217,7 @@ function CssComputedView(inspector, document, pageStyle) {
*/
CssComputedView.l10n = function (name) {
try {
return CssComputedView._strings.GetStringFromName(name);
return STYLE_INSPECTOR_L10N.getStr(name);
} catch (ex) {
console.log("Error reading '" + name + "'");
throw new Error("l10n error with " + name);

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

@ -31,12 +31,9 @@ const {ToolSidebar} = require("devtools/client/inspector/toolsidebar");
const {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
const clipboardHelper = require("devtools/shared/platform/clipboard");
loader.lazyGetter(this, "strings", () => {
return Services.strings.createBundle("chrome://devtools/locale/inspector.properties");
});
loader.lazyGetter(this, "toolboxStrings", () => {
return Services.strings.createBundle("chrome://devtools/locale/toolbox.properties");
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const INSPECTOR_L10N = new LocalizationHelper("devtools/locale/inspector.properties");
const TOOLBOX_L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
/**
* Represents an open instance of the Inspector for a tab.
@ -213,7 +210,7 @@ InspectorPanel.prototype = {
notificationBox.getNotificationWithValue("inspector-script-paused");
if (!notification && this._toolbox.currentToolId == "inspector" &&
this._toolbox.threadClient.paused) {
let message = strings.GetStringFromName("debuggerPausedWarning.message");
let message = INSPECTOR_L10N.getStr("debuggerPausedWarning.message");
notificationBox.appendNotification(message,
"inspector-script-paused", "", notificationBox.PRIORITY_WARNING_HIGH);
}
@ -361,7 +358,7 @@ InspectorPanel.prototype = {
let shortcuts = new KeyShortcuts({
window: this.panelDoc.defaultView,
});
let key = strings.GetStringFromName("inspector.searchHTML.key");
let key = INSPECTOR_L10N.getStr("inspector.searchHTML.key");
shortcuts.on(key, (name, event) => {
// Prevent overriding same shortcut from the computed/rule views
if (event.target.closest("#sidebar-panel-ruleview") ||
@ -381,11 +378,10 @@ InspectorPanel.prototype = {
let str = "";
if (event !== "search-cleared") {
if (result) {
str = strings.formatStringFromName(
"inspector.searchResultsCount2",
[result.resultsIndex + 1, result.resultsLength], 2);
str = INSPECTOR_L10N.getFormatStr(
"inspector.searchResultsCount2", result.resultsIndex + 1, result.resultsLength);
} else {
str = strings.GetStringFromName("inspector.searchResultsNone");
str = INSPECTOR_L10N.getStr("inspector.searchResultsNone");
}
}
@ -423,12 +419,12 @@ InspectorPanel.prototype = {
// Append all side panels
this.sidebar.addExistingTab(
"ruleview",
strings.GetStringFromName("inspector.sidebar.ruleViewTitle"),
INSPECTOR_L10N.getStr("inspector.sidebar.ruleViewTitle"),
defaultTab == "ruleview");
this.sidebar.addExistingTab(
"computedview",
strings.GetStringFromName("inspector.sidebar.computedViewTitle"),
INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
defaultTab == "computedview");
this._setDefaultSidebar = (event, toolId) => {
@ -443,7 +439,7 @@ InspectorPanel.prototype = {
if (this.target.form.animationsActor) {
this.sidebar.addFrameTab(
"animationinspector",
strings.GetStringFromName("inspector.sidebar.animationInspectorTitle"),
INSPECTOR_L10N.getStr("inspector.sidebar.animationInspectorTitle"),
"chrome://devtools/content/animationinspector/animation-inspector.xhtml",
defaultTab == "animationinspector");
}
@ -452,7 +448,7 @@ InspectorPanel.prototype = {
this.canGetUsedFontFaces) {
this.sidebar.addExistingTab(
"fontinspector",
strings.GetStringFromName("inspector.sidebar.fontInspectorTitle"),
INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle"),
defaultTab == "fontinspector");
this.fontInspector = new FontInspector(this, this.panelWin);
@ -519,8 +515,8 @@ InspectorPanel.prototype = {
let sidebarToggle = SidebarToggle({
onClick: this.onPaneToggleButtonClicked,
collapsed: false,
expandPaneTitle: strings.GetStringFromName("inspector.expandPane"),
collapsePaneTitle: strings.GetStringFromName("inspector.collapsePane"),
expandPaneTitle: INSPECTOR_L10N.getStr("inspector.expandPane"),
collapsePaneTitle: INSPECTOR_L10N.getStr("inspector.collapsePane"),
});
let parentBox = this.panelDoc.getElementById("inspector-sidebar-toggle-box");
@ -875,37 +871,37 @@ InspectorPanel.prototype = {
let menu = new Menu();
menu.append(new MenuItem({
id: "node-menu-edithtml",
label: strings.GetStringFromName("inspectorHTMLEdit.label"),
accesskey: strings.GetStringFromName("inspectorHTMLEdit.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorHTMLEdit.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorHTMLEdit.accesskey"),
disabled: !isEditableElement || !this.isOuterHTMLEditable,
click: () => this.editHTML(),
}));
menu.append(new MenuItem({
id: "node-menu-add",
label: strings.GetStringFromName("inspectorAddNode.label"),
accesskey: strings.GetStringFromName("inspectorAddNode.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorAddNode.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorAddNode.accesskey"),
disabled: !this.canAddHTMLChild(),
click: () => this.addNode(),
}));
menu.append(new MenuItem({
id: "node-menu-duplicatenode",
label: strings.GetStringFromName("inspectorDuplicateNode.label"),
label: INSPECTOR_L10N.getStr("inspectorDuplicateNode.label"),
hidden: !this._supportsDuplicateNode,
disabled: !isDuplicatableElement,
click: () => this.duplicateNode(),
}));
menu.append(new MenuItem({
id: "node-menu-delete",
label: strings.GetStringFromName("inspectorHTMLDelete.label"),
accesskey: strings.GetStringFromName("inspectorHTMLDelete.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorHTMLDelete.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorHTMLDelete.accesskey"),
disabled: !isEditableElement,
click: () => this.deleteNode(),
}));
menu.append(new MenuItem({
label: strings.GetStringFromName("inspectorAttributesSubmenu.label"),
label: INSPECTOR_L10N.getStr("inspectorAttributesSubmenu.label"),
accesskey:
strings.GetStringFromName("inspectorAttributesSubmenu.accesskey"),
INSPECTOR_L10N.getStr("inspectorAttributesSubmenu.accesskey"),
submenu: this._getAttributesSubmenu(isEditableElement),
}));
@ -939,42 +935,42 @@ InspectorPanel.prototype = {
let copySubmenu = new Menu();
copySubmenu.append(new MenuItem({
id: "node-menu-copyinner",
label: strings.GetStringFromName("inspectorCopyInnerHTML.label"),
accesskey: strings.GetStringFromName("inspectorCopyInnerHTML.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorCopyInnerHTML.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorCopyInnerHTML.accesskey"),
disabled: !isSelectionElement,
click: () => this.copyInnerHTML(),
}));
copySubmenu.append(new MenuItem({
id: "node-menu-copyouter",
label: strings.GetStringFromName("inspectorCopyOuterHTML.label"),
accesskey: strings.GetStringFromName("inspectorCopyOuterHTML.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorCopyOuterHTML.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorCopyOuterHTML.accesskey"),
disabled: !isSelectionElement,
click: () => this.copyOuterHTML(),
}));
copySubmenu.append(new MenuItem({
id: "node-menu-copyuniqueselector",
label: strings.GetStringFromName("inspectorCopyCSSSelector.label"),
label: INSPECTOR_L10N.getStr("inspectorCopyCSSSelector.label"),
accesskey:
strings.GetStringFromName("inspectorCopyCSSSelector.accesskey"),
INSPECTOR_L10N.getStr("inspectorCopyCSSSelector.accesskey"),
disabled: !isSelectionElement,
hidden: !this.canGetUniqueSelector,
click: () => this.copyUniqueSelector(),
}));
copySubmenu.append(new MenuItem({
id: "node-menu-copyimagedatauri",
label: strings.GetStringFromName("inspectorImageDataUri.label"),
label: INSPECTOR_L10N.getStr("inspectorImageDataUri.label"),
disabled: !isSelectionElement || !markupContainer ||
!markupContainer.isPreviewable(),
click: () => this.copyImageDataUri(),
}));
menu.append(new MenuItem({
label: strings.GetStringFromName("inspectorCopyHTMLSubmenu.label"),
label: INSPECTOR_L10N.getStr("inspectorCopyHTMLSubmenu.label"),
submenu: copySubmenu,
}));
menu.append(new MenuItem({
label: strings.GetStringFromName("inspectorPasteHTMLSubmenu.label"),
label: INSPECTOR_L10N.getStr("inspectorPasteHTMLSubmenu.label"),
submenu: this._getPasteSubmenu(isEditableElement),
}));
@ -986,13 +982,13 @@ InspectorPanel.prototype = {
markupContainer.hasChildren;
menu.append(new MenuItem({
id: "node-menu-expand",
label: strings.GetStringFromName("inspectorExpandNode.label"),
label: INSPECTOR_L10N.getStr("inspectorExpandNode.label"),
disabled: !isNodeWithChildren,
click: () => this.expandNode(),
}));
menu.append(new MenuItem({
id: "node-menu-collapse",
label: strings.GetStringFromName("inspectorCollapseNode.label"),
label: INSPECTOR_L10N.getStr("inspectorCollapseNode.label"),
disabled: !isNodeWithChildren || !markupContainer.expanded,
click: () => this.collapseNode(),
}));
@ -1003,27 +999,27 @@ InspectorPanel.prototype = {
menu.append(new MenuItem({
id: "node-menu-scrollnodeintoview",
label: strings.GetStringFromName("inspectorScrollNodeIntoView.label"),
label: INSPECTOR_L10N.getStr("inspectorScrollNodeIntoView.label"),
accesskey:
strings.GetStringFromName("inspectorScrollNodeIntoView.accesskey"),
INSPECTOR_L10N.getStr("inspectorScrollNodeIntoView.accesskey"),
hidden: !this._supportsScrollIntoView,
disabled: !isSelectionElement,
click: () => this.scrollNodeIntoView(),
}));
menu.append(new MenuItem({
id: "node-menu-screenshotnode",
label: strings.GetStringFromName("inspectorScreenshotNode.label"),
label: INSPECTOR_L10N.getStr("inspectorScreenshotNode.label"),
disabled: !isScreenshotable,
click: () => this.screenshotNode(),
}));
menu.append(new MenuItem({
id: "node-menu-useinconsole",
label: strings.GetStringFromName("inspectorUseInConsole.label"),
label: INSPECTOR_L10N.getStr("inspectorUseInConsole.label"),
click: () => this.useInConsole(),
}));
menu.append(new MenuItem({
id: "node-menu-showdomproperties",
label: strings.GetStringFromName("inspectorShowDOMProperties.label"),
label: INSPECTOR_L10N.getStr("inspectorShowDOMProperties.label"),
click: () => this.showDOMProperties(),
}));
@ -1055,47 +1051,47 @@ InspectorPanel.prototype = {
let pasteSubmenu = new Menu();
pasteSubmenu.append(new MenuItem({
id: "node-menu-pasteinnerhtml",
label: strings.GetStringFromName("inspectorPasteInnerHTML.label"),
accesskey: strings.GetStringFromName("inspectorPasteInnerHTML.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorPasteInnerHTML.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorPasteInnerHTML.accesskey"),
disabled: !isPasteable || !this.canPasteInnerOrAdjacentHTML,
click: () => this.pasteInnerHTML(),
}));
pasteSubmenu.append(new MenuItem({
id: "node-menu-pasteouterhtml",
label: strings.GetStringFromName("inspectorPasteOuterHTML.label"),
accesskey: strings.GetStringFromName("inspectorPasteOuterHTML.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorPasteOuterHTML.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorPasteOuterHTML.accesskey"),
disabled: !isPasteable || !this.isOuterHTMLEditable,
click: () => this.pasteOuterHTML(),
}));
pasteSubmenu.append(new MenuItem({
id: "node-menu-pastebefore",
label: strings.GetStringFromName("inspectorHTMLPasteBefore.label"),
label: INSPECTOR_L10N.getStr("inspectorHTMLPasteBefore.label"),
accesskey:
strings.GetStringFromName("inspectorHTMLPasteBefore.accesskey"),
INSPECTOR_L10N.getStr("inspectorHTMLPasteBefore.accesskey"),
disabled: disableAdjacentPaste,
click: () => this.pasteAdjacentHTML("beforeBegin"),
}));
pasteSubmenu.append(new MenuItem({
id: "node-menu-pasteafter",
label: strings.GetStringFromName("inspectorHTMLPasteAfter.label"),
label: INSPECTOR_L10N.getStr("inspectorHTMLPasteAfter.label"),
accesskey:
strings.GetStringFromName("inspectorHTMLPasteAfter.accesskey"),
INSPECTOR_L10N.getStr("inspectorHTMLPasteAfter.accesskey"),
disabled: disableAdjacentPaste,
click: () => this.pasteAdjacentHTML("afterEnd"),
}));
pasteSubmenu.append(new MenuItem({
id: "node-menu-pastefirstchild",
label: strings.GetStringFromName("inspectorHTMLPasteFirstChild.label"),
label: INSPECTOR_L10N.getStr("inspectorHTMLPasteFirstChild.label"),
accesskey:
strings.GetStringFromName("inspectorHTMLPasteFirstChild.accesskey"),
INSPECTOR_L10N.getStr("inspectorHTMLPasteFirstChild.accesskey"),
disabled: disableFirstLastPaste,
click: () => this.pasteAdjacentHTML("afterBegin"),
}));
pasteSubmenu.append(new MenuItem({
id: "node-menu-pastelastchild",
label: strings.GetStringFromName("inspectorHTMLPasteLastChild.label"),
label: INSPECTOR_L10N.getStr("inspectorHTMLPasteLastChild.label"),
accesskey:
strings.GetStringFromName("inspectorHTMLPasteLastChild.accesskey"),
INSPECTOR_L10N.getStr("inspectorHTMLPasteLastChild.accesskey"),
disabled: disableFirstLastPaste,
click: () => this.pasteAdjacentHTML("beforeEnd"),
}));
@ -1111,26 +1107,26 @@ InspectorPanel.prototype = {
attributesSubmenu.append(new MenuItem({
id: "node-menu-add-attribute",
label: strings.GetStringFromName("inspectorAddAttribute.label"),
accesskey: strings.GetStringFromName("inspectorAddAttribute.accesskey"),
label: INSPECTOR_L10N.getStr("inspectorAddAttribute.label"),
accesskey: INSPECTOR_L10N.getStr("inspectorAddAttribute.accesskey"),
disabled: !isEditableElement,
click: () => this.onAddAttribute(),
}));
attributesSubmenu.append(new MenuItem({
id: "node-menu-edit-attribute",
label: strings.formatStringFromName("inspectorEditAttribute.label",
[isAttributeClicked ? `"${nodeInfo.name}"` : ""], 1),
accesskey: strings.GetStringFromName("inspectorEditAttribute.accesskey"),
label: INSPECTOR_L10N.getFormatStr("inspectorEditAttribute.label",
isAttributeClicked ? `"${nodeInfo.name}"` : ""),
accesskey: INSPECTOR_L10N.getStr("inspectorEditAttribute.accesskey"),
disabled: !isAttributeClicked,
click: () => this.onEditAttribute(),
}));
attributesSubmenu.append(new MenuItem({
id: "node-menu-remove-attribute",
label: strings.formatStringFromName("inspectorRemoveAttribute.label",
[isAttributeClicked ? `"${nodeInfo.name}"` : ""], 1),
label: INSPECTOR_L10N.getFormatStr("inspectorRemoveAttribute.label",
isAttributeClicked ? `"${nodeInfo.name}"` : ""),
accesskey:
strings.GetStringFromName("inspectorRemoveAttribute.accesskey"),
INSPECTOR_L10N.getStr("inspectorRemoveAttribute.accesskey"),
disabled: !isAttributeClicked,
click: () => this.onRemoveAttribute(),
}));
@ -1168,25 +1164,25 @@ InspectorPanel.prototype = {
// Links can't be opened in new tabs in the browser toolbox.
if (type === "uri" && !this.target.chrome) {
linkFollow.visible = true;
linkFollow.label = strings.GetStringFromName(
linkFollow.label = INSPECTOR_L10N.getStr(
"inspector.menu.openUrlInNewTab.label");
} else if (type === "cssresource") {
linkFollow.visible = true;
linkFollow.label = toolboxStrings.GetStringFromName(
linkFollow.label = TOOLBOX_L10N.getStr(
"toolbox.viewCssSourceInStyleEditor.label");
} else if (type === "jsresource") {
linkFollow.visible = true;
linkFollow.label = toolboxStrings.GetStringFromName(
linkFollow.label = TOOLBOX_L10N.getStr(
"toolbox.viewJsSourceInDebugger.label");
}
linkCopy.visible = true;
linkCopy.label = strings.GetStringFromName(
linkCopy.label = INSPECTOR_L10N.getStr(
"inspector.menu.copyUrlToClipboard.label");
} else if (type === "idref") {
linkFollow.visible = true;
linkFollow.label = strings.formatStringFromName(
"inspector.menu.selectElement.label", [popupNode.dataset.link], 1);
linkFollow.label = INSPECTOR_L10N.getFormatStr(
"inspector.menu.selectElement.label", popupNode.dataset.link);
}
return [linkFollow, linkCopy];
@ -1210,7 +1206,7 @@ InspectorPanel.prototype = {
this._markupBox.appendChild(this._markupFrame);
this._markupFrame.setAttribute("src", "chrome://devtools/content/inspector/markup/markup.xhtml");
this._markupFrame.setAttribute("aria-label",
strings.GetStringFromName("inspector.panelLabel.markupView"));
INSPECTOR_L10N.getStr("inspector.panelLabel.markupView"));
},
_onMarkupFrameLoad: function () {

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

@ -113,19 +113,17 @@ InspectorSearch.prototype = {
}),
_onInput: function () {
if (this.searchBox.value.length === 0) {
this._onSearch();
}
},
_onKeyDown: function (event) {
if (this.searchBox.value.length === 0) {
this.searchClearButton.hidden = true;
this.searchBox.removeAttribute("filled");
this._onSearch();
} else {
this.searchClearButton.hidden = false;
this.searchBox.setAttribute("filled", true);
}
},
_onKeyDown: function (event) {
if (event.keyCode === KeyCodes.DOM_VK_RETURN) {
this._onSearch(event.shiftKey);
}

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

@ -61,6 +61,9 @@ const {KeyCodes} = require("devtools/client/shared/keycodes");
const {AutocompletePopup} = require("devtools/client/shared/autocomplete-popup");
const clipboardHelper = require("devtools/shared/platform/clipboard");
const {LocalizationHelper} = require("devtools/shared/l10n");
const INSPECTOR_L10N = new LocalizationHelper("devtools/locale/inspector.properties");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@ -686,7 +689,7 @@ MarkupView.prototype = {
["markupView.hide.key",
"markupView.edit.key",
"markupView.scrollInto.key"].forEach(name => {
let key = this.strings.GetStringFromName(name);
let key = INSPECTOR_L10N.getStr(name);
shortcuts.on(key, (_, event) => this._onShortcut(name, event));
});
@ -1666,9 +1669,9 @@ MarkupView.prototype = {
if (!(children.hasFirst && children.hasLast)) {
let nodesCount = container.node.numChildren;
let showAllString = PluralForm.get(nodesCount,
this.strings.GetStringFromName("markupView.more.showAll2"));
INSPECTOR_L10N.getStr("markupView.more.showAll2"));
let data = {
showing: this.strings.GetStringFromName("markupView.more.showing"),
showing: INSPECTOR_L10N.getStr("markupView.more.showing"),
showAll: showAllString.replace("#1", nodesCount),
allButtonClick: () => {
container.maxChildren = -1;
@ -3616,8 +3619,4 @@ function getAutocompleteMaxWidth(element, container) {
return containerRect.right - elementRect.left - 2;
}
loader.lazyGetter(MarkupView.prototype, "strings", () => Services.strings.createBundle(
"chrome://devtools/locale/inspector.properties"
));
exports.MarkupView = MarkupView;

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

@ -8,10 +8,8 @@
// in an attribute.
const TEST_URL = URL_ROOT + "doc_markup_links.html";
const STRINGS = Services.strings
.createBundle("chrome://devtools/locale/inspector.properties");
const TOOLBOX_STRINGS = Services.strings
.createBundle("chrome://devtools/locale/toolbox.properties");
const TOOLBOX_L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
// The test case array contains objects with the following properties:
// - selector: css selector for the node to select in the inspector
@ -28,9 +26,9 @@ const TEST_DATA = [{
popupNodeSelector: ".link",
isLinkFollowItemVisible: true,
isLinkCopyItemVisible: true,
linkFollowItemLabel: TOOLBOX_STRINGS.GetStringFromName(
linkFollowItemLabel: TOOLBOX_L10N.getStr(
"toolbox.viewCssSourceInStyleEditor.label"),
linkCopyItemLabel: STRINGS.GetStringFromName(
linkCopyItemLabel: INSPECTOR_L10N.getStr(
"inspector.menu.copyUrlToClipboard.label")
}, {
selector: "link[rel=icon]",
@ -38,9 +36,9 @@ const TEST_DATA = [{
popupNodeSelector: ".link",
isLinkFollowItemVisible: true,
isLinkCopyItemVisible: true,
linkFollowItemLabel: STRINGS.GetStringFromName(
linkFollowItemLabel: INSPECTOR_L10N.getStr(
"inspector.menu.openUrlInNewTab.label"),
linkCopyItemLabel: STRINGS.GetStringFromName(
linkCopyItemLabel: INSPECTOR_L10N.getStr(
"inspector.menu.copyUrlToClipboard.label")
}, {
selector: "link",
@ -54,17 +52,17 @@ const TEST_DATA = [{
popupNodeSelector: ".link",
isLinkFollowItemVisible: true,
isLinkCopyItemVisible: false,
linkFollowItemLabel: STRINGS.formatStringFromName(
"inspector.menu.selectElement.label", ["name"], 1)
linkFollowItemLabel: INSPECTOR_L10N.getFormatStr(
"inspector.menu.selectElement.label", "name")
}, {
selector: "script",
attributeName: "src",
popupNodeSelector: ".link",
isLinkFollowItemVisible: true,
isLinkCopyItemVisible: true,
linkFollowItemLabel: TOOLBOX_STRINGS.GetStringFromName(
linkFollowItemLabel: TOOLBOX_L10N.getStr(
"toolbox.viewJsSourceInDebugger.label"),
linkCopyItemLabel: STRINGS.GetStringFromName(
linkCopyItemLabel: INSPECTOR_L10N.getStr(
"inspector.menu.copyUrlToClipboard.label")
}, {
selector: "p[for]",

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

@ -15,6 +15,10 @@ const {promiseWarn} = require("devtools/client/inspector/shared/utils");
const {parseDeclarations} = require("devtools/shared/css-parsing-utils");
const Services = require("Services");
const STYLE_INSPECTOR_PROPERTIES = "devtools-shared/locale/styleinspector.properties";
const {LocalizationHelper} = require("devtools/shared/l10n");
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
/**
* Rule is responsible for the following:
* Manages a single style declaration or rule.
@ -80,8 +84,7 @@ Rule.prototype = {
eltText += "#" + this.inherited.id;
}
this._inheritedSource =
CssLogic._strings.formatStringFromName("rule.inheritedFrom",
[eltText], 1);
STYLE_INSPECTOR_L10N.getFormatStr("rule.inheritedFrom", eltText);
}
return this._inheritedSource;
},
@ -93,8 +96,7 @@ Rule.prototype = {
this._keyframesName = "";
if (this.keyframes) {
this._keyframesName =
CssLogic._strings.formatStringFromName("rule.keyframe",
[this.keyframes.name], 1);
STYLE_INSPECTOR_L10N.getFormatStr("rule.keyframe", this.keyframes.name);
}
return this._keyframesName;
},

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

@ -10,9 +10,6 @@
const promise = require("promise");
const defer = require("devtools/shared/defer");
const Services = require("Services");
/* eslint-disable mozilla/reject-some-requires */
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
/* eslint-enable mozilla/reject-some-requires */
const {Task} = require("devtools/shared/task");
const {Tools} = require("devtools/client/definitions");
const {l10n} = require("devtools/shared/inspector/css-logic");
@ -32,11 +29,6 @@ const StyleInspectorMenu = require("devtools/client/inspector/shared/style-inspe
const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
const clipboardHelper = require("devtools/shared/platform/clipboard");
XPCOMUtils.defineLazyGetter(this, "_strings", function () {
return Services.strings.createBundle(
"chrome://devtools-shared/locale/styleinspector.properties");
});
const {AutocompletePopup} = require("devtools/client/shared/autocomplete-popup");
const HTML_NS = "http://www.w3.org/1999/xhtml";

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

@ -22,7 +22,7 @@ function* addNewRuleFromContextMenu(inspector, view) {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, view.element);
let menuitemAddRule = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.addNewRule"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.addNewRule"));
ok(menuitemAddRule.visible, "Add rule is visible");

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

@ -17,9 +17,6 @@ const CONTENT = `
</body>
`;
const STRINGS = Services.strings
.createBundle("chrome://devtools-shared/locale/styleinspector.properties");
add_task(function* () {
let tab = yield addTab("data:text/html;charset=utf-8," + CONTENT);
@ -36,13 +33,13 @@ function checkRuleViewContent({styleDocument}) {
is(headers.length, 3, "There are 3 headers for inherited rules");
is(headers[0].textContent,
STRINGS.formatStringFromName("rule.inheritedFrom", ["p"], 1),
STYLE_INSPECTOR_L10N.getFormatStr("rule.inheritedFrom", "p"),
"The first header is correct");
is(headers[1].textContent,
STRINGS.formatStringFromName("rule.inheritedFrom", ["div"], 1),
STYLE_INSPECTOR_L10N.getFormatStr("rule.inheritedFrom", "div"),
"The second header is correct");
is(headers[2].textContent,
STRINGS.formatStringFromName("rule.inheritedFrom", ["body"], 1),
STYLE_INSPECTOR_L10N.getFormatStr("rule.inheritedFrom", "body"),
"The third header is correct");
let rules = styleDocument.querySelectorAll(".ruleview-rule");
@ -50,17 +47,14 @@ function checkRuleViewContent({styleDocument}) {
for (let rule of rules) {
let selector = rule.querySelector(".ruleview-selectorcontainer");
is(selector.textContent,
STRINGS.GetStringFromName("rule.sourceElement"),
is(selector.textContent, STYLE_INSPECTOR_L10N.getStr("rule.sourceElement"),
"The rule's selector is correct");
let propertyNames = [...rule.querySelectorAll(".ruleview-propertyname")];
is(propertyNames.length, 1,
"There's only one property name, as expected");
is(propertyNames.length, 1, "There's only one property name, as expected");
let propertyValues = [...rule.querySelectorAll(".ruleview-propertyvalue")];
is(propertyValues.length, 1,
"There's only one property value, as expected");
is(propertyValues.length, 1, "There's only one property value, as expected");
}
}

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

@ -61,7 +61,7 @@ function* testMdnContextMenuItemVisibility(view) {
info("Creating context menu with " + node + " as popupNode");
let allMenuItems = openStyleContextMenuAndGetAllItems(view, node);
let menuitemShowMdnDocs = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.showMdnDocs"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"));
let isVisible = menuitemShowMdnDocs.visible;
let shouldBeVisible = isPropertyNameNode(node);

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

@ -45,7 +45,7 @@ add_task(function* () {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, nameSpan.firstChild);
let menuitemShowMdnDocs = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.showMdnDocs"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"));
let cssDocs = view.tooltips.cssDocs;

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

@ -105,7 +105,7 @@ function* testMdnContextMenuItemVisibility(view, shouldBeVisible) {
let node = root.querySelector("." + PROPERTY_NAME_CLASS).firstChild;
let allMenuItems = openStyleContextMenuAndGetAllItems(view, node);
let menuitemShowMdnDocs = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.showMdnDocs"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"));
let isVisible = menuitemShowMdnDocs.visible;
is(isVisible, shouldBeVisible,

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

@ -215,21 +215,21 @@ add_task(function* () {
function* checkCopyStyle(view, node, menuItemLabel, expectedPattern, visible) {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, node);
let menuItem = allMenuItems.find(item =>
item.label === _STRINGS.GetStringFromName(menuItemLabel));
item.label === STYLE_INSPECTOR_L10N.getStr(menuItemLabel));
let menuitemCopy = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copy"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copy"));
let menuitemCopyLocation = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyLocation"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyLocation"));
let menuitemCopyPropertyDeclaration = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyPropertyDeclaration"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyPropertyDeclaration"));
let menuitemCopyPropertyName = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyPropertyName"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyPropertyName"));
let menuitemCopyPropertyValue = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyPropertyValue"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyPropertyValue"));
let menuitemCopySelector = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copySelector"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copySelector"));
let menuitemCopyRule = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyRule"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyRule"));
ok(menuitemCopy.disabled,
"Copy disabled is as expected: true");

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

@ -16,10 +16,7 @@ add_task(function* () {
let elementStyle = view._elementStyle;
let _strings = Services.strings
.createBundle("chrome://devtools-shared/locale/styleinspector.properties");
let inline = _strings.GetStringFromName("rule.sourceInline");
let inline = STYLE_INSPECTOR_L10N.getStr("rule.sourceInline");
is(elementStyle.rules.length, 3, "Should have 3 rules.");
is(elementStyle.rules[0].title, inline, "check rule 0 title");

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

@ -69,7 +69,7 @@ function* checkCopySelection(view) {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, prop);
let menuitemCopy = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copy"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copy"));
ok(menuitemCopy.visible,
"Copy menu item is displayed as expected");
@ -103,7 +103,7 @@ function* checkSelectAll(view) {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, prop);
let menuitemCopy = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copy"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copy"));
ok(menuitemCopy.visible,
"Copy menu item is displayed as expected");
@ -131,7 +131,7 @@ function* checkCopyEditorValue(view) {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, editor.input);
let menuitemCopy = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copy"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copy"));
ok(menuitemCopy.visible,
"Copy menu item is displayed as expected");

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

@ -19,8 +19,8 @@ var {getInplaceEditorForSpan: inplaceEditor} =
const ROOT_TEST_DIR = getRootDirectory(gTestPath);
const FRAME_SCRIPT_URL = ROOT_TEST_DIR + "doc_frame_script.js";
const _STRINGS = Services.strings.createBundle(
"chrome://devtools-shared/locale/styleinspector.properties");
const STYLE_INSPECTOR_L10N = new LocalizationHelper("chrome://devtools-shared/locale/styleinspector.properties");
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.defaultColorUnit");

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

@ -4,9 +4,6 @@
"use strict";
/* eslint-disable mozilla/reject-some-requires */
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
/* eslint-enable mozilla/reject-some-requires */
const {l10n} = require("devtools/shared/inspector/css-logic");
const {ELEMENT_STYLE} = require("devtools/shared/specs/styles");
const {PREF_ORIG_SOURCES} = require("devtools/client/styleeditor/utils");
@ -31,10 +28,9 @@ const promise = require("promise");
const Services = require("Services");
const EventEmitter = require("devtools/shared/event-emitter");
XPCOMUtils.defineLazyGetter(this, "_strings", function () {
return Services.strings.createBundle(
"chrome://devtools-shared/locale/styleinspector.properties");
});
const STYLE_INSPECTOR_PROPERTIES = "devtools-shared/locale/styleinspector.properties";
const {LocalizationHelper} = require("devtools/shared/l10n");
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
const HTML_NS = "http://www.w3.org/1999/xhtml";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@ -239,7 +235,7 @@ RuleEditor.prototype = {
}
if (this.rule.isSystem) {
let uaLabel = _strings.GetStringFromName("rule.userAgentStyles");
let uaLabel = STYLE_INSPECTOR_L10N.getStr("rule.userAgentStyles");
sourceLabel.setAttribute("value", uaLabel + " " + title);
// Special case about:PreferenceStyleSheet, as it is generated on the

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

@ -3,7 +3,6 @@
/* 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/. */
/* global _strings */
"use strict";
@ -16,10 +15,10 @@ const MenuItem = require("devtools/client/framework/menu-item");
const overlays = require("devtools/client/inspector/shared/style-inspector-overlays");
const clipboardHelper = require("devtools/shared/platform/clipboard");
loader.lazyGetter(this, "_strings", () => {
return Services.strings
.createBundle("chrome://devtools-shared/locale/styleinspector.properties");
});
const STYLE_INSPECTOR_PROPERTIES = "devtools-shared/locale/styleinspector.properties";
const {LocalizationHelper} = require("devtools/shared/l10n");
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
const PREF_ENABLE_MDN_DOCS_TOOLTIP =
"devtools.inspector.mdnDocsTooltip.enabled";
@ -83,22 +82,22 @@ StyleInspectorMenu.prototype = {
let menu = new Menu();
let menuitemCopy = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copy"),
accesskey: _strings.GetStringFromName("styleinspector.contextmenu.copy.accessKey"),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copy"),
accesskey: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copy.accessKey"),
click: () => {
this._onCopy();
},
disabled: !this._hasTextSelected(),
});
let menuitemCopyLocation = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyLocation"),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyLocation"),
click: () => {
this._onCopyLocation();
},
visible: false,
});
let menuitemCopyRule = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyRule"),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyRule"),
click: () => {
this._onCopyRule();
},
@ -106,8 +105,8 @@ StyleInspectorMenu.prototype = {
});
let copyColorAccessKey = "styleinspector.contextmenu.copyColor.accessKey";
let menuitemCopyColor = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyColor"),
accesskey: _strings.GetStringFromName(copyColorAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyColor"),
accesskey: STYLE_INSPECTOR_L10N.getStr(copyColorAccessKey),
click: () => {
this._onCopyColor();
},
@ -115,8 +114,8 @@ StyleInspectorMenu.prototype = {
});
let copyUrlAccessKey = "styleinspector.contextmenu.copyUrl.accessKey";
let menuitemCopyUrl = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyUrl"),
accesskey: _strings.GetStringFromName(copyUrlAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyUrl"),
accesskey: STYLE_INSPECTOR_L10N.getStr(copyUrlAccessKey),
click: () => {
this._onCopyUrl();
},
@ -124,8 +123,8 @@ StyleInspectorMenu.prototype = {
});
let copyImageAccessKey = "styleinspector.contextmenu.copyImageDataUrl.accessKey";
let menuitemCopyImageDataUrl = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyImageDataUrl"),
accesskey: _strings.GetStringFromName(copyImageAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyImageDataUrl"),
accesskey: STYLE_INSPECTOR_L10N.getStr(copyImageAccessKey),
click: () => {
this._onCopyImageDataUrl();
},
@ -133,28 +132,28 @@ StyleInspectorMenu.prototype = {
});
let copyPropDeclarationLabel = "styleinspector.contextmenu.copyPropertyDeclaration";
let menuitemCopyPropertyDeclaration = new MenuItem({
label: _strings.GetStringFromName(copyPropDeclarationLabel),
label: STYLE_INSPECTOR_L10N.getStr(copyPropDeclarationLabel),
click: () => {
this._onCopyPropertyDeclaration();
},
visible: false,
});
let menuitemCopyPropertyName = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyPropertyName"),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyPropertyName"),
click: () => {
this._onCopyPropertyName();
},
visible: false,
});
let menuitemCopyPropertyValue = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copyPropertyValue"),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyPropertyValue"),
click: () => {
this._onCopyPropertyValue();
},
visible: false,
});
let menuitemCopySelector = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.copySelector"),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copySelector"),
click: () => {
this._onCopySelector();
},
@ -199,8 +198,8 @@ StyleInspectorMenu.prototype = {
// Select All
let selectAllAccessKey = "styleinspector.contextmenu.selectAll.accessKey";
let menuitemSelectAll = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.selectAll"),
accesskey: _strings.GetStringFromName(selectAllAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.selectAll"),
accesskey: STYLE_INSPECTOR_L10N.getStr(selectAllAccessKey),
click: () => {
this._onSelectAll();
},
@ -214,8 +213,8 @@ StyleInspectorMenu.prototype = {
// Add new rule
let addRuleAccessKey = "styleinspector.contextmenu.addNewRule.accessKey";
let menuitemAddRule = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.addNewRule"),
accesskey: _strings.GetStringFromName(addRuleAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.addNewRule"),
accesskey: STYLE_INSPECTOR_L10N.getStr(addRuleAccessKey),
click: () => {
this._onAddNewRule();
},
@ -228,8 +227,8 @@ StyleInspectorMenu.prototype = {
// Show MDN Docs
let mdnDocsAccessKey = "styleinspector.contextmenu.showMdnDocs.accessKey";
let menuitemShowMdnDocs = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.showMdnDocs"),
accesskey: _strings.GetStringFromName(mdnDocsAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.showMdnDocs"),
accesskey: STYLE_INSPECTOR_L10N.getStr(mdnDocsAccessKey),
click: () => {
this._onShowMdnDocs();
},
@ -241,8 +240,8 @@ StyleInspectorMenu.prototype = {
// Show Original Sources
let sourcesAccessKey = "styleinspector.contextmenu.toggleOrigSources.accessKey";
let menuitemSources = new MenuItem({
label: _strings.GetStringFromName("styleinspector.contextmenu.toggleOrigSources"),
accesskey: _strings.GetStringFromName(sourcesAccessKey),
label: STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.toggleOrigSources"),
accesskey: STYLE_INSPECTOR_L10N.getStr(sourcesAccessKey),
click: () => {
this._onToggleOrigSources();
},
@ -397,7 +396,7 @@ StyleInspectorMenu.prototype = {
message = yield data.data.string();
} catch (e) {
message =
_strings.GetStringFromName("styleinspector.copyImageDataUrlError");
STYLE_INSPECTOR_L10N.getStr("styleinspector.copyImageDataUrlError");
}
clipboardHelper.copyString(message);

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

@ -35,7 +35,7 @@ function* testCopyToClipboard(inspector, view) {
let allMenuItems = openStyleContextMenuAndGetAllItems(view, element);
let menuitemCopyColor = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyColor"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyColor"));
ok(menuitemCopyColor.visible, "Copy color is visible");

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

@ -5,17 +5,13 @@
/* Tests both Copy URL and Copy Data URL context menu items */
const PROPERTIES_URL = "chrome://devtools-shared/locale/styleinspector.properties";
const TEST_DATA_URI = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=";
// Invalid URL still needs to be reachable otherwise getImageDataUrl will
// timeout. DevTools chrome:// URLs aren't content accessible, so use some
// random resource:// URL here.
const INVALID_IMAGE_URI = "resource://devtools/client/definitions.js";
const ERROR_MESSAGE = Services.strings
.createBundle(PROPERTIES_URL)
.GetStringFromName("styleinspector.copyImageDataUrlError");
const ERROR_MESSAGE = STYLE_INSPECTOR_L10N.getStr("styleinspector.copyImageDataUrlError");
add_task(function* () {
const TEST_URI = `<style type="text/css">
@ -79,9 +75,9 @@ function* testCopyUrlToClipboard({view, inspector}, type, selector, expected) {
info("Simulate right click on the background-image URL");
let allMenuItems = openStyleContextMenuAndGetAllItems(view, imageLink);
let menuitemCopyUrl = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyUrl"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyUrl"));
let menuitemCopyImageDataUrl = allMenuItems.find(item => item.label ===
_STRINGS.GetStringFromName("styleinspector.contextmenu.copyImageDataUrl"));
STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyImageDataUrl"));
info("Context menu is displayed");
ok(menuitemCopyUrl.visible,

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

@ -21,8 +21,7 @@ const TEST_URL_ROOT_SSL =
"https://example.com/browser/devtools/client/inspector/shared/test/";
const ROOT_TEST_DIR = getRootDirectory(gTestPath);
const FRAME_SCRIPT_URL = ROOT_TEST_DIR + "doc_frame_script.js";
const _STRINGS = Services.strings.createBundle(
"chrome://devtools-shared/locale/styleinspector.properties");
const STYLE_INSPECTOR_L10N = new LocalizationHelper("chrome://devtools-shared/locale/styleinspector.properties");
// Clean-up all prefs that might have been changed during a test run
// (safer here because if the test fails, then the pref is never reverted)

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

@ -145,6 +145,7 @@ skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keybo
[browser_inspector_search-06.js]
[browser_inspector_search-07.js]
[browser_inspector_search-08.js]
[browser_inspector_search-clear.js]
[browser_inspector_search-filter_context-menu.js]
[browser_inspector_search_keyboard_trap.js]
[browser_inspector_search-label.js]

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

@ -0,0 +1,52 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Bug 1295081 Test searchbox clear button's display behavior is correct
const XHTML = `
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg">
<body>
<svg:svg width="100" height="100">
<svg:clipPath>
<svg:rect x="0" y="0" width="10" height="5"></svg:rect>
</svg:clipPath>
<svg:circle cx="0" cy="0" r="5"></svg:circle>
</svg:svg>
</body>
</html>
`;
const TEST_URI = "data:application/xhtml+xml;charset=utf-8," + encodeURI(XHTML);
// Type "d" in inspector-searchbox, Enter [Back space] key and check if the
// clear button is shown correctly
add_task(function* () {
let {inspector} = yield openInspectorForURL(TEST_URI);
let {searchBox, searchClearButton} = inspector;
yield focusSearchBoxUsingShortcut(inspector.panelWin);
info("Type d and the clear button will be shown");
let command = once(searchBox, "input");
EventUtils.synthesizeKey("c", {}, inspector.panelWin);
yield command;
info("Waiting for search query to complete and getting the suggestions");
yield inspector.searchSuggestions._lastQuery;
ok(!searchClearButton.hidden,
"The clear button is shown when some word is in searchBox");
EventUtils.synthesizeKey("VK_BACK_SPACE", {}, inspector.panelWin);
yield command;
info("Waiting for search query to complete and getting the suggestions");
yield inspector.searchSuggestions._lastQuery;
ok(searchClearButton.hidden, "The clear button is hidden when no word is in searchBox");
});

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

@ -34,6 +34,9 @@ Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js",
this);
const {LocalizationHelper} = require("devtools/shared/l10n");
const INSPECTOR_L10N = new LocalizationHelper("devtools/locale/inspector.properties");
flags.testing = true;
registerCleanupFunction(() => {
flags.testing = false;
@ -228,9 +231,8 @@ var focusSearchBoxUsingShortcut = Task.async(function* (panelWin, callback) {
let focused = once(searchBox, "focus");
panelWin.focus();
let strings = Services.strings.createBundle(
"chrome://devtools/locale/inspector.properties");
synthesizeKeyShortcut(strings.GetStringFromName("inspector.searchHTML.key"));
synthesizeKeyShortcut(INSPECTOR_L10N.getStr("inspector.searchHTML.key"));
yield focused;

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

@ -6,13 +6,9 @@
"use strict";
var Services = require("Services");
var EventEmitter = require("devtools/shared/event-emitter");
var Telemetry = require("devtools/client/shared/telemetry");
var { Task } = require("devtools/shared/task");
/* eslint-disable mozilla/reject-some-requires */
var { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
/* eslint-enable mozilla/reject-some-requires */
/**
* This object represents replacement for ToolSidebar
@ -302,21 +298,3 @@ ToolSidebar.prototype = {
this._toolPanel = null;
})
};
XPCOMUtils.defineLazyGetter(this, "l10n", function () {
let bundle = Services.strings.createBundle(
"chrome://devtools/locale/toolbox.properties");
let l10n = function (name, ...args) {
try {
if (args.length == 0) {
return bundle.GetStringFromName(name);
}
return bundle.formatStringFromName(name, args, args.length);
} catch (err) {
console.error(err);
}
return null;
};
return l10n;
});

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

@ -11,6 +11,8 @@ const Services = require("Services");
const { TargetFactory } = require("devtools/client/framework/target");
const Telemetry = require("devtools/client/shared/telemetry");
const {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
const NS_XHTML = "http://www.w3.org/1999/xhtml";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@ -21,9 +23,6 @@ loader.lazyGetter(this, "prefBranch", function () {
return Services.prefs.getBranch(null)
.QueryInterface(Ci.nsIPrefBranch2);
});
loader.lazyGetter(this, "toolboxStrings", function () {
return Services.strings.createBundle("chrome://devtools/locale/toolbox.properties");
});
loader.lazyRequireGetter(this, "gcliInit", "devtools/shared/gcli/commands/index");
loader.lazyRequireGetter(this, "util", "gcli/util/util");
@ -311,7 +310,7 @@ DeveloperToolbar.prototype.createToolbar = function () {
close.setAttribute("id", "developer-toolbar-closebutton");
close.setAttribute("class", "close-icon");
close.setAttribute("oncommand", "DeveloperToolbar.hide();");
let closeTooltip = toolboxStrings.GetStringFromName("toolbar.closeButton.tooltip");
let closeTooltip = L10N.getStr("toolbar.closeButton.tooltip");
close.setAttribute("tooltiptext", closeTooltip);
let stack = this._doc.createElement("stack");
@ -329,7 +328,7 @@ DeveloperToolbar.prototype.createToolbar = function () {
let toolboxBtn = this._doc.createElement("toolbarbutton");
toolboxBtn.setAttribute("id", "developer-toolbar-toolbox-button");
toolboxBtn.setAttribute("class", "developer-toolbar-button");
let toolboxTooltip = toolboxStrings.GetStringFromName("toolbar.toolsButton.tooltip");
let toolboxTooltip = L10N.getStr("toolbar.toolsButton.tooltip");
toolboxBtn.setAttribute("tooltiptext", toolboxTooltip);
toolboxBtn.addEventListener("command", function (event) {
let window = event.target.ownerDocument.defaultView;
@ -805,17 +804,14 @@ DeveloperToolbar.prototype._updateErrorsCount = function (changedTabId) {
let warnings = this._warningsCount[tabId];
let btn = this._errorCounterButton;
if (errors) {
let errorsText = toolboxStrings
.GetStringFromName("toolboxToggleButton.errors");
let errorsText = L10N.getStr("toolboxToggleButton.errors");
errorsText = PluralForm.get(errors, errorsText).replace("#1", errors);
let warningsText = toolboxStrings
.GetStringFromName("toolboxToggleButton.warnings");
let warningsText = L10N.getStr("toolboxToggleButton.warnings");
warningsText = PluralForm.get(warnings, warningsText).replace("#1", warnings);
let tooltiptext = toolboxStrings
.formatStringFromName("toolboxToggleButton.tooltip",
[errorsText, warningsText], 2);
let tooltiptext = L10N.getFormatStr("toolboxToggleButton.tooltip",
errorsText, warningsText);
btn.setAttribute("error-count", errors);
btn.setAttribute("tooltiptext", tooltiptext);

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

@ -5,10 +5,10 @@
"use strict";
const { getJSON } = require("devtools/client/shared/getjson");
const Services = require("Services");
const DEVICES_URL = "devtools.devices.url";
const Strings = Services.strings.createBundle("chrome://devtools/locale/device.properties");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/device.properties");
/* This is a catalog of common web-enabled devices and their properties,
* intended for (mobile) device emulation.
@ -63,6 +63,6 @@ exports.GetDevices = GetDevices;
// Get the localized string for a device type.
function GetDeviceString(deviceType) {
return Strings.GetStringFromName("device." + deviceType);
return L10N.getStr("device." + deviceType);
}
exports.GetDeviceString = GetDeviceString;

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

@ -30,6 +30,9 @@ const {getCSSLexer} = require("devtools/shared/css-lexer");
const EventEmitter = require("devtools/shared/event-emitter");
const {gDevTools} = require("devtools/client/framework/devtools");
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/inspector.properties");
const XHTML_NS = "http://www.w3.org/1999/xhtml";
// Parameters for the XHR request
@ -263,8 +266,7 @@ function MdnDocsWidget(tooltipContainer) {
};
// get the localized string for the link text
this.elements.linkToMdn.textContent =
l10n.strings.GetStringFromName("docsTooltip.visitMDN");
this.elements.linkToMdn.textContent = L10N.getStr("docsTooltip.visitMDN");
// listen for clicks and open in the browser window instead
let mainWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
@ -348,8 +350,7 @@ MdnDocsWidget.prototype = {
*/
function gotError(error) {
// show error message
elements.summary.textContent =
l10n.strings.GetStringFromName("docsTooltip.loadDocsError");
elements.summary.textContent = L10N.getStr("docsTooltip.loadDocsError");
// hide the throbber
elements.info.classList.remove("devtools-throbber");
@ -373,19 +374,6 @@ MdnDocsWidget.prototype = {
}
};
/**
* L10N utility class
*/
function L10N() {}
L10N.prototype = {};
var l10n = new L10N();
loader.lazyGetter(L10N.prototype, "strings", () => {
return Services.strings.createBundle(
"chrome://devtools/locale/inspector.properties");
});
/**
* Test whether a node is all whitespace.
*

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

@ -8,7 +8,7 @@
const Ci = Components.interfaces;
const Cu = Components.utils;
const DBG_STRINGS_URI = "chrome://devtools/locale/debugger.properties";
const DBG_STRINGS_URI = "devtools/locale/debugger.properties";
const LAZY_EMPTY_DELAY = 150; // ms
const SCROLL_PAGE_SIZE_DEFAULT = 0;
const PAGE_SIZE_SCROLL_HEIGHT_RATIO = 100;
@ -29,7 +29,8 @@ const { Heritage, ViewHelpers, setNamedTimeout } =
const { Task } = require("devtools/shared/task");
const nodeConstants = require("devtools/shared/dom-node-constants");
const {KeyCodes} = require("devtools/client/shared/keycodes");
const {ELLIPSIS} = require("devtools/shared/l10n");
const {LocalizationHelper, ELLIPSIS} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper(DBG_STRINGS_URI);
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@ -56,11 +57,6 @@ Object.defineProperty(this, "NetworkHelper", {
this.EXPORTED_SYMBOLS = ["VariablesView", "escapeHTML"];
/**
* Debugger localization strings.
*/
const STR = Services.strings.createBundle(DBG_STRINGS_URI);
/**
* A tree view for inspecting scopes, objects and properties.
* Iterable via "for (let [id, scope] of instance) { }".
@ -309,7 +305,7 @@ VariablesView.prototype = {
* This flag is applied recursively onto each scope in this view and
* affects only the child nodes when they're created.
*/
editableValueTooltip: STR.GetStringFromName("variablesEditableValueTooltip"),
editableValueTooltip: L10N.getStr("variablesEditableValueTooltip"),
/**
* The tooltip text shown on a variable or property's name if a |switch|
@ -318,7 +314,7 @@ VariablesView.prototype = {
* This flag is applied recursively onto each scope in this view and
* affects only the child nodes when they're created.
*/
editableNameTooltip: STR.GetStringFromName("variablesEditableNameTooltip"),
editableNameTooltip: L10N.getStr("variablesEditableNameTooltip"),
/**
* The tooltip text shown on a variable or property's edit button if an
@ -328,7 +324,7 @@ VariablesView.prototype = {
* This flag is applied recursively onto each scope in this view and
* affects only the child nodes when they're created.
*/
editButtonTooltip: STR.GetStringFromName("variablesEditButtonTooltip"),
editButtonTooltip: L10N.getStr("variablesEditButtonTooltip"),
/**
* The tooltip text shown on a variable or property's value if that value is
@ -337,7 +333,7 @@ VariablesView.prototype = {
* This flag is applied recursively onto each scope in this view and
* affects only the child nodes when they're created.
*/
domNodeValueTooltip: STR.GetStringFromName("variablesDomNodeValueTooltip"),
domNodeValueTooltip: L10N.getStr("variablesDomNodeValueTooltip"),
/**
* The tooltip text shown on a variable or property's delete button if a
@ -346,7 +342,7 @@ VariablesView.prototype = {
* This flag is applied recursively onto each scope in this view and
* affects only the child nodes when they're created.
*/
deleteButtonTooltip: STR.GetStringFromName("variablesCloseButtonTooltip"),
deleteButtonTooltip: L10N.getStr("variablesCloseButtonTooltip"),
/**
* Specifies the context menu attribute set on variables and properties.
@ -362,7 +358,7 @@ VariablesView.prototype = {
* This flag is applied recursively onto each scope in this view and
* affects only the child nodes when they're created.
*/
separatorStr: STR.GetStringFromName("variablesSeparatorLabel"),
separatorStr: L10N.getStr("variablesSeparatorLabel"),
/**
* Specifies if enumerable properties and variables should be displayed.
@ -2462,13 +2458,13 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
if (aGrip && (aGrip.optimizedOut || aGrip.uninitialized || aGrip.missingArguments)) {
if (aGrip.optimizedOut) {
this._valueString = STR.GetStringFromName("variablesViewOptimizedOut");
this._valueString = L10N.getStr("variablesViewOptimizedOut");
}
else if (aGrip.uninitialized) {
this._valueString = STR.GetStringFromName("variablesViewUninitialized");
this._valueString = L10N.getStr("variablesViewUninitialized");
}
else if (aGrip.missingArguments) {
this._valueString = STR.GetStringFromName("variablesViewMissingArgs");
this._valueString = L10N.getStr("variablesViewMissingArgs");
}
this.eval = null;
}
@ -2713,7 +2709,7 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
for (let type of labels) {
let labelElement = this.document.createElement("label");
labelElement.className = type;
labelElement.setAttribute("value", STR.GetStringFromName(type + "Tooltip"));
labelElement.setAttribute("value", L10N.getStr(type + "Tooltip"));
tooltip.appendChild(labelElement);
}
@ -3698,7 +3694,7 @@ VariablesView.stringifiers.byObjectKind = {
VariablesView.getString(preview.message, { noStringQuotes: true });
if (!VariablesView.isFalsy({ value: preview.stack })) {
msg += "\n" + STR.GetStringFromName("variablesViewErrorStacktrace") +
msg += "\n" + L10N.getStr("variablesViewErrorStacktrace") +
"\n" + preview.stack;
}
@ -3843,7 +3839,7 @@ VariablesView.stringifiers.byObjectKind = {
* @return string
*/
VariablesView.stringifiers._getNMoreString = function (aNumber) {
let str = STR.GetStringFromName("variablesViewMoreObjects");
let str = L10N.getStr("variablesViewMoreObjects");
return PluralForm.get(aNumber, str).replace("#1", aNumber);
};

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

@ -6,14 +6,8 @@
"use strict";
const Services = require("Services");
loader.lazyGetter(this, "GetStringFromName", () => {
let bundle = Services.strings.createBundle(
"chrome://devtools/locale/inspector.properties");
return key => {
return bundle.GetStringFromName(key);
};
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/inspector.properties");
const Editor = require("devtools/client/sourceeditor/editor");
const beautify = require("devtools/shared/jsbeautify/beautify");
@ -82,7 +76,7 @@ EventTooltip.prototype = {
debuggerIcon.className = "event-tooltip-debugger-icon";
debuggerIcon.setAttribute("src",
"chrome://devtools/skin/images/tool-debugger.svg");
let openInDebugger = GetStringFromName("eventsTooltip.openInDebugger");
let openInDebugger = L10N.getStr("eventsTooltip.openInDebugger");
debuggerIcon.setAttribute("title", openInDebugger);
header.appendChild(debuggerIcon);
}

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

@ -6,14 +6,8 @@
"use strict";
const Services = require("Services");
loader.lazyGetter(this, "GetStringFromName", () => {
let bundle = Services.strings.createBundle(
"chrome://devtools/locale/inspector.properties");
return key => {
return bundle.GetStringFromName(key);
};
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/inspector.properties");
const XHTML_NS = "http://www.w3.org/1999/xhtml";
@ -131,7 +125,7 @@ function setBrokenImageTooltip(tooltip, doc) {
text-align: center;
line-height: 30px;`;
let message = GetStringFromName("previewTooltip.image.brokenImage");
let message = L10N.getStr("previewTooltip.image.brokenImage");
div.textContent = message;
tooltip.setContent(div, {width: 150, height: 30});
}

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

@ -12,11 +12,8 @@ const ZOOM_PREF = "devtools.toolbox.zoomValue";
const MIN_ZOOM = 0.5;
const MAX_ZOOM = 2;
const properties = "chrome://devtools/locale/toolbox.properties";
const bundle = Services.strings.createBundle(properties);
function l10n(key) {
return bundle.GetStringFromName(key);
}
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/toolbox.properties");
/**
* Register generic keys to control zoom level of the given document.
@ -62,26 +59,26 @@ exports.register = function (window) {
// Set zoom to whatever the last setting was.
setZoom(zoomValue);
shortcuts.on(l10n("toolbox.zoomIn.key"), zoomIn);
let zoomIn2 = l10n("toolbox.zoomIn2.key");
shortcuts.on(L10N.getStr("toolbox.zoomIn.key"), zoomIn);
let zoomIn2 = L10N.getStr("toolbox.zoomIn2.key");
if (zoomIn2) {
shortcuts.on(zoomIn2, zoomIn);
}
let zoomIn3 = l10n("toolbox.zoomIn2.key");
let zoomIn3 = L10N.getStr("toolbox.zoomIn2.key");
if (zoomIn3) {
shortcuts.on(zoomIn3, zoomIn);
}
shortcuts.on(l10n("toolbox.zoomOut.key"),
shortcuts.on(L10N.getStr("toolbox.zoomOut.key"),
zoomOut);
let zoomOut2 = l10n("toolbox.zoomOut2.key");
let zoomOut2 = L10N.getStr("toolbox.zoomOut2.key");
if (zoomOut2) {
shortcuts.on(zoomOut2, zoomOut);
}
shortcuts.on(l10n("toolbox.zoomReset.key"),
shortcuts.on(L10N.getStr("toolbox.zoomReset.key"),
zoomReset);
let zoomReset2 = l10n("toolbox.zoomReset2.key");
let zoomReset2 = L10N.getStr("toolbox.zoomReset2.key");
if (zoomReset2) {
shortcuts.on(zoomReset2, zoomReset);
}

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

@ -21,7 +21,6 @@ const ENABLE_CODE_FOLDING = "devtools.editor.enableCodeFolding";
const KEYMAP = "devtools.editor.keymap";
const AUTO_CLOSE = "devtools.editor.autoclosebrackets";
const AUTOCOMPLETE = "devtools.editor.autocomplete";
const L10N_BUNDLE = "chrome://devtools/locale/sourceeditor.properties";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const VALID_KEYMAPS = new Set(["emacs", "vim", "sublime"]);
@ -39,7 +38,8 @@ const promise = require("promise");
const events = require("devtools/shared/event-emitter");
const { PrefObserver } = require("devtools/client/styleeditor/utils");
const L10N = Services.strings.createBundle(L10N_BUNDLE);
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/sourceeditor.properties");
const { OS } = Services.appinfo;
@ -353,8 +353,8 @@ Editor.prototype = {
// Intercept the find and find again keystroke on CodeMirror, to avoid
// the browser's search
let findKey = L10N.GetStringFromName("find.commandkey");
let findAgainKey = L10N.GetStringFromName("findAgain.commandkey");
let findKey = L10N.getStr("find.commandkey");
let findAgainKey = L10N.getStr("findAgain.commandkey");
let [accel, modifier] = OS === "Darwin"
? ["metaKey", "altKey"]
: ["ctrlKey", "shiftKey"];
@ -434,7 +434,7 @@ Editor.prototype = {
});
win.CodeMirror.defineExtension("l10n", (name) => {
return L10N.GetStringFromName(name);
return L10N.getStr(name);
});
cm.getInputField().controllers.insertControllerAt(0, controller(this));
@ -977,7 +977,7 @@ Editor.prototype = {
let div = doc.createElement("div");
let inp = doc.createElement("input");
let txt =
doc.createTextNode(L10N.GetStringFromName("gotoLineCmd.promptTitle"));
doc.createTextNode(L10N.getStr("gotoLineCmd.promptTitle"));
inp.type = "text";
inp.style.width = "10em";
@ -1275,7 +1275,7 @@ Editor.accel = function (key, modifiers = {}) {
* or disabling default shortcuts.
*/
Editor.keyFor = function (cmd, opts = { noaccel: false }) {
let key = L10N.GetStringFromName(cmd + ".commandkey");
let key = L10N.getStr(cmd + ".commandkey");
return opts.noaccel ? key : Editor.accel(key);
};

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

@ -5,11 +5,11 @@
"use strict";
const L10N_BUNDLE = "chrome://devtools/locale/sourceeditor.properties";
const L10N = Services.strings.createBundle(L10N_BUNDLE);
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/sourceeditor.properties");
const FIND_KEY = L10N.GetStringFromName("find.commandkey");
const FINDAGAIN_KEY = L10N.GetStringFromName("findAgain.commandkey");
const FIND_KEY = L10N.getStr("find.commandkey");
const FINDAGAIN_KEY = L10N.getStr("findAgain.commandkey");
const { OS } = Services.appinfo;

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

@ -44,25 +44,16 @@
.side-menu-widget-item-checkbox .checkbox-check {
-moz-appearance: none;
background-image: url(images/itemToggle.png);
background-image: url(images/itemToggle.svg);
background-color: transparent;
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
@media (min-resolution: 1.1dppx) {
.side-menu-widget-item-checkbox .checkbox-check {
background-image: url(images/itemToggle@2x.png);
}
}
.side-menu-widget-item-checkbox[checked] .checkbox-check {
background-position: 0 0;
.side-menu-widget-item-checkbox:not([checked]) .checkbox-check,
.side-menu-widget-item-checkbox:not([checked]) + vbox {
opacity: 0.3;
}
.side-menu-widget-item:not(.selected) .checkbox-check {

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

@ -3,24 +3,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Services = require("Services");
const {cssUsageSpec} = require("devtools/shared/specs/csscoverage");
const protocol = require("devtools/shared/protocol");
const {custom} = protocol;
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools-shared/locale/csscoverage.properties");
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
/**
* Allow: let foo = l10n.lookup("csscoverageFoo");
*/
const l10n = exports.l10n = {
_URI: "chrome://devtools-shared/locale/csscoverage.properties",
lookup: function (msg) {
if (this._stringBundle == null) {
this._stringBundle = Services.strings.createBundle(this._URI);
}
return this._stringBundle.GetStringFromName(msg);
}
lookup: (msg) => L10N.getStr(msg)
};
/**

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

@ -5,7 +5,6 @@
"use strict";
const l10n = require("gcli/l10n");
const Services = require("Services");
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
require("devtools/server/actors/inspector");
const {
@ -13,9 +12,8 @@ const {
HighlighterEnvironment
} = require("devtools/server/actors/highlighters");
XPCOMUtils.defineLazyGetter(this, "nodesSelected", function () {
return Services.strings.createBundle("chrome://devtools-shared/locale/gclicommands.properties");
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools-shared/locale/gclicommands.properties");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
// How many maximum nodes can be highlighted in parallel
@ -139,7 +137,7 @@ exports.items = [
i++;
}
let highlightText = nodesSelected.GetStringFromName("highlightOutputConfirm2");
let highlightText = L10N.getStr("highlightOutputConfirm2");
let output = PluralForm.get(args.selector.length, highlightText)
.replace("%1$S", args.selector.length);
if (args.selector.length > i) {

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

@ -14,41 +14,37 @@
* limitations under the License.
*/
'use strict';
"use strict";
var Cc = require('chrome').Cc;
var Ci = require('chrome').Ci;
var Cu = require('chrome').Cu;
var Cc = require("chrome").Cc;
var Ci = require("chrome").Ci;
var prefSvc = Cc['@mozilla.org/preferences-service;1']
.getService(Ci.nsIPrefService);
var prefSvc = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService);
var prefBranch = prefSvc.getBranch(null).QueryInterface(Ci.nsIPrefBranch);
var Services = require("Services");
var stringBundle = Services.strings.createBundle(
'chrome://devtools-shared/locale/gclicommands.properties');
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools-shared/locale/gclicommands.properties");
/**
* Lookup a string in the GCLI string bundle
*/
exports.lookup = function(name) {
exports.lookup = function (name) {
try {
return stringBundle.GetStringFromName(name);
}
catch (ex) {
throw new Error('Failure in lookup(\'' + name + '\')');
return L10N.getStr(name);
} catch (ex) {
throw new Error("Failure in lookup('" + name + "')");
}
};
/**
* An alternative to lookup().
* <code>l10n.lookup('BLAH') === l10n.propertyLookup.BLAH</code>
* <code>l10n.lookup("BLAH") === l10n.propertyLookup.BLAH</code>
* This is particularly nice for templates because you can pass
* <code>l10n:l10n.propertyLookup</code> in the template data and use it
* like <code>${l10n.BLAH}</code>
*/
exports.propertyLookup = new Proxy({}, {
get: function(rcvr, name) {
get: function (rcvr, name) {
return exports.lookup(name);
}
});
@ -56,24 +52,23 @@ exports.propertyLookup = new Proxy({}, {
/**
* Lookup a string in the GCLI string bundle
*/
exports.lookupFormat = function(name, swaps) {
exports.lookupFormat = function (name, swaps) {
try {
return stringBundle.formatStringFromName(name, swaps, swaps.length);
}
catch (ex) {
throw new Error('Failure in lookupFormat(\'' + name + '\')');
return L10N.getFormatStr(name, ...swaps);
} catch (ex) {
throw new Error("Failure in lookupFormat('" + name + "')");
}
};
/**
* Allow GCLI users to be hidden by the 'devtools.chrome.enabled' pref.
* Allow GCLI users to be hidden by the "devtools.chrome.enabled" pref.
* Use it in commands like this:
* <pre>
* name: "somecommand",
* hidden: l10n.hiddenByChromePref(),
* exec: function(args, context) { ... }
* exec: function (args, context) { ... }
* </pre>
*/
exports.hiddenByChromePref = function() {
return !prefBranch.getBoolPref('devtools.chrome.enabled');
exports.hiddenByChromePref = function () {
return !prefBranch.getBoolPref("devtools.chrome.enabled");
};

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

@ -14,76 +14,67 @@
* limitations under the License.
*/
'use strict';
"use strict";
var Cu = require('chrome').Cu;
var XPCOMUtils = Cu.import('resource://gre/modules/XPCOMUtils.jsm', {}).XPCOMUtils;
var Services = require("Services");
var imports = {};
XPCOMUtils.defineLazyGetter(imports, 'stringBundle', function () {
return Services.strings.createBundle('chrome://devtools-shared/locale/gcli.properties');
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools-shared/locale/gcli.properties");
/*
* Not supported when embedded - we're doing things the Mozilla way not the
* Not supported when embedded - we"re doing things the Mozilla way not the
* require.js way.
*/
exports.registerStringsSource = function(modulePath) {
throw new Error('registerStringsSource is not available in mozilla');
exports.registerStringsSource = function (modulePath) {
throw new Error("registerStringsSource is not available in mozilla");
};
exports.unregisterStringsSource = function(modulePath) {
throw new Error('unregisterStringsSource is not available in mozilla');
exports.unregisterStringsSource = function (modulePath) {
throw new Error("unregisterStringsSource is not available in mozilla");
};
exports.lookupSwap = function(key, swaps) {
throw new Error('lookupSwap is not available in mozilla');
exports.lookupSwap = function (key, swaps) {
throw new Error("lookupSwap is not available in mozilla");
};
exports.lookupPlural = function(key, ord, swaps) {
throw new Error('lookupPlural is not available in mozilla');
exports.lookupPlural = function (key, ord, swaps) {
throw new Error("lookupPlural is not available in mozilla");
};
exports.getPreferredLocales = function() {
return [ 'root' ];
exports.getPreferredLocales = function () {
return [ "root" ];
};
/** @see lookup() in lib/gcli/util/l10n.js */
exports.lookup = function(key) {
exports.lookup = function (key) {
try {
// Our memory leak hunter walks reachable objects trying to work out what
// type of thing they are using object.constructor.name. If that causes
// problems then we can avoid the unknown-key-exception with the following:
/*
if (key === 'constructor') {
return { name: 'l10n-mem-leak-defeat' };
if (key === "constructor") {
return { name: "l10n-mem-leak-defeat" };
}
*/
return imports.stringBundle.GetStringFromName(key);
}
catch (ex) {
console.error('Failed to lookup ', key, ex);
return L10N.getStr(key);
} catch (ex) {
console.error("Failed to lookup ", key, ex);
return key;
}
};
/** @see propertyLookup in lib/gcli/util/l10n.js */
exports.propertyLookup = new Proxy({}, {
get: function(rcvr, name) {
get: function (rcvr, name) {
return exports.lookup(name);
}
});
/** @see lookupFormat in lib/gcli/util/l10n.js */
exports.lookupFormat = function(key, swaps) {
exports.lookupFormat = function (key, swaps) {
try {
return imports.stringBundle.formatStringFromName(key, swaps, swaps.length);
}
catch (ex) {
console.error('Failed to format ', key, ex);
return L10N.getFormatStr(key, ...swaps);
} catch (ex) {
console.error("Failed to format ", key, ex);
return key;
}
};

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

@ -42,6 +42,9 @@
const Services = require("Services");
const CSSLexer = require("devtools/shared/css-lexer");
const {LocalizationHelper} = require("devtools/shared/l10n");
const styleInspectorL10N =
new LocalizationHelper("devtools-shared/locale/styleinspector.properties");
/**
* Special values for filter, in addition to an href these values can be used
@ -70,16 +73,13 @@ exports.STATUS = {
};
/**
* Memoized lookup of a l10n string from a string bundle.
* @param {string} name The key to lookup.
* @returns A localized version of the given key.
* Lookup a l10n string in the shared styleinspector string bundle.
*
* @param {String} name
* The key to lookup.
* @returns {String} A localized version of the given key.
*/
exports.l10n = function (name) {
return exports._strings.GetStringFromName(name);
};
exports._strings = Services.strings
.createBundle("chrome://devtools-shared/locale/styleinspector.properties");
exports.l10n = name => styleInspectorL10N.getStr(name);
/**
* Is the given property sheet a content stylesheet?

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

@ -14,10 +14,8 @@ loader.lazyRequireGetter(this, "DebuggerSocket",
loader.lazyRequireGetter(this, "AuthenticationResult",
"devtools/shared/security/auth", true);
DevToolsUtils.defineLazyGetter(this, "bundle", () => {
const DBG_STRINGS_URI = "chrome://devtools-shared/locale/debugger.properties";
return Services.strings.createBundle(DBG_STRINGS_URI);
});
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools-shared/locale/debugger.properties");
var Client = exports.Client = {};
var Server = exports.Server = {};
@ -51,13 +49,11 @@ Client.defaultSendOOB = ({ authResult, oob }) => {
if (authResult != AuthenticationResult.PENDING) {
throw new Error("Expected PENDING result, got " + authResult);
}
let title = bundle.GetStringFromName("clientSendOOBTitle");
let header = bundle.GetStringFromName("clientSendOOBHeader");
let hashMsg = bundle.formatStringFromName("clientSendOOBHash",
[oob.sha256], 1);
let title = L10N.getStr("clientSendOOBTitle");
let header = L10N.getStr("clientSendOOBHeader");
let hashMsg = L10N.getFormatStr("clientSendOOBHash", oob.sha256);
let token = oob.sha256.replace(/:/g, "").toLowerCase() + oob.k;
let tokenMsg = bundle.formatStringFromName("clientSendOOBToken",
[token], 1);
let tokenMsg = L10N.getFormatStr("clientSendOOBToken", token);
let msg = `${header}\n\n${hashMsg}\n${tokenMsg}`;
let prompt = Services.prompt;
let flags = prompt.BUTTON_POS_0 * prompt.BUTTON_TITLE_CANCEL;
@ -125,19 +121,15 @@ Client.defaultSendOOB = ({ authResult, oob }) => {
* A promise that will be resolved to the above is also allowed.
*/
Server.defaultAllowConnection = ({ client, server }) => {
let title = bundle.GetStringFromName("remoteIncomingPromptTitle");
let header = bundle.GetStringFromName("remoteIncomingPromptHeader");
let title = L10N.getStr("remoteIncomingPromptTitle");
let header = L10N.getStr("remoteIncomingPromptHeader");
let clientEndpoint = `${client.host}:${client.port}`;
let clientMsg =
bundle.formatStringFromName("remoteIncomingPromptClientEndpoint",
[clientEndpoint], 1);
let clientMsg = L10N.getFormatStr("remoteIncomingPromptClientEndpoint", clientEndpoint);
let serverEndpoint = `${server.host}:${server.port}`;
let serverMsg =
bundle.formatStringFromName("remoteIncomingPromptServerEndpoint",
[serverEndpoint], 1);
let footer = bundle.GetStringFromName("remoteIncomingPromptFooter");
let serverMsg = L10N.getFormatStr("remoteIncomingPromptServerEndpoint", serverEndpoint);
let footer = L10N.getStr("remoteIncomingPromptFooter");
let msg = `${header}\n\n${clientMsg}\n${serverMsg}\n\n${footer}`;
let disableButton = bundle.GetStringFromName("remoteIncomingPromptDisable");
let disableButton = L10N.getStr("remoteIncomingPromptDisable");
let prompt = Services.prompt;
let flags = prompt.BUTTON_POS_0 * prompt.BUTTON_TITLE_OK +
prompt.BUTTON_POS_1 * prompt.BUTTON_TITLE_CANCEL +
@ -170,8 +162,8 @@ Server.defaultAllowConnection = ({ client, server }) => {
* A promise that will be resolved to the above is also allowed.
*/
Server.defaultReceiveOOB = () => {
let title = bundle.GetStringFromName("serverReceiveOOBTitle");
let msg = bundle.GetStringFromName("serverReceiveOOBBody");
let title = L10N.getStr("serverReceiveOOBTitle");
let msg = L10N.getStr("serverReceiveOOBBody");
let input = { value: null };
let prompt = Services.prompt;
let result = prompt.prompt(null, title, msg, input, null, { value: false });

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

@ -390,7 +390,7 @@ Animation::PlayState() const
}
if ((mPlaybackRate > 0.0 && currentTime.Value() >= EffectEnd()) ||
(mPlaybackRate < 0.0 && currentTime.Value().ToMilliseconds() <= 0.0)) {
(mPlaybackRate < 0.0 && currentTime.Value() <= TimeDuration())) {
return AnimationPlayState::Finished;
}
@ -930,13 +930,13 @@ Animation::PlayNoUpdate(ErrorResult& aRv, LimitBehavior aLimitBehavior)
if (mPlaybackRate > 0.0 &&
(currentTime.IsNull() ||
(aLimitBehavior == LimitBehavior::AutoRewind &&
(currentTime.Value().ToMilliseconds() < 0.0 ||
(currentTime.Value() < TimeDuration() ||
currentTime.Value() >= EffectEnd())))) {
mHoldTime.SetValue(TimeDuration(0));
} else if (mPlaybackRate < 0.0 &&
(currentTime.IsNull() ||
(aLimitBehavior == LimitBehavior::AutoRewind &&
(currentTime.Value().ToMilliseconds() <= 0.0 ||
(currentTime.Value() <= TimeDuration() ||
currentTime.Value() > EffectEnd())))) {
if (EffectEnd() == TimeDuration::Forever()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
@ -1136,7 +1136,7 @@ Animation::UpdateFinishedState(SeekFlag aSeekFlag,
}
} else if (mPlaybackRate < 0.0 &&
!currentTime.IsNull() &&
currentTime.Value().ToMilliseconds() <= 0.0) {
currentTime.Value() <= TimeDuration()) {
if (aSeekFlag == SeekFlag::DidSeek) {
mHoldTime = currentTime;
} else if (!mPreviousCurrentTime.IsNull()) {

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

@ -1163,7 +1163,7 @@ KeyframeEffectReadOnly::SetPerformanceWarning(
static already_AddRefed<nsStyleContext>
CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty,
StyleAnimationValue aValue,
const StyleAnimationValue& aValue,
nsStyleContext* aBaseStyleContext)
{
MOZ_ASSERT(aBaseStyleContext,

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

@ -273,9 +273,11 @@ CallbackObject::CallSetup::~CallSetup()
// runs. Note that we've already run ~mAc, effectively, so we don't have
// to worry about ordering here.
if (mErrorResult.IsJSContextException()) {
// XXXkhuey bug 1117269.
// This won't be true anymore because we will report the exception on
// the JSContext ... so throw something else.
// XXXkhuey bug 1117269. When this is fixed, please consider fixing
// ThrowExceptionValueIfSafe over in Exceptions.cpp in the same way.
// IsJSContextException shouldn't be true anymore because we will report
// the exception on the JSContext ... so throw something else.
mErrorResult.Throw(NS_ERROR_UNEXPECTED);
}
}

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

@ -25,36 +25,73 @@
namespace mozilla {
namespace dom {
bool
// Throw the given exception value if it's safe. If it's not safe, then
// synthesize and throw a new exception value for NS_ERROR_UNEXPECTED. The
// incoming value must be in the compartment of aCx. This function guarantees
// that an exception is pending on aCx when it returns.
static void
ThrowExceptionValueIfSafe(JSContext* aCx, JS::Handle<JS::Value> exnVal,
nsIException* aOriginalException)
{
MOZ_ASSERT(aOriginalException);
if (!exnVal.isObject()) {
JS_SetPendingException(aCx, exnVal);
return;
}
JS::Rooted<JSObject*> exnObj(aCx, &exnVal.toObject());
MOZ_ASSERT(js::IsObjectInContextCompartment(exnObj, aCx),
"exnObj needs to be in the right compartment for the "
"CheckedUnwrap thing to make sense");
if (js::CheckedUnwrap(exnObj)) {
// This is an object we're allowed to work with, so just go ahead and throw
// it.
JS_SetPendingException(aCx, exnVal);
return;
}
// We could probably Throw(aCx, NS_ERROR_UNEXPECTED) here, and it would do the
// right thing due to there not being an existing exception on the runtime at
// this point, but it's clearer to explicitly do the thing we want done. This
// is also why we don't just call ThrowExceptionObject on the Exception we
// create: it would do the right thing, but that fact is not obvious.
RefPtr<Exception> syntheticException =
CreateException(aCx, NS_ERROR_UNEXPECTED);
JS::Rooted<JS::Value> syntheticVal(aCx);
if (!GetOrCreateDOMReflector(aCx, syntheticException, &syntheticVal)) {
return;
}
MOZ_ASSERT(syntheticVal.isObject() &&
!js::IsWrapper(&syntheticVal.toObject()),
"Must have a reflector here, not a wrapper");
JS_SetPendingException(aCx, syntheticVal);
}
void
ThrowExceptionObject(JSContext* aCx, nsIException* aException)
{
// See if we really have an Exception.
nsCOMPtr<Exception> exception = do_QueryInterface(aException);
if (exception) {
return ThrowExceptionObject(aCx, exception);
ThrowExceptionObject(aCx, exception);
return;
}
// We only have an nsIException (probably an XPCWrappedJS). Fall back on old
// wrapping.
MOZ_ASSERT(NS_IsMainThread());
JS::Rooted<JSObject*> glob(aCx, JS::CurrentGlobalOrNull(aCx));
if (!glob) {
// XXXbz Can this really be null here?
return false;
}
JS::Rooted<JS::Value> val(aCx);
if (!WrapObject(aCx, aException, &NS_GET_IID(nsIException), &val)) {
return false;
return;
}
JS_SetPendingException(aCx, val);
return true;
ThrowExceptionValueIfSafe(aCx, val, aException);
}
bool
void
ThrowExceptionObject(JSContext* aCx, Exception* aException)
{
JS::Rooted<JS::Value> thrown(aCx);
@ -76,33 +113,22 @@ ThrowExceptionObject(JSContext* aCx, Exception* aException)
nsresult exceptionResult;
if (NS_SUCCEEDED(aException->GetResult(&exceptionResult)) &&
double(exceptionResult) == thrown.toNumber()) {
// The return value semantics here are a bit weird. Throw() always
// returns false. But we want to return true if we managed to throw an
// exception (otherwise our caller will assume OOM)... which Throw()
// always will. So we just return true unconditionally.
Throw(aCx, exceptionResult);
return true;
return;
}
}
if (!JS_WrapValue(aCx, &thrown)) {
return false;
return;
}
JS_SetPendingException(aCx, thrown);
return true;
}
JS::Rooted<JSObject*> glob(aCx, JS::CurrentGlobalOrNull(aCx));
if (!glob) {
// XXXbz Can this actually be null here?
return false;
ThrowExceptionValueIfSafe(aCx, thrown, aException);
return;
}
if (!GetOrCreateDOMReflector(aCx, aException, &thrown)) {
return false;
return;
}
JS_SetPendingException(aCx, thrown);
return true;
ThrowExceptionValueIfSafe(aCx, thrown, aException);
}
bool
@ -132,24 +158,15 @@ Throw(JSContext* aCx, nsresult aRv, const nsACString& aMessage)
if (NS_SUCCEEDED(existingException->GetResult(&nr)) &&
aRv == nr) {
// Reuse the existing exception.
if (!ThrowExceptionObject(aCx, existingException)) {
// If we weren't able to throw an exception we're
// most likely out of memory
JS_ReportOutOfMemory(aCx);
}
ThrowExceptionObject(aCx, existingException);
return false;
}
}
RefPtr<Exception> finalException = CreateException(aCx, aRv, aMessage);
MOZ_ASSERT(finalException);
if (!ThrowExceptionObject(aCx, finalException)) {
// If we weren't able to throw an exception we're
// most likely out of memory
JS_ReportOutOfMemory(aCx);
}
ThrowExceptionObject(aCx, finalException);
return false;
}

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

@ -34,10 +34,11 @@ Throw(JSContext* cx, nsresult rv, const nsACString& message = EmptyCString());
void
ThrowAndReport(nsPIDOMWindowInner* aWindow, nsresult aRv);
bool
// Both signatures of ThrowExceptionObject guarantee that an exception is set on
// aCx before they return.
void
ThrowExceptionObject(JSContext* aCx, Exception* aException);
bool
void
ThrowExceptionObject(JSContext* aCx, nsIException* aException);
// Create an exception object for the given nsresult and message but don't set

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

@ -74,3 +74,5 @@ skip-if = debug == false
skip-if = debug == false
[test_oom_reporting.html]
[test_domProxyArrayLengthGetter.html]
[test_exceptionSanitization.html]
skip-if = os == "android"

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

@ -0,0 +1,45 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1295322
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1295322</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1295322">Mozilla Bug 1295322</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
<script type="application/javascript">
/** Test for Bug 1295322 **/
iframe = document.createElement('iframe');
iframe.name = "eWin";
document.body.appendChild(iframe);
try{
// NOTE: The idea here is to call something that will end up throwing an
// exception in a JS component and then propagate back to C++ code before
// returning to us. If opening a feed: URI stops doing that, we will need a
// new guinea pig here.
open('feed://java:script:codeshouldgohere','eWin');
ok(false, "Should have thrown!");
} catch(e){
try {
is(e.name, "NS_ERROR_UNEXPECTED", "Should have the right exception");
is(e.filename, location.href,
"Should not be seeing where the exception really came from");
} catch (e2) {
ok(false, "Should be able to work with the exception");
}
}
</script>
</body>
</html>

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

@ -138,8 +138,7 @@ nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent)
if (!targetContent) {
return NS_OK;
}
if (targetContent->IsXULElement(nsGkAtoms::browser) &&
EventStateManager::IsRemoteTarget(targetContent)) {
if (EventStateManager::IsRemoteTarget(targetContent)) {
return NS_OK;
}

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

@ -601,6 +601,7 @@ DrawTargetCairo::DrawTargetCairo()
, mSurface(nullptr)
, mTransformSingular(false)
, mLockedBits(nullptr)
, mFontOptions(nullptr)
{
}
@ -611,6 +612,10 @@ DrawTargetCairo::~DrawTargetCairo()
cairo_surface_destroy(mSurface);
mSurface = nullptr;
}
if (mFontOptions) {
cairo_font_options_destroy(mFontOptions);
mFontOptions = nullptr;
}
MOZ_ASSERT(!mLockedBits);
}
@ -1288,6 +1293,46 @@ DrawTargetCairo::IsCurrentGroupOpaque()
return cairo_surface_get_content(surf) == CAIRO_CONTENT_COLOR;
}
void
DrawTargetCairo::SetFontOptions()
{
// This will attempt to detect if the currently set scaled font on the
// context has enabled subpixel AA. If it is not permitted, then it will
// downgrade to grayscale AA.
// This only currently works effectively for the cairo-ft backend relative
// to system defaults, as only cairo-ft reflect system defaults in the scaled
// font state. However, this will work for cairo-ft on both tree Cairo and
// system Cairo.
// Other backends leave the CAIRO_ANTIALIAS_DEFAULT setting untouched while
// potentially interpreting it as subpixel or even other types of AA that
// can't be safely equivocated with grayscale AA. For this reason we don't
// try to also detect and modify the default AA setting, only explicit
// subpixel AA. These other backends must instead rely on tree Cairo's
// cairo_surface_set_subpixel_antialiasing extension.
// If allowing subpixel AA, then leave Cairo's default AA state.
if (mPermitSubpixelAA) {
return;
}
if (!mFontOptions) {
mFontOptions = cairo_font_options_create();
if (!mFontOptions) {
gfxWarning() << "Failed allocating Cairo font options";
return;
}
}
// If the current font requests subpixel AA, force it to gray since we don't
// allow subpixel AA.
cairo_get_font_options(mContext, mFontOptions);
cairo_antialias_t antialias = cairo_font_options_get_antialias(mFontOptions);
if (antialias == CAIRO_ANTIALIAS_SUBPIXEL) {
cairo_font_options_set_antialias(mFontOptions, CAIRO_ANTIALIAS_GRAY);
cairo_set_font_options(mContext, mFontOptions);
}
}
void
DrawTargetCairo::SetPermitSubpixelAA(bool aPermitSubpixelAA)
{
@ -1334,6 +1379,9 @@ DrawTargetCairo::FillGlyphs(ScaledFont *aFont,
cairo_set_antialias(mContext, GfxAntialiasToCairoAntialias(aOptions.mAntialiasMode));
// Override any font-specific options as necessary.
SetFontOptions();
// Convert our GlyphBuffer into a vector of Cairo glyphs. This code can
// execute millions of times in short periods, so we want to avoid heap
// allocation whenever possible. So we use an inline vector capacity of 1024

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

@ -223,6 +223,10 @@ private: // methods
// draw into it, to simulate the effect of an unbounded source operator.
void ClearSurfaceForUnboundedSource(const CompositionOp &aOperator);
// Set the Cairo context font options according to the current draw target
// font state.
void SetFontOptions();
private: // data
cairo_t* mContext;
cairo_surface_t* mSurface;
@ -231,6 +235,8 @@ private: // data
uint8_t* mLockedBits;
cairo_font_options_t* mFontOptions;
struct PushedLayer
{
PushedLayer(Float aOpacity, bool aWasPermittingSubpixelAA)

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

@ -23,7 +23,9 @@ class MemoryTextureData : public BufferTextureData
{
public:
static MemoryTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend,TextureFlags aFlags,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator);
@ -60,7 +62,9 @@ class ShmemTextureData : public BufferTextureData
{
public:
static ShmemTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator);
@ -107,15 +111,18 @@ bool ComputeHasIntermediateBuffer(gfx::SurfaceFormat aFormat,
BufferTextureData*
BufferTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend, TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator)
{
if (!aAllocator || aAllocator->IsSameProcess()) {
return MemoryTextureData::Create(aSize, aFormat, aMoz2DBackend, aFlags,
return MemoryTextureData::Create(aSize, aFormat, aMoz2DBackend,
aLayersBackend, aFlags,
aAllocFlags, aAllocator);
} else if (aAllocator->AsShmemAllocator()) {
return ShmemTextureData::Create(aSize, aFormat, aMoz2DBackend, aFlags,
return ShmemTextureData::Create(aSize, aFormat, aMoz2DBackend,
aLayersBackend, aFlags,
aAllocFlags, aAllocator);
}
return nullptr;
@ -452,7 +459,8 @@ InitBuffer(uint8_t* buf, size_t bufSize,
MemoryTextureData*
MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend, TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator)
{
@ -474,10 +482,11 @@ MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
return nullptr;
}
auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
bool hasIntermediateBuffer = fwd ? ComputeHasIntermediateBuffer(aFormat,
fwd->GetCompositorBackendType())
: true;
// LAYERS_NONE must imply that we have no compositable forwarder
MOZ_ASSERT_IF(aLayersBackend == LayersBackend::LAYERS_NONE,
!aAllocator || !aAllocator->AsCompositableForwarder());
bool hasIntermediateBuffer = ComputeHasIntermediateBuffer(aFormat, aLayersBackend);
GfxMemoryImageReporter::DidAlloc(buf);
@ -500,8 +509,11 @@ MemoryTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags) const
{
auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
auto backend = fwd ? fwd->GetCompositorBackendType() : LayersBackend::LAYERS_NONE;
return MemoryTextureData::Create(GetSize(), GetFormat(), mMoz2DBackend,
aFlags, aAllocFlags, aAllocator);
backend, aFlags, aAllocFlags, aAllocator);
}
bool
@ -519,7 +531,8 @@ ShmemTextureData::Serialize(SurfaceDescriptor& aOutDescriptor)
ShmemTextureData*
ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend, TextureFlags aFlags,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend, TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator)
{
@ -551,10 +564,11 @@ ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
return nullptr;
}
auto fwd = aAllocator->AsCompositableForwarder();
bool hasIntermediateBuffer = fwd ? ComputeHasIntermediateBuffer(aFormat,
fwd->GetCompositorBackendType())
: true;
// LAYERS_NONE must imply that we have no compositable forwarder
MOZ_ASSERT_IF(aLayersBackend == LayersBackend::LAYERS_NONE,
!aAllocator || !aAllocator->AsCompositableForwarder());
bool hasIntermediateBuffer = ComputeHasIntermediateBuffer(aFormat, aLayersBackend);
BufferDescriptor descriptor = RGBDescriptor(aSize, aFormat, hasIntermediateBuffer);
@ -568,8 +582,11 @@ ShmemTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags) const
{
auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
auto backend = fwd ? fwd->GetCompositorBackendType() : LayersBackend::LAYERS_NONE;
return ShmemTextureData::Create(GetSize(), GetFormat(), mMoz2DBackend,
aFlags, aAllocFlags, aAllocator);
backend, aFlags, aAllocFlags, aAllocator);
}
void

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

@ -22,7 +22,9 @@ class BufferTextureData : public TextureData
{
public:
static BufferTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend,TextureFlags aFlags,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator);

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

@ -1118,7 +1118,8 @@ TextureClient::CreateForDrawing(TextureForwarder* aAllocator,
// Can't do any better than a buffer texture client.
return TextureClient::CreateForRawBufferAccess(aAllocator, aFormat, aSize,
moz2DBackend, aTextureFlags, aAllocFlags);
moz2DBackend, aLayersBackend,
aTextureFlags, aAllocFlags);
}
// static
@ -1191,6 +1192,22 @@ TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::BackendType aMoz2DBackend,
TextureFlags aTextureFlags,
TextureAllocationFlags aAllocFlags)
{
auto fwd = aAllocator->AsCompositableForwarder();
auto backend = fwd ? fwd->GetCompositorBackendType() : LayersBackend::LAYERS_NONE;
return CreateForRawBufferAccess(aAllocator, aFormat, aSize, aMoz2DBackend,
backend, aTextureFlags, aAllocFlags);
}
// static
already_AddRefed<TextureClient>
TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend,
TextureFlags aTextureFlags,
TextureAllocationFlags aAllocFlags)
{
// also test the validity of aAllocator
MOZ_ASSERT(aAllocator && aAllocator->IPCOpen());
@ -1213,8 +1230,8 @@ TextureClient::CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
}
TextureData* texData = BufferTextureData::Create(aSize, aFormat, aMoz2DBackend,
aTextureFlags, aAllocFlags,
aAllocator);
aLayersBackend, aTextureFlags,
aAllocFlags, aAllocator);
if (!texData) {
return nullptr;
}

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

@ -376,6 +376,16 @@ public:
// Creates and allocates a TextureClient (can be accessed through raw
// pointers).
static already_AddRefed<TextureClient>
CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,
gfx::BackendType aMoz2dBackend,
LayersBackend aLayersBackend,
TextureFlags aTextureFlags,
TextureAllocationFlags flags = ALLOC_DEFAULT);
// TODO: remove this one and use the one above instead.
static already_AddRefed<TextureClient>
CreateForRawBufferAccess(ClientIPCAllocator* aAllocator,
gfx::SurfaceFormat aFormat,
gfx::IntSize aSize,

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

@ -153,6 +153,7 @@ TextureClientPool::AllocateTextureClient()
TextureClient::CreateForRawBufferAccess(mSurfaceAllocator,
mFormat, mSize,
gfx::BackendType::NONE,
mBackend,
mFlags, ALLOC_DEFAULT);
} else {
newClient =

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

@ -198,7 +198,7 @@ struct Animation {
float iterations;
float iterationStart;
// This uses the NS_STYLE_ANIMATION_DIRECTION_* constants.
int32_t direction;
uint8_t direction;
nsCSSPropertyID property;
AnimationData data;
float playbackRate;

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

@ -225,7 +225,8 @@ TEST(Layers, TextureSerialization) {
auto texData = BufferTextureData::Create(surface->GetSize(),
gfx::ImageFormatToSurfaceFormat(surface->Format()),
gfx::BackendType::CAIRO, TextureFlags::DEALLOCATE_CLIENT, ALLOC_DEFAULT, nullptr
gfx::BackendType::CAIRO, LayersBackend::LAYERS_NONE,
TextureFlags::DEALLOCATE_CLIENT, ALLOC_DEFAULT, nullptr
);
ASSERT_TRUE(!!texData);

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

@ -16,14 +16,14 @@ namespace mozilla {
namespace image {
AnimationSurfaceProvider::AnimationSurfaceProvider(NotNull<RasterImage*> aImage,
NotNull<Decoder*> aDecoder,
const SurfaceKey& aSurfaceKey)
: ISurfaceProvider(AvailabilityState::StartAsPlaceholder())
const SurfaceKey& aSurfaceKey,
NotNull<Decoder*> aDecoder)
: ISurfaceProvider(ImageKey(aImage.get()), aSurfaceKey,
AvailabilityState::StartAsPlaceholder())
, mImage(aImage.get())
, mDecodingMutex("AnimationSurfaceProvider::mDecoder")
, mDecoder(aDecoder.get())
, mFramesMutex("AnimationSurfaceProvider::mFrames")
, mSurfaceKey(aSurfaceKey)
{
MOZ_ASSERT(!mDecoder->IsMetadataDecode(),
"Use MetadataDecodingTask for metadata decodes");
@ -111,7 +111,7 @@ AnimationSurfaceProvider::LogicalSizeInBytes() const
// Unfortunately there's no way to know in advance how many frames an
// animation has, so we really can't do better here. This will become correct
// once bug 1289954 is complete.
IntSize size = mSurfaceKey.Size();
IntSize size = GetSurfaceKey().Size();
return 3 * size.width * size.height * sizeof(uint32_t);
}
@ -253,9 +253,7 @@ AnimationSurfaceProvider::AnnounceSurfaceAvailable()
// AddSizeOfExcludingThis(), since otherwise we'd be acquiring mFramesMutex
// and then the surface cache lock, while the memory reporting code would
// acquire the surface cache lock and then mFramesMutex.
SurfaceCache::SurfaceAvailable(WrapNotNull(this),
ImageKey(mImage.get()),
mSurfaceKey);
SurfaceCache::SurfaceAvailable(WrapNotNull(this));
}
void

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

@ -30,8 +30,8 @@ public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AnimationSurfaceProvider, override)
AnimationSurfaceProvider(NotNull<RasterImage*> aImage,
NotNull<Decoder*> aDecoder,
const SurfaceKey& aSurfaceKey);
const SurfaceKey& aSurfaceKey,
NotNull<Decoder*> aDecoder);
//////////////////////////////////////////////////////////////////////////////
@ -96,9 +96,6 @@ private:
/// The frames of this animation, in order.
nsTArray<RawAccessFrameRef> mFrames;
/// The key under which we're stored as a cache entry in the surface cache.
const SurfaceKey mSurfaceKey;
};
} // namespace image

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

@ -16,13 +16,13 @@ namespace mozilla {
namespace image {
DecodedSurfaceProvider::DecodedSurfaceProvider(NotNull<RasterImage*> aImage,
NotNull<Decoder*> aDecoder,
const SurfaceKey& aSurfaceKey)
: ISurfaceProvider(AvailabilityState::StartAsPlaceholder())
const SurfaceKey& aSurfaceKey,
NotNull<Decoder*> aDecoder)
: ISurfaceProvider(ImageKey(aImage.get()), aSurfaceKey,
AvailabilityState::StartAsPlaceholder())
, mImage(aImage.get())
, mMutex("mozilla::image::DecodedSurfaceProvider")
, mDecoder(aDecoder.get())
, mSurfaceKey(aSurfaceKey)
{
MOZ_ASSERT(!mDecoder->IsMetadataDecode(),
"Use MetadataDecodingTask for metadata decodes");
@ -121,7 +121,7 @@ size_t
DecodedSurfaceProvider::LogicalSizeInBytes() const
{
// Single frame images are always 32bpp.
IntSize size = mSurfaceKey.Size();
IntSize size = GetSurfaceKey().Size();
return size.width * size.height * sizeof(uint32_t);
}
@ -187,9 +187,7 @@ DecodedSurfaceProvider::CheckForNewSurface()
// We just got a surface for the first time; let the surface cache know.
MOZ_ASSERT(mImage);
SurfaceCache::SurfaceAvailable(WrapNotNull(this),
ImageKey(mImage.get()),
mSurfaceKey);
SurfaceCache::SurfaceAvailable(WrapNotNull(this));
}
void

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

@ -29,8 +29,8 @@ public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DecodedSurfaceProvider, override)
DecodedSurfaceProvider(NotNull<RasterImage*> aImage,
NotNull<Decoder*> aDecoder,
const SurfaceKey& aSurfaceKey);
const SurfaceKey& aSurfaceKey,
NotNull<Decoder*> aDecoder);
//////////////////////////////////////////////////////////////////////////////
@ -81,9 +81,6 @@ private:
/// A drawable reference to our service; used for locking.
DrawableFrameRef mLockRef;
/// The key under which we're stored as a cache entry in the surface cache.
SurfaceKey mSurfaceKey;
};
} // namespace image

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

@ -145,14 +145,12 @@ DecoderFactory::CreateDecoder(DecoderType aType,
RasterSurfaceKey(aOutputSize, aSurfaceFlags, PlaybackType::eStatic);
NotNull<RefPtr<DecodedSurfaceProvider>> provider =
WrapNotNull(new DecodedSurfaceProvider(aImage,
WrapNotNull(decoder),
surfaceKey));
surfaceKey,
WrapNotNull(decoder)));
// Attempt to insert the surface provider into the surface cache right away so
// we won't trigger any more decoders with the same parameters.
InsertOutcome outcome =
SurfaceCache::Insert(provider, ImageKey(aImage.get()), surfaceKey);
if (outcome != InsertOutcome::SUCCESS) {
if (SurfaceCache::Insert(provider) != InsertOutcome::SUCCESS) {
return nullptr;
}
@ -197,14 +195,12 @@ DecoderFactory::CreateAnimationDecoder(DecoderType aType,
RasterSurfaceKey(aIntrinsicSize, aSurfaceFlags, PlaybackType::eAnimated);
NotNull<RefPtr<AnimationSurfaceProvider>> provider =
WrapNotNull(new AnimationSurfaceProvider(aImage,
WrapNotNull(decoder),
surfaceKey));
surfaceKey,
WrapNotNull(decoder)));
// Attempt to insert the surface provider into the surface cache right away so
// we won't trigger any more decoders with the same parameters.
InsertOutcome outcome =
SurfaceCache::Insert(provider, ImageKey(aImage.get()), surfaceKey);
if (outcome != InsertOutcome::SUCCESS) {
if (SurfaceCache::Insert(provider) != InsertOutcome::SUCCESS) {
return nullptr;
}

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

@ -40,6 +40,14 @@ public:
NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0;
NS_IMETHOD_(MozExternalRefCountType) Release() = 0;
/// @return key data used for identifying which image this ISurfaceProvider is
/// associated with in the surface cache.
ImageKey GetImageKey() const { return mImageKey; }
/// @return key data used to uniquely identify this ISurfaceProvider's cache
/// entry in the surface cache.
const SurfaceKey& GetSurfaceKey() const { return mSurfaceKey; }
/// @return a (potentially lazily computed) drawable reference to a surface.
virtual DrawableSurface Surface();
@ -48,7 +56,8 @@ public:
/// @return the number of bytes of memory this ISurfaceProvider is expected to
/// require. Optimizations may result in lower real memory usage. Trivial
/// overhead is ignored.
/// overhead is ignored. Because this value is used in bookkeeping, it's
/// important that it be constant over the lifetime of this object.
virtual size_t LogicalSizeInBytes() const = 0;
/// @return the actual number of bytes of memory this ISurfaceProvider is
@ -74,9 +83,15 @@ public:
const AvailabilityState& Availability() const { return mAvailability; }
protected:
explicit ISurfaceProvider(AvailabilityState aAvailability)
: mAvailability(aAvailability)
{ }
ISurfaceProvider(const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey,
AvailabilityState aAvailability)
: mImageKey(aImageKey)
, mSurfaceKey(aSurfaceKey)
, mAvailability(aAvailability)
{
MOZ_ASSERT(aImageKey, "Must have a valid image key");
}
virtual ~ISurfaceProvider() { }
@ -99,6 +114,8 @@ private:
friend class CachedSurface;
friend class DrawableSurface;
const ImageKey mImageKey;
const SurfaceKey mSurfaceKey;
AvailabilityState mAvailability;
};
@ -220,10 +237,15 @@ class SimpleSurfaceProvider final : public ISurfaceProvider
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SimpleSurfaceProvider, override)
explicit SimpleSurfaceProvider(NotNull<imgFrame*> aSurface)
: ISurfaceProvider(AvailabilityState::StartAvailable())
SimpleSurfaceProvider(const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey,
NotNull<imgFrame*> aSurface)
: ISurfaceProvider(aImageKey, aSurfaceKey,
AvailabilityState::StartAvailable())
, mSurface(aSurface)
{ }
{
MOZ_ASSERT(aSurfaceKey.Size() == mSurface->GetSize());
}
bool IsFinished() const override { return mSurface->IsFinished(); }

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

@ -124,17 +124,10 @@ public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(CachedSurface)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CachedSurface)
CachedSurface(NotNull<ISurfaceProvider*> aProvider,
const Cost aCost,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey)
explicit CachedSurface(NotNull<ISurfaceProvider*> aProvider)
: mProvider(aProvider)
, mCost(aCost)
, mImageKey(aImageKey)
, mSurfaceKey(aSurfaceKey)
{
MOZ_ASSERT(mImageKey, "Must have a valid image key");
}
, mIsLocked(false)
{ }
DrawableSurface GetDrawableSurface() const
{
@ -152,18 +145,31 @@ public:
return; // Can't lock a placeholder.
}
// Update both our state and our provider's state. Some surface providers
// are permanently locked; maintaining our own locking state enables us to
// respect SetLocked() even when it's meaningless from the provider's
// perspective.
mIsLocked = aLocked;
mProvider->SetLocked(aLocked);
}
bool IsLocked() const { return !IsPlaceholder() && mProvider->IsLocked(); }
bool IsLocked() const
{
return !IsPlaceholder() && mIsLocked && mProvider->IsLocked();
}
bool IsPlaceholder() const { return mProvider->Availability().IsPlaceholder(); }
bool IsDecoded() const { return !IsPlaceholder() && mProvider->IsFinished(); }
ImageKey GetImageKey() const { return mImageKey; }
SurfaceKey GetSurfaceKey() const { return mSurfaceKey; }
CostEntry GetCostEntry() { return image::CostEntry(WrapNotNull(this), mCost); }
ImageKey GetImageKey() const { return mProvider->GetImageKey(); }
SurfaceKey GetSurfaceKey() const { return mProvider->GetSurfaceKey(); }
nsExpirationState* GetExpirationState() { return &mExpirationState; }
CostEntry GetCostEntry()
{
return image::CostEntry(WrapNotNull(this), mProvider->LogicalSizeInBytes());
}
// A helper type used by SurfaceCacheImpl::CollectSizeOfSurfaces.
struct MOZ_STACK_CLASS SurfaceMemoryReport
{
@ -204,9 +210,7 @@ public:
private:
nsExpirationState mExpirationState;
NotNull<RefPtr<ISurfaceProvider>> mProvider;
const Cost mCost;
const ImageKey mImageKey;
const SurfaceKey mSurfaceKey;
bool mIsLocked;
};
static int64_t
@ -237,11 +241,11 @@ public:
bool IsEmpty() const { return mSurfaces.Count() == 0; }
void Insert(const SurfaceKey& aKey, NotNull<CachedSurface*> aSurface)
void Insert(NotNull<CachedSurface*> aSurface)
{
MOZ_ASSERT(!mLocked || aSurface->IsPlaceholder() || aSurface->IsLocked(),
"Inserting an unlocked surface for a locked image");
mSurfaces.Put(aKey, aSurface);
mSurfaces.Put(aSurface->GetSurfaceKey(), aSurface);
}
void Remove(NotNull<CachedSurface*> aSurface)
@ -417,21 +421,20 @@ public:
Mutex& GetMutex() { return mMutex; }
InsertOutcome Insert(NotNull<ISurfaceProvider*> aProvider,
const Cost aCost,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey,
bool aSetAvailable)
{
// If this is a duplicate surface, refuse to replace the original.
// XXX(seth): Calling Lookup() and then RemoveEntry() does the lookup
// twice. We'll make this more efficient in bug 1185137.
LookupResult result = Lookup(aImageKey, aSurfaceKey, /* aMarkUsed = */ false);
LookupResult result = Lookup(aProvider->GetImageKey(),
aProvider->GetSurfaceKey(),
/* aMarkUsed = */ false);
if (MOZ_UNLIKELY(result)) {
return InsertOutcome::FAILURE_ALREADY_PRESENT;
}
if (result.Type() == MatchType::PENDING) {
RemoveEntry(aImageKey, aSurfaceKey);
RemoveEntry(aProvider->GetImageKey(), aProvider->GetSurfaceKey());
}
MOZ_ASSERT(result.Type() == MatchType::NOT_FOUND ||
@ -440,14 +443,15 @@ public:
// If this is bigger than we can hold after discarding everything we can,
// refuse to cache it.
if (MOZ_UNLIKELY(!CanHoldAfterDiscarding(aCost))) {
Cost cost = aProvider->LogicalSizeInBytes();
if (MOZ_UNLIKELY(!CanHoldAfterDiscarding(cost))) {
mOverflowCount++;
return InsertOutcome::FAILURE;
}
// Remove elements in order of cost until we can fit this in the cache. Note
// that locked surfaces aren't in mCosts, so we never remove them here.
while (aCost > mAvailableCost) {
while (cost > mAvailableCost) {
MOZ_ASSERT(!mCosts.IsEmpty(),
"Removed everything and it still won't fit");
Remove(mCosts.LastElement().Surface());
@ -455,10 +459,10 @@ public:
// Locate the appropriate per-image cache. If there's not an existing cache
// for this image, create it.
RefPtr<ImageSurfaceCache> cache = GetImageCache(aImageKey);
RefPtr<ImageSurfaceCache> cache = GetImageCache(aProvider->GetImageKey());
if (!cache) {
cache = new ImageSurfaceCache;
mImageCaches.Put(aImageKey, cache);
mImageCaches.Put(aProvider->GetImageKey(), cache);
}
// If we were asked to mark the cache entry available, do so.
@ -467,7 +471,7 @@ public:
}
NotNull<RefPtr<CachedSurface>> surface =
WrapNotNull(new CachedSurface(aProvider, aCost, aImageKey, aSurfaceKey));
WrapNotNull(new CachedSurface(aProvider));
// We require that locking succeed if the image is locked and we're not
// inserting a placeholder; the caller may need to know this to handle
@ -480,8 +484,8 @@ public:
}
// Insert.
MOZ_ASSERT(aCost <= mAvailableCost, "Inserting despite too large a cost");
cache->Insert(aSurfaceKey, surface);
MOZ_ASSERT(cost <= mAvailableCost, "Inserting despite too large a cost");
cache->Insert(surface);
StartTracking(surface);
return InsertOutcome::SUCCESS;
@ -654,9 +658,7 @@ public:
return size_t(mMaxCost);
}
void SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey)
void SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider)
{
if (!aProvider->Availability().IsPlaceholder()) {
MOZ_ASSERT_UNREACHABLE("Calling SurfaceAvailable on non-placeholder");
@ -669,8 +671,7 @@ public:
// surface first, but it's fine either way.
// XXX(seth): This could be implemented more efficiently; we should be able
// to just update our data structures without reinserting.
Cost cost = aProvider->LogicalSizeInBytes();
Insert(aProvider, cost, aImageKey, aSurfaceKey, /* aSetAvailable = */ true);
Insert(aProvider, /* aSetAvailable = */ true);
}
void LockImage(const ImageKey aImageKey)
@ -1028,18 +1029,14 @@ SurfaceCache::LookupBestMatch(const ImageKey aImageKey,
}
/* static */ InsertOutcome
SurfaceCache::Insert(NotNull<ISurfaceProvider*> aProvider,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey)
SurfaceCache::Insert(NotNull<ISurfaceProvider*> aProvider)
{
if (!sInstance) {
return InsertOutcome::FAILURE;
}
MutexAutoLock lock(sInstance->GetMutex());
Cost cost = aProvider->LogicalSizeInBytes();
return sInstance->Insert(aProvider, cost, aImageKey, aSurfaceKey,
/* aSetAvailable = */ false);
return sInstance->Insert(aProvider, /* aSetAvailable = */ false);
}
/* static */ bool
@ -1064,20 +1061,18 @@ SurfaceCache::CanHold(size_t aSize)
}
/* static */ void
SurfaceCache::SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey)
SurfaceCache::SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider)
{
if (!sInstance) {
return;
}
MutexAutoLock lock(sInstance->GetMutex());
sInstance->SurfaceAvailable(aProvider, aImageKey, aSurfaceKey);
sInstance->SurfaceAvailable(aProvider);
}
/* static */ void
SurfaceCache::LockImage(Image* aImageKey)
SurfaceCache::LockImage(const ImageKey aImageKey)
{
if (sInstance) {
MutexAutoLock lock(sInstance->GetMutex());
@ -1086,7 +1081,7 @@ SurfaceCache::LockImage(Image* aImageKey)
}
/* static */ void
SurfaceCache::UnlockImage(Image* aImageKey)
SurfaceCache::UnlockImage(const ImageKey aImageKey)
{
if (sInstance) {
MutexAutoLock lock(sInstance->GetMutex());
@ -1104,7 +1099,7 @@ SurfaceCache::UnlockEntries(const ImageKey aImageKey)
}
/* static */ void
SurfaceCache::RemoveImage(Image* aImageKey)
SurfaceCache::RemoveImage(const ImageKey aImageKey)
{
if (sInstance) {
MutexAutoLock lock(sInstance->GetMutex());

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

@ -269,10 +269,6 @@ struct SurfaceCache
* need to check the result of Insert() at all.
*
* @param aProvider The new cache entry to insert into the cache.
* @param aImageKey Key data identifying which image the cache entry
* belongs to.
* @param aSurfaceKey Key data which uniquely identifies the requested
* cache entry.
* @return SUCCESS if the cache entry was inserted successfully. (But see above
* for more information about when you should check this.)
* FAILURE if the cache entry could not be inserted, e.g. for capacity
@ -281,9 +277,7 @@ struct SurfaceCache
* FAILURE_ALREADY_PRESENT if an entry with the same ImageKey and
* SurfaceKey already exists in the cache.
*/
static InsertOutcome Insert(NotNull<ISurfaceProvider*> aProvider,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey);
static InsertOutcome Insert(NotNull<ISurfaceProvider*> aProvider);
/**
* Mark the cache entry @aProvider as having an available surface. This turns
@ -299,14 +293,8 @@ struct SurfaceCache
* available already.
*
* @param aProvider The cache entry that now has a surface available.
* @param aImageKey Key data identifying which image the cache entry
* belongs to.
* @param aSurfaceKey Key data which uniquely identifies the requested
* cache entry.
*/
static void SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey);
static void SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider);
/**
* Checks if a surface of a given size could possibly be stored in the cache.

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

@ -962,10 +962,10 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams)
}
// Attempt to cache the frame.
SurfaceKey surfaceKey = VectorSurfaceKey(aParams.size, aParams.svgContext);
NotNull<RefPtr<ISurfaceProvider>> provider =
WrapNotNull(new SimpleSurfaceProvider(frame));
SurfaceCache::Insert(provider, ImageKey(this),
VectorSurfaceKey(aParams.size, aParams.svgContext));
WrapNotNull(new SimpleSurfaceProvider(ImageKey(this), surfaceKey, frame));
SurfaceCache::Insert(provider);
// Draw.
RefPtr<gfxDrawable> drawable =

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

@ -587,24 +587,6 @@ DecodeFunctionSection(Decoder& d, ModuleGeneratorData* init)
return true;
}
static bool
CheckTypeForJS(Decoder& d, const Sig& sig)
{
for (ValType argType : sig.args()) {
if (argType == ValType::I64 && !JitOptions.wasmTestMode)
return Fail(d, "cannot import/export i64 argument");
if (IsSimdType(argType))
return Fail(d, "cannot import/export SIMD argument");
}
if (sig.ret() == ExprType::I64 && !JitOptions.wasmTestMode)
return Fail(d, "cannot import/export i64 return type");
if (IsSimdType(sig.ret()))
return Fail(d, "cannot import/export SIMD return type");
return true;
}
static UniqueChars
MaybeDecodeName(Decoder& d)
{
@ -766,9 +748,6 @@ DecodeImport(Decoder& d, bool newFormat, ModuleGeneratorData* init, ImportVector
if (!DecodeSignatureIndex(d, *init, &sig))
return false;
if (!CheckTypeForJS(d, *sig))
return false;
if (!init->funcImports.emplaceBack(sig))
return false;
@ -806,8 +785,6 @@ DecodeImport(Decoder& d, bool newFormat, ModuleGeneratorData* init, ImportVector
const SigWithId* sig = nullptr;
if (!DecodeSignatureIndex(d, *init, &sig))
return false;
if (!CheckTypeForJS(d, *sig))
return false;
if (!init->funcImports.emplaceBack(sig))
return false;
break;
@ -1103,9 +1080,6 @@ DecodeExport(Decoder& d, bool newFormat, ModuleGenerator& mg, CStringSet* dupSet
if (funcIndex >= mg.numFuncSigs())
return Fail(d, "exported function index out of bounds");
if (!CheckTypeForJS(d, mg.funcSig(funcIndex)))
return false;
UniqueChars fieldName = DecodeExportName(d, dupSet);
if (!fieldName)
return false;
@ -1130,9 +1104,6 @@ DecodeExport(Decoder& d, bool newFormat, ModuleGenerator& mg, CStringSet* dupSet
if (funcIndex >= mg.numFuncSigs())
return Fail(d, "exported function index out of bounds");
if (!CheckTypeForJS(d, mg.funcSig(funcIndex)))
return false;
return mg.addFuncExport(Move(fieldName), funcIndex);
}
case DefinitionKind::Table: {

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

@ -133,7 +133,10 @@ Instance::callImport(JSContext* cx, uint32_t funcImportIndex, unsigned argc, con
args[i].set(JS::CanonicalizedDoubleValue(*(double*)&argv[i]));
break;
case ValType::I64: {
MOZ_ASSERT(JitOptions.wasmTestMode, "no int64 in asm.js/wasm");
if (!JitOptions.wasmTestMode) {
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_I64);
return false;
}
RootedObject obj(cx, CreateI64Object(cx, *(int64_t*)&argv[i]));
if (!obj)
return false;
@ -160,6 +163,12 @@ Instance::callImport(JSContext* cx, uint32_t funcImportIndex, unsigned argc, con
if (!Call(cx, fval, thisv, args, rval))
return false;
// Throw an error if returning i64 and not in test mode.
if (!JitOptions.wasmTestMode && fi.sig().ret() == ExprType::I64) {
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_I64);
return false;
}
// Don't try to optimize if the function has at least one i64 arg or if
// it returns an int64. GenerateJitExit relies on this, as does the
// type inference code below in this function.
@ -539,7 +548,10 @@ Instance::callExport(JSContext* cx, uint32_t funcIndex, CallArgs args)
return false;
break;
case ValType::I64:
MOZ_ASSERT(JitOptions.wasmTestMode, "no int64 in asm.js/wasm");
if (!JitOptions.wasmTestMode) {
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_I64);
return false;
}
if (!ReadI64Object(cx, v, (int64_t*)&exportArgs[i]))
return false;
break;
@ -655,7 +667,10 @@ Instance::callExport(JSContext* cx, uint32_t funcIndex, CallArgs args)
args.rval().set(Int32Value(*(int32_t*)retAddr));
break;
case ExprType::I64:
MOZ_ASSERT(JitOptions.wasmTestMode, "no int64 in asm.js/wasm");
if (!JitOptions.wasmTestMode) {
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_I64);
return false;
}
retObj = CreateI64Object(cx, *(int64_t*)retAddr);
if (!retObj)
return false;

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

@ -168,7 +168,6 @@ wasm::GenerateEntry(MacroAssembler& masm, const FuncExport& fe)
unsigned argOffset = iter.index() * sizeof(ExportArg);
Address src(argv, argOffset);
MIRType type = iter.mirType();
MOZ_ASSERT_IF(type == MIRType::Int64, JitOptions.wasmTestMode);
switch (iter->kind()) {
case ABIArg::GPR:
if (type == MIRType::Int32)
@ -283,7 +282,6 @@ wasm::GenerateEntry(MacroAssembler& masm, const FuncExport& fe)
masm.store32(ReturnReg, Address(argv, 0));
break;
case ExprType::I64:
MOZ_ASSERT(JitOptions.wasmTestMode, "no int64 in asm.js/wasm");
masm.store64(ReturnReg64, Address(argv, 0));
break;
case ExprType::F32:
@ -334,8 +332,6 @@ FillArgumentArray(MacroAssembler& masm, const ValTypeVector& args, unsigned argO
Address dstAddr(masm.getStackPointer(), argOffset + i.index() * sizeof(Value));
MIRType type = i.mirType();
MOZ_ASSERT_IF(type == MIRType::Int64, JitOptions.wasmTestMode);
switch (i->kind()) {
case ABIArg::GPR:
if (type == MIRType::Int32) {
@ -520,7 +516,6 @@ wasm::GenerateInterpExit(MacroAssembler& masm, const FuncImport& fi, uint32_t fu
masm.load32(argv, ReturnReg);
break;
case ExprType::I64:
MOZ_ASSERT(JitOptions.wasmTestMode);
masm.call(SymbolicAddress::CallImport_I64);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, JumpTarget::Throw);
masm.load64(argv, ReturnReg64);
@ -716,7 +711,6 @@ wasm::GenerateJitExit(MacroAssembler& masm, const FuncImport& fi)
/* -0 check */ false);
break;
case ExprType::I64:
MOZ_ASSERT(JitOptions.wasmTestMode, "no int64 in asm.js/wasm");
// We don't expect int64 to be returned from Ion yet, because of a
// guard in callImport.
masm.breakpoint();

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

@ -28,8 +28,6 @@ testConst('i32', '-0x80000000', -2147483648);
testConst('i32', '0xffffffff', -1);
{
assertErrorMessage(() => wasmEvalText('(module (func (result i64) (i64.const 0)) (export "" 0))'), TypeError, /cannot .* i64/);
setJitCompilerOption('wasm.test-mode', 1);
testConst('i64', '0', 0);
@ -74,8 +72,6 @@ testConst('i32', '0xffffffff', -1);
testConstError('i64', 'not an i64');
setJitCompilerOption('wasm.test-mode', 0);
assertErrorMessage(() => wasmEvalText('(module (func (result i64) (i64.const 0)) (export "" 0))'), TypeError, /cannot .* i64/);
}
testConst('f32', '0.0', 0.0);

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

@ -67,8 +67,15 @@ wasmEvalText('(module (func (result i32) (param i32) (i32.const 42)))');
wasmEvalText('(module (func (param f32)))');
wasmEvalText('(module (func (param f64)))');
assertErrorMessage(() => wasmEvalText('(module (func (param i64) (result i32) (i32.const 123)) (export "" 0))'), TypeError, /i64 argument/);
assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result i64) (i64.const 123)) (export "" 0))'), TypeError, /i64 return type/);
var f = wasmEvalText('(module (func (param i64) (result i32) (i32.const 123)) (export "" 0))');
assertErrorMessage(() => f(), TypeError, /i64/);
var f = wasmEvalText('(module (func (param i32) (result i64) (i64.const 123)) (export "" 0))');
assertErrorMessage(() => f(), TypeError, /i64/);
var f = wasmEvalText('(module (import $imp "a" "b" (param i64) (result i32)) (func $f (call_import $imp (i64.const 0))) (export "" $f))', {a:{b:()=>{}}});
assertErrorMessage(() => f(), TypeError, /i64/);
var f = wasmEvalText('(module (import $imp "a" "b" (result i64)) (func $f (call_import $imp)) (export "" $f))', {a:{b:()=>{}}});
assertErrorMessage(() => f(), TypeError, /i64/);
setJitCompilerOption('wasm.test-mode', 1);
assertEqI64(wasmEvalText('(module (func (result i64) (i64.const 123)) (export "" 0))')(), {low: 123, high: 0});
@ -327,9 +334,6 @@ if (typeof evaluate === 'function')
evaluate(`Wasm.instantiateModule(wasmTextToBinary('(module)')) `, { fileName: null });
{
assertErrorMessage(() => wasmEvalText('(module (import "a" "" (param i64) (result i32)))'), TypeError, /i64 argument/);
assertErrorMessage(() => wasmEvalText('(module (import "a" "" (result i64)))'), TypeError, /i64 return type/);
setJitCompilerOption('wasm.test-mode', 1);
let imp = {

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

@ -287,6 +287,14 @@ assertEq(e1.foo, tbl.get(1));
assertEq(tbl.get(0) === e1.foo, false);
assertEq(e1.foo === e2.foo, false);
// i64 is fully allowed for imported wasm functions
var code1 = textToBinary('(module (func $exp (param i64) (result i64) (i64.add (get_local 0) (i64.const 10))) (export "exp" $exp))');
var e1 = new Instance(new Module(code1)).exports;
var code2 = textToBinary('(module (import $i "a" "b" (param i64) (result i64)) (func $f (result i32) (i32.wrap/i64 (call_import $i (i64.const 42)))) (export "f" $f))');
var e2 = new Instance(new Module(code2), {a:{b:e1.exp}}).exports;
assertEq(e2.f(), 52);
// Non-existent export errors
assertErrorMessage(() => new Module(textToBinary('(module (export "a" 0))')), TypeError, /exported function index out of bounds/);

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

@ -356,6 +356,7 @@ MSG_DEF(JSMSG_WASM_BAD_IMPORT_ARG, 0, JSEXN_TYPEERR, "second argument, i
MSG_DEF(JSMSG_WASM_BAD_IMPORT_FIELD, 1, JSEXN_TYPEERR, "import object field is not {0}")
MSG_DEF(JSMSG_WASM_BAD_IMPORT_SIG, 0, JSEXN_TYPEERR, "imported function signature mismatch")
MSG_DEF(JSMSG_WASM_BAD_SET_VALUE, 0, JSEXN_TYPEERR, "second argument must be null or an exported WebAssembly Function object")
MSG_DEF(JSMSG_WASM_BAD_I64, 0, JSEXN_TYPEERR, "cannot pass i64 to or from JS")
MSG_DEF(JSMSG_WASM_UNREACHABLE, 0, JSEXN_ERR, "unreachable executed")
MSG_DEF(JSMSG_WASM_INTEGER_OVERFLOW, 0, JSEXN_ERR, "integer overflow")
MSG_DEF(JSMSG_WASM_INVALID_CONVERSION, 0, JSEXN_ERR, "invalid conversion to integer")

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