Merge mozilla-central to b2g-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-07-13 12:12:09 +02:00
Родитель d5f9c000c6 4a67c881e4
Коммит 78b65dfa04
604 изменённых файлов: 33718 добавлений и 6634 удалений

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

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 1178892 requires clobber for profiler file moves.
Bug 1178850 requires clobber for Android JNI header changes

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

@ -5,3 +5,4 @@
# This file is included at the bottom of all b2g mozconfigs
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -12,7 +12,6 @@ export GONK_PRODUCT=generic
ac_add_options --with-gonk-toolchain-prefix="$topsrcdir/gonk-toolchain/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-"
ac_add_options --enable-debug-symbols
ac_add_options --enable-debug
#. "$topsrcdir/build/mozconfig.cache"
ENABLE_MARIONETTE=1
# Enable dump() from JS.

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

@ -13,7 +13,6 @@ export GONK_PRODUCT=generic
ac_add_options --with-gonk-toolchain-prefix="$topsrcdir/gonk-toolchain/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-"
ac_add_options --enable-debug-symbols
# ac_add_options --enable-profiling
#. "$topsrcdir/build/mozconfig.cache"
ENABLE_MARIONETTE=1
# Enable dump() from JS.

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

@ -9,9 +9,6 @@ ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
ac_add_options --enable-debug
# Nightlies only since this has a cost in performance
#ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"
#B2G options
ac_add_options --enable-application=b2g

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

@ -9,9 +9,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
# Nightlies only since this has a cost in performance
#ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"
#B2G options
ac_add_options --enable-application=b2g

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

@ -9,9 +9,6 @@ ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
ac_add_options --enable-debug
# Nightlies only since this has a cost in performance
#ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"
#B2G options
ac_add_options --enable-application=b2g

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

@ -9,9 +9,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
# Nightlies only since this has a cost in performance
#ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors
# Use sccache
no_sccache=
. "$topsrcdir/build/mozconfig.cache"
#B2G options
ac_add_options --enable-application=b2g

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

@ -11,9 +11,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

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

@ -12,9 +12,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --enable-signmar
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

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

@ -9,9 +9,6 @@ ac_add_options --enable-jemalloc
ac_add_options --enable-signmar
ac_add_options --enable-debug
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

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

@ -9,9 +9,6 @@ ac_add_options --enable-update-packaging
ac_add_options --enable-jemalloc
ac_add_options --enable-signmar
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

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

@ -1,28 +1,23 @@
[
{
"size": 51,
"digest": "c8e40edb314eeabfb92c77cf5ff9a7857033f15dd65a00349bcf9e3e5b75624afc71f733b2ff7e029c20a78313038409c2bd022bf7e5a7e0c487fc2c2d640986",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
},
{
"size": 31057326,
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
}
]

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

@ -1,28 +1,23 @@
[
{
"size": 51,
"digest": "c8e40edb314eeabfb92c77cf5ff9a7857033f15dd65a00349bcf9e3e5b75624afc71f733b2ff7e029c20a78313038409c2bd022bf7e5a7e0c487fc2c2d640986",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
},
{
"size": 31057326,
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
}
]

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

@ -3,28 +3,24 @@
"clang_version": "r183744"
},
{
"size": 88,
"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 59602619,
"digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
},
{
"size": 31057326,
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
}
]

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

@ -10,6 +10,13 @@
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -12,9 +12,6 @@ ac_add_options --enable-profiling
ac_add_options --enable-instruments
ac_add_options --enable-dtrace
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
@ -30,3 +27,4 @@ export MOZ_PACKAGE_JSSHELL=1
MOZTTDIR=$topsrcdir/moztt
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -1,27 +1,23 @@
[
{
"size": 82,
"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz"
"filename": "gcc.tar.xz",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
},
{
"size": 31057326,
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
}
]

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

@ -3,28 +3,24 @@
"clang_version": "r183744"
},
{
"size": 88,
"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 59602619,
"digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
},
{
"size": 31057326,
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
}
]

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

@ -6,22 +6,17 @@
"filename": "mozmake.exe"
},
{
"size": 51,
"digest": "c8e40edb314eeabfb92c77cf5ff9a7857033f15dd65a00349bcf9e3e5b75624afc71f733b2ff7e029c20a78313038409c2bd022bf7e5a7e0c487fc2c2d640986",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
},
{
"size": 31057326,
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
"algorithm": "sha512",
"filename": "moztt.tar.bz2",
"unpack": "True"
"unpack": true
}
]

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

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1435698725000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1436560690000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -162,7 +162,7 @@
</prefs>
</emItem>
<emItem blockID="i926" id="{B1FC07E1-E05B-4567-8891-E63FBE545BA8}">
<versionRange minVersion="0" maxVersion="1.2.0" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -293,7 +293,7 @@
</prefs>
</emItem>
<emItem blockID="i914" id="{0153E448-190B-4987-BDE1-F256CADA672F}">
<versionRange minVersion="0" maxVersion="15.0.6" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -484,7 +484,7 @@
<emItem blockID="i916" os="WINNT" id="{97E22097-9A2F-45b1-8DAF-36AD648C7EF4}">
<versionRange minVersion="0" maxVersion="15.0.5" severity="1">
</versionRange>
<versionRange minVersion="0" maxVersion="15.0.4" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -776,7 +776,7 @@
</prefs>
</emItem>
<emItem blockID="i924" id="{DAC3F861-B30D-40dd-9166-F4E75327FAC7}">
<versionRange minVersion="0" maxVersion="1.3.1" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -821,7 +821,7 @@
<emItem blockID="i918" os="WINNT" id="{C3949AC2-4B17-43ee-B4F1-D26B9D42404D}">
<versionRange minVersion="0" maxVersion="15.0.5" severity="1">
</versionRange>
<versionRange minVersion="0" maxVersion="15.0.5" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -995,7 +995,7 @@
</prefs>
</emItem>
<emItem blockID="i922" id="{34712C68-7391-4c47-94F3-8F88D49AD632}">
<versionRange minVersion="0" maxVersion="1.3.0" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -1723,7 +1723,7 @@
</prefs>
</emItem>
<emItem blockID="i920" id="{FCE04E1F-9378-4f39-96F6-5689A9159E45}">
<versionRange minVersion="0" maxVersion="1.3.2" severity="1">
<versionRange minVersion="0" maxVersion="*" severity="3">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="39.0a1" maxVersion="*" />
</targetApplication>
@ -3061,6 +3061,18 @@
<match name="filename" exp="libflashplayer\.so" /> <versionRange minVersion="11.2.202.442" maxVersion="11.2.202.467" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem os="Linux" blockID="p936">
<match name="filename" exp="libflashplayer\.so" /> <versionRange minVersion="11.2.202.468" maxVersion="11.2.202.480" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p938">
<match name="filename" exp="(NPSWF32.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="18.0.0.194" maxVersion="18.0.0.202" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
<pluginItem blockID="p940">
<match name="filename" exp="(NPSWF32.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="13.0.0.296" maxVersion="13.0.0.301" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
</pluginItems>
<gfxItems>

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

@ -404,8 +404,13 @@ pref("browser.search.order.1", "chrome://browser-region/locale/re
pref("browser.search.order.2", "chrome://browser-region/locale/region.properties");
pref("browser.search.order.3", "chrome://browser-region/locale/region.properties");
// Market-specific search defaults (US market only)
pref("browser.search.geoSpecificDefaults", true);
// Market-specific search defaults
// This is disabled globally, and then enabled for individual locales
// in firefox-l10n.js (eg. it's enabled for en-US).
pref("browser.search.geoSpecificDefaults", false);
pref("browser.search.geoSpecificDefaults.url", "");
// US specific default (used as a fallback if the geoSpecificDefaults request fails).
pref("browser.search.defaultenginename.US", "data:text/plain,browser.search.defaultenginename.US=Yahoo");
pref("browser.search.order.US.1", "data:text/plain,browser.search.order.US.1=Yahoo");
pref("browser.search.order.US.2", "data:text/plain,browser.search.order.US.2=Google");
@ -1359,7 +1364,6 @@ pref("services.sync.prefs.sync.xpinstall.whitelist.required", true);
// Developer edition preferences
#ifdef MOZ_DEV_EDITION
sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org");
sticky_pref("browser.devedition.theme.enabled", true);
#else
sticky_pref("lightweightThemes.selectedThemeID", "");
#endif

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

@ -53,8 +53,10 @@ function test() {
ok(data.days.hasDay(now), "Have data for today.");
let day = data.days.getDay(now);
// Will need to be changed if Yahoo isn't the default search engine.
let defaultProviderID = "yahoo";
// Will need to be changed if Google isn't the default search engine.
// Note: geoSpecificDefaults are disabled for mochitests, so this is the
// non-US en-US default.
let defaultProviderID = "google";
let field = defaultProviderID + ".contextmenu";
ok(day.has(field), "Have search recorded for context menu.");
@ -66,4 +68,3 @@ function test() {
});
});
}

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

@ -1,8 +1,8 @@
/*
* Testing changes for Developer Edition theme.
* A special stylesheet should be added to the browser.xul document
* when browser.devedition.theme.enabled is set to true and no themes
* are applied.
* when the firefox-devedition@mozilla.org lightweight theme
* is applied.
*/
const PREF_LWTHEME_USED_THEMES = "lightweightThemes.usedThemes";

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

@ -9,6 +9,7 @@
// * A page with tracking elements is loaded and they are not blocked.
// See also Bugs 1175327, 1043801, 1178985
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PREF = "privacy.trackingprotection.enabled";
const PB_PREF = "privacy.trackingprotection.pbmode.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html";
@ -16,8 +17,11 @@ const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/
let TrackingProtection = null;
let browser = null;
let {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
registerCleanupFunction(function() {
TrackingProtection = browser = null;
UrlClassifierTestUtils.cleanupTestTrackers();
Services.prefs.clearUserPref(PREF);
Services.prefs.clearUserPref(PB_PREF);
while (gBrowser.tabs.length > 1) {
@ -108,7 +112,7 @@ function* testTrackingProtectionForTab(tab) {
}
add_task(function* testNormalBrowsing() {
yield updateTrackingProtectionDatabase();
yield UrlClassifierTestUtils.addTestTrackers();
browser = gBrowser;
let tab = browser.selectedTab = browser.addTab();

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

@ -6,6 +6,7 @@
// Control Center when the feature is off.
// See also Bugs 1175327, 1043801, 1178985.
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const PREF = "privacy.trackingprotection.enabled";
const PB_PREF = "privacy.trackingprotection.pbmode.enabled";
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html";
@ -13,8 +14,11 @@ const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/
let TrackingProtection = null;
let browser = null;
let {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
registerCleanupFunction(function() {
TrackingProtection = browser = null;
UrlClassifierTestUtils.cleanupTestTrackers();
Services.prefs.clearUserPref(PREF);
Services.prefs.clearUserPref(PB_PREF);
while (gBrowser.tabs.length > 1) {
@ -23,7 +27,7 @@ registerCleanupFunction(function() {
});
add_task(function* testNormalBrowsing() {
yield updateTrackingProtectionDatabase();
yield UrlClassifierTestUtils.addTestTrackers();
browser = gBrowser;
let tab = browser.selectedTab = browser.addTab();

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

@ -27,8 +27,10 @@ add_task(function* test_healthreport_search_recording() {
let now = new Date();
let oldCount = 0;
// This will to be need changed if default search engine is not Yahoo.
let defaultEngineID = "yahoo";
// This will to be need changed if default search engine is not Google.
// Note: geoSpecificDefaults are disabled for mochitests, so this is the
// non-US en-US default.
let defaultEngineID = "google";
let field = defaultEngineID + ".urlbar";

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

@ -660,55 +660,6 @@ function promiseIndicatorWindow() {
return promiseWindow("chrome://browser/content/webrtcIndicator.xul");
}
/**
* Add some entries to a test tracking protection database, and reset
* back to the default database after the test ends.
*/
function updateTrackingProtectionDatabase() {
let TABLE = "urlclassifier.trackingTable";
Services.prefs.setCharPref(TABLE, "test-track-simple");
registerCleanupFunction(function() {
Services.prefs.clearUserPref(TABLE);
});
// Add some URLs to the tracking database (to be blocked)
let testData = "tracking.example.com/";
let testUpdate =
"n:1000\ni:test-track-simple\nad:1\n" +
"a:524:32:" + testData.length + "\n" +
testData;
return new Promise((resolve, reject) => {
let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
.getService(Ci.nsIUrlClassifierDBService);
let listener = {
QueryInterface: iid => {
if (iid.equals(Ci.nsISupports) ||
iid.equals(Ci.nsIUrlClassifierUpdateObserver))
return listener;
throw Cr.NS_ERROR_NO_INTERFACE;
},
updateUrlRequested: url => { },
streamFinished: status => { },
updateError: errorCode => {
ok(false, "Couldn't update classifier.");
resolve();
},
updateSuccess: requestedTimeout => {
resolve();
}
};
dbService.beginUpdate(listener, "test-track-simple", "");
dbService.beginStream("", "");
dbService.updateStream(testUpdate);
dbService.finishStream();
dbService.finishUpdate();
});
}
function assertWebRTCIndicatorStatus(expected) {
let ui = Cu.import("resource:///modules/webrtcUI.jsm", {}).webrtcUI;
let expectedState = expected ? "visible" : "hidden";

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

@ -216,17 +216,16 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
if (!this._formattingEnabled || !this.editor)
return;
// Always clear the strike-out selection first.
let controller = this.editor.selectionController;
let strikeOut = controller.getSelection(controller.SELECTION_URLSTRIKEOUT);
strikeOut.removeAllRanges();
if (this.focused)
return;
let selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
selection.removeAllRanges();
if (this.focused)
return;
let textNode = this.editor.rootElement.firstChild;
let value = textNode.textContent;
@ -286,17 +285,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
]]></body>
</method>
<method name="_clearFormatting">
<body><![CDATA[
if (!this._formattingEnabled)
return;
let controller = this.editor.selectionController;
let selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
selection.removeAllRanges();
]]></body>
</method>
<method name="handleRevert">
<body><![CDATA[
var isScrolling = this.popupOpen;
@ -953,6 +941,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
<handler event="focus"><![CDATA[
if (event.originalTarget == this.inputField) {
this._hideURLTooltip();
this.formatValue();
}
]]></handler>
@ -991,11 +980,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
event.stopPropagation();
]]></handler>
<handler event="focus" phase="capturing"><![CDATA[
this._hideURLTooltip();
this._clearFormatting();
]]></handler>
<handler event="dragover" phase="capturing" action="this.onDragOver(event, this);"/>
<handler event="drop" phase="capturing" action="this.onDrop(event, this);"/>
<handler event="select"><![CDATA[

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

@ -19,7 +19,7 @@ Our views use [React](http://facebook.github.io/react/) written in JSX files
and transpiled to JS before we commit. You need to install the JSX compiler
using npm in order to compile the .jsx files into regular .js ones:
npm install -g react-tools
npm install -g react-tools@0.12.2
Once installed, run build-jsx with the --watch option from
browser/components/loop, eg.:

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

@ -7,7 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
Components.utils.import("resource://testing-common/TelemetryArchiveTesting.jsm", this);
function test() {

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

@ -7,8 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -7,9 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
requestLongerTimeout(2);
function test() {

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

@ -13,8 +13,6 @@ let gContentWindow;
let highlight = document.getElementById("UITourHighlightContainer");
let tooltip = document.getElementById("UITourTooltip");
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -7,8 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
let hasWebIDE = Services.prefs.getBoolPref("devtools.webide.widget.enabled");
let hasPocket = false;

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

@ -12,8 +12,6 @@ let gContentAPI;
let gContentWindow;
let gContentDoc;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
registerCleanupFunction(function() {
gContentDoc = null;

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

@ -4,8 +4,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -8,8 +8,6 @@ let gContentAPI;
let gContentWindow;
let notificationBox = document.getElementById("high-priority-global-notificationbox");
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -9,7 +9,6 @@ let gContentWindow;
let loopButton;
let loopPanel = document.getElementById("loop-notification-panel");
Components.utils.import("resource:///modules/UITour.jsm");
const { LoopRooms } = Components.utils.import("resource:///modules/loop/LoopRooms.jsm", {});
const { MozLoopServiceInternal } = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});

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

@ -74,8 +74,6 @@ function getDialogDoc() {
return null;
}
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -4,8 +4,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
requestLongerTimeout(2);
UITourTest();

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

@ -13,8 +13,6 @@ let gContentWindow;
let highlight = document.getElementById("UITourHighlight");
let tooltip = document.getElementById("UITourTooltip");
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
registerCleanupFunction(() => {
// Close the find bar in case it's open in the remaining tab

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

@ -8,8 +8,6 @@ let gContentAPI;
let gContentWindow;
let button;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -7,7 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
Components.utils.import("resource://gre/modules/UITelemetry.jsm");
Components.utils.import("resource:///modules/BrowserUITelemetry.jsm");

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

@ -7,8 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -7,8 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
registerCleanupFunction(function() {
Services.prefs.clearUserPref("services.sync.username");

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

@ -4,8 +4,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -4,8 +4,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
function test() {
requestLongerTimeout(2);
UITourTest();

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

@ -9,8 +9,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Cu.import("resource:///modules/UITour.jsm");
function test() {
UITourTest();
}

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

@ -7,9 +7,6 @@ let gTestTab;
let gContentAPI;
let gContentWindow;
Components.utils.import("resource:///modules/UITour.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
function test() {
UITourTest();
}

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

@ -204,8 +204,6 @@ function UITourTest() {
waitForExplicitFinish();
registerCleanupFunction(function() {
delete window.UITour;
delete window.UITourMetricsProvider;
delete window.gContentWindow;
delete window.gContentAPI;
if (gTestTab)

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

@ -11,7 +11,6 @@ MOZ_AUTOMATION_L10N_CHECK=0
export MOZILLA_OFFICIAL=1
#Use ccache
. "$topsrcdir/build/mozconfig.cache"
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
@ -22,3 +21,4 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -3,9 +3,6 @@
ac_add_options --enable-signmar
ac_add_options --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
@ -13,7 +10,5 @@ STRIP_FLAGS="--strip-debug"
ac_add_options --with-branding=browser/branding/nightly
# Use ccache
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -10,9 +10,6 @@ MOZ_AUTOMATION_L10N_CHECK=0
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Use ccache
. "$topsrcdir/build/mozconfig.cache"
# Treat warnings as errors in directories with FAIL_ON_WARNINGS.
ac_add_options --enable-warnings-as-errors
@ -22,3 +19,4 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -3,9 +3,6 @@
ac_add_options --enable-signmar
ac_add_options --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
# This will overwrite the default of stripping everything and keep the symbol table.
# This is useful for profiling and debugging and only increases the package size
# by 2 MBs.
@ -13,7 +10,5 @@ STRIP_FLAGS="--strip-debug"
ac_add_options --with-branding=browser/branding/nightly
# Use ccache
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -3,3 +3,4 @@
ac_add_options --enable-official-branding
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -10,8 +10,7 @@ if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi
. "$topsrcdir/build/mozconfig.cache"
export MOZILLA_OFFICIAL=1
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -6,9 +6,6 @@ ac_add_options --enable-profiling
ac_add_options --enable-instruments
ac_add_options --enable-dtrace
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
ac_add_options --with-macbundlename-prefix=Firefox
fi
@ -16,3 +13,4 @@ fi
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -9,3 +9,4 @@ ac_add_options --enable-official-branding
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -21,3 +21,4 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -13,3 +13,4 @@ ac_add_options --enable-warnings-as-errors
ac_add_options --enable-clang-plugin
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -4,6 +4,6 @@ ac_add_options --with-l10n-base=../../l10n
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
ac_add_options --enable-update-packaging
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -19,3 +19,4 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -22,7 +22,6 @@ for platform in ['linux32', 'linux64', 'macosx-universal']:
for platform in ['linux32', 'linux64', 'macosx-universal', 'win32', 'win64']:
whitelist['nightly'][platform] += ['ac_add_options --enable-signmar']
whitelist['nightly'][platform] += ['ac_add_options --enable-js-diagnostics']
whitelist['nightly']['linux32'] += [
'CXX=$REAL_CXX',

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

@ -28,6 +28,5 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -4,11 +4,7 @@
ac_add_options --enable-signmar
ac_add_options --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -30,6 +30,5 @@ ac_add_options --with-branding=browser/branding/nightly
. $topsrcdir/build/win64/mozconfig.vs2013
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -5,11 +5,7 @@
ac_add_options --enable-signmar
ac_add_options --enable-profiling
# Nightlies only since this has a cost in performance
ac_add_options --enable-js-diagnostics
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -3,15 +3,10 @@
"clang_version": "r185949"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 72573411,
"digest": "491753968f34d1bd3c58280688349499a92f31a118eb6f28e86746be62615004370394b8e1b10d48dc3fba4bc6d4fbb4ce6c7dbc4fadb39447de9aa55573c58e",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
}
]

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

@ -3,15 +3,10 @@
"clang_version": "r183744"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 70206124,
"digest": "a6b8046bd9485f9387dcb1c14b8d442822f02b1caa61b653e8b6cfd96906deadfb4b29809f2cd2b71f919b321d97dd2ebec6020c15f6d485f1641c0f710a762f",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true,
}
]

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

@ -1,20 +1,16 @@
[
{
"size": 82,
"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz"
"filename": "gcc.tar.xz",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -3,15 +3,10 @@
"clang_version": "r200213"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 71282740,
"digest": "ee9edb1ef3afd9ab29e39565145545ad57e8d8d2538be4d822d7dbd64038f4529b0b287cecf48bf83def52a26ac2c6faa331686c3ad5e8b4ba4c22686ee0808f",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
}
]

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

@ -3,15 +3,10 @@
"clang_version": "r183744"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 70350828,
"digest": "6cd04e8ec44c6fef159349c22bd0476891e4a2d46479f9586283eaf3305e42f79c720d40dfec0e78d8899c1651189b12e285de60862ffd0612b0dac7a0c336c6",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
}
]

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

@ -1,20 +1,16 @@
[
{
"size": 82,
"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz"
"filename": "gcc.tar.xz",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -3,15 +3,10 @@
"clang_version": "r200213"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 58997296,
"digest": "9757d142142442c881b8d1eb31c2fe80e1979a858e6133473b5574a5a3b9cdaf9abed32b2e246b715c9f0eb0969103337918215fc491feae196219e8fb03f0b1",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
}
]

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

@ -3,21 +3,17 @@
"clang_version": "r183744"
},
{
"size": 88,
"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 59602619,
"digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -3,21 +3,17 @@
"clang_version": "r183744"
},
{
"size": 88,
"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 59602619,
"digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "clang.tar.bz2",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -6,15 +6,10 @@
"filename": "mozmake.exe"
},
{
"size": 176,
"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -6,15 +6,10 @@
"filename": "mozmake.exe"
},
{
"size": 176,
"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
"filename": "sccache.tar.bz2",
"unpack": true
}
]

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

@ -1886,6 +1886,12 @@ EventListeners.prototype = {
definitionSite = fetchedDefinitions.get(listener.function.actor);
} else if (listener.function.class == "Function") {
definitionSite = yield this._getDefinitionSite(listener.function);
if (!definitionSite) {
// We don't know where this listener comes from so don't show it in
// the UI as breaking on it doesn't work (bug 942899).
continue;
}
fetchedDefinitions.set(listener.function.actor, definitionSite);
}
listener.function.url = definitionSite;
@ -1926,8 +1932,10 @@ EventListeners.prototype = {
// Don't make this error fatal, because it would break the entire events pane.
const msg = "Error getting function definition site: " + aResponse.message;
DevToolsUtils.reportException("_getDefinitionSite", msg);
deferred.resolve(null);
} else {
deferred.resolve(aResponse.source.url);
}
deferred.resolve(aResponse.source.url);
});
return deferred.promise;

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

@ -235,6 +235,8 @@ skip-if = e10s && debug
skip-if = e10s && debug
[browser_dbg_event-listeners-03.js]
skip-if = e10s && debug
[browser_dbg_event-listeners-04.js]
skip-if = debug || e10s # debug bug 1142597, e10s bug 1146603.
[browser_dbg_file-reload.js]
skip-if = e10s && debug
[browser_dbg_function-display-name.js]
@ -351,7 +353,7 @@ skip-if = e10s && debug
[browser_dbg_promises-allocation-stack.js]
skip-if = e10s && debug
[browser_dbg_promises-chrome-allocation-stack.js]
skip-if = e10s && debug
skip-if = (e10s || os == "linux") && debug
[browser_dbg_reload-preferred-script-01.js]
skip-if = e10s && debug
[browser_dbg_reload-preferred-script-02.js]

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

@ -0,0 +1,43 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that event listeners are properly fetched even if one of the listeners
* don't have a Debugger.Source object (bug 942899).
*
* This test is skipped on debug and e10s builds for following reasons:
* - debug: requiring sdk/tabs causes memory leaks when new windows are opened
* in tests executed after this one. Bug 1142597.
* - e10s: tab.attach is not e10s safe and only works when add-on compatibility
* shims are in place. Bug 1146603.
*/
const TAB_URL = EXAMPLE_URL + "doc_event-listeners-01.html";
add_task(function* () {
let tab = yield addTab(TAB_URL);
// Create a sandboxed content script the Add-on SDK way. Inspired by bug
// 1145996.
let tabs = require('sdk/tabs');
let sdkTab = [...tabs].find(tab => tab.url === TAB_URL);
ok(sdkTab, "Add-on SDK found the loaded tab.");
info("Attaching an event handler via add-on sdk content scripts.");
let worker = sdkTab.attach({
contentScript: "document.body.addEventListener('click', e => alert(e))",
onError: ok.bind(this, false)
});
let [,, panel, win] = yield initDebugger(tab);
let gDebugger = panel.panelWin;
let fetched = waitForDebuggerEvents(panel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);
info("Scheduling event listener fetch.");
gDebugger.DebuggerController.Breakpoints.DOM.scheduleEventListenersFetch();
info("Waiting for updated event listeners to arrive.");
yield fetched;
ok(true, "The listener update did not hang.");
});

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

@ -34,6 +34,9 @@ support-files =
[browser_filter-editor-08.js]
[browser_filter-editor-09.js]
[browser_filter-editor-10.js]
[browser_filter-presets-01.js]
[browser_filter-presets-02.js]
[browser_filter-presets-03.js]
[browser_flame-graph-01.js]
[browser_flame-graph-02.js]
[browser_flame-graph-03a.js]

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

@ -68,7 +68,7 @@ add_task(function*() {
widget.setCssValue(cssValue);
if (cssValue === "none") {
const text = container.querySelector(".filters").textContent;
const text = container.querySelector("#filters").textContent;
ok(text.indexOf(L10N.getStr("emptyFilterList")) > -1,
"Contains |emptyFilterList| string when given value 'none'");
ok(text.indexOf(L10N.getStr("addUsingList")) > -1,

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

@ -17,7 +17,7 @@ add_task(function*() {
const initialValue = "blur(2px) contrast(200%) brightness(200%)";
let widget = new CSSFilterEditorWidget(container, initialValue);
const filters = widget.el.querySelector(".filters");
const filters = widget.el.querySelector("#filters");
function first() {
return filters.children[0];
}
@ -28,6 +28,7 @@ add_task(function*() {
return filters.children[2];
}
info("Test re-ordering neighbour filters");
widget._mouseDown({
target: first().querySelector("i"),
@ -67,7 +68,7 @@ add_task(function*() {
pageY: 0
});
widget._mouseMove({ pageY: -LIST_ITEM_HEIGHT * 5 });
ok(first().offsetTop >= boundaries.top,
ok(first().getBoundingClientRect().top >= boundaries.top,
"First filter should not move outside filter list");
widget._mouseUp();
@ -78,7 +79,7 @@ add_task(function*() {
pageY: 0
});
widget._mouseMove({ pageY: -LIST_ITEM_HEIGHT * 5 });
ok(last().offsetTop <= boundaries.bottom,
ok(last().getBoundingClientRect().bottom <= boundaries.bottom,
"Last filter should not move outside filter list");
widget._mouseUp();

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

@ -22,7 +22,7 @@ add_task(function*() {
const container = doc.querySelector("#container");
let widget = new CSSFilterEditorWidget(container, "grayscale(0%) url(test.svg)");
const filters = widget.el.querySelector(".filters");
const filters = widget.el.querySelector("#filters");
const grayscale = filters.children[0],
url = filters.children[1];

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

@ -22,7 +22,7 @@ add_task(function*() {
let widget = new CSSFilterEditorWidget(container, "none");
const select = widget.el.querySelector("select"),
add = widget.el.querySelector("button");
add = widget.el.querySelector("#add-filter");
const TEST_DATA = [
{
@ -62,7 +62,8 @@ add_task(function*() {
is(widget.getValueAt(index), `0${filter.unit}`,
`Should add ${filter.unit} to ${filter.type} filters`);
} else if (filter.placeholder) {
const input = widget.el.querySelector(`.filter:nth-child(${index + 1}) input`);
let i = index + 1;
const input = widget.el.querySelector(`.filter:nth-child(${i}) input`);
is(input.placeholder, filter.placeholder,
"Should set the appropriate placeholder for string-type filters");
}

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

@ -70,7 +70,7 @@ add_task(function*() {
// Triggers the specified keyCode and modifier key on
// first filter's input
function triggerKey(key, modifier) {
const filter = this.el.querySelector(".filters").children[0];
const filter = this.el.querySelector("#filters").children[0];
const input = filter.querySelector("input");
this._keyDown({

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

@ -20,7 +20,7 @@ add_task(function*() {
const container = doc.querySelector("#container");
const initialValue = "drop-shadow(rgb(0, 0, 0) 1px 1px 0px)";
let widget = new CSSFilterEditorWidget(container, initialValue);
widget.el.querySelector("input").setSelectionRange(13, 13);
widget.el.querySelector("#filters input").setSelectionRange(13, 13);
let value = 1;
@ -102,7 +102,7 @@ add_task(function*() {
// Triggers the specified keyCode and modifier key on
// first filter's input
function triggerKey(key, modifier) {
const filter = this.el.querySelector(".filters").children[0];
const filter = this.el.querySelector("#filters").children[0];
const input = filter.querySelector("input");
this._keyDown({

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

@ -20,7 +20,7 @@ add_task(function*() {
const container = doc.querySelector("#container");
const initialValue = "drop-shadow(rgb(0, 0, 0) 10px 1px 0px)";
let widget = new CSSFilterEditorWidget(container, initialValue);
const input = widget.el.querySelector("input");
const input = widget.el.querySelector("#filters input");
let value = 10;
@ -66,7 +66,7 @@ add_task(function*() {
// Triggers the specified keyCode and modifier key on
// first filter's input
function triggerKey(key, modifier) {
const filter = this.el.querySelector(".filters").children[0];
const filter = this.el.querySelector("#filters").children[0];
const input = filter.querySelector("input");
this._keyDown({

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

@ -0,0 +1,98 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests saving presets
const TEST_URI = "chrome://browser/content/devtools/filter-frame.xhtml";
const {CSSFilterEditorWidget} = require("devtools/shared/widgets/FilterWidget");
add_task(function* () {
yield promiseTab("about:blank");
let [host, win, doc] = yield createHost("bottom", TEST_URI);
const container = doc.querySelector("#container");
let widget = new CSSFilterEditorWidget(container, "none");
// First render
yield widget.once("render");
const VALUE = "blur(2px) contrast(150%)";
const NAME = "Test";
yield showFilterPopupPresetsAndCreatePreset(widget, NAME, VALUE);
let preset = widget.el.querySelector(".preset");
is(preset.querySelector("label").textContent, NAME,
"Should show preset name correctly");
is(preset.querySelector("span").textContent, VALUE,
"Should show preset value preview correctly");
let list = yield widget.getPresets();
let input = widget.el.querySelector(".presets-list .footer input");
let data = list[0];
is(data.name, NAME,
"Should add the preset to asyncStorage - name property");
is(data.value, VALUE,
"Should add the preset to asyncStorage - name property");
info("Test overriding preset by using the same name");
const VALUE_2 = "saturate(50%) brightness(10%)";
widget.setCssValue(VALUE_2);
yield savePreset(widget);
is(widget.el.querySelectorAll(".preset").length, 1,
"Should override the preset with the same name - render");
list = yield widget.getPresets();
data = list[0];
is(list.length, 1,
"Should override the preset with the same name - asyncStorage");
is(data.name, NAME,
"Should override the preset with the same name - prop name");
is(data.value, VALUE_2,
"Should override the preset with the same name - prop value");
yield widget.setPresets([]);
info("Test saving a preset without name");
input.value = "";
yield savePreset(widget, "preset-save-error");
list = yield widget.getPresets();
is(list.length, 0,
"Should not add a preset without name");
info("Test saving a preset without filters");
input.value = NAME;
widget.setCssValue("none");
yield savePreset(widget, "preset-save-error");
list = yield widget.getPresets();
is(list.length, 0,
"Should not add a preset without filters (value: none)");
});
/**
* Call savePreset on widget and wait for the specified event to emit
* @param {CSSFilterWidget} widget
* @param {string} expectEvent="render" The event to listen on
* @return {Promise}
*/
function savePreset(widget, expectEvent = "render") {
let onEvent = widget.once(expectEvent);
widget._savePreset({
preventDefault: () => {},
});
return onEvent;
}

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

@ -0,0 +1,44 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests loading presets
const TEST_URI = "chrome://browser/content/devtools/filter-frame.xhtml";
const {CSSFilterEditorWidget} = require("devtools/shared/widgets/FilterWidget");
add_task(function* () {
yield promiseTab("about:blank");
let [host, win, doc] = yield createHost("bottom", TEST_URI);
const container = doc.querySelector("#container");
let widget = new CSSFilterEditorWidget(container, "none");
// First render
yield widget.once("render");
const VALUE = "blur(2px) contrast(150%)";
const NAME = "Test";
yield showFilterPopupPresetsAndCreatePreset(widget, NAME, VALUE);
let onRender = widget.once("render");
// reset value
widget.setCssValue("saturate(100%) brightness(150%)");
yield onRender;
let preset = widget.el.querySelector(".preset");
onRender = widget.once("render");
widget._presetClick({
target: preset
});
yield onRender;
is(widget.getCssValue(), VALUE,
"Should set widget's value correctly");
is(widget.el.querySelector(".presets-list .footer input").value, NAME,
"Should set input's value to name");
});

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

@ -0,0 +1,39 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests deleting presets
const TEST_URI = "chrome://browser/content/devtools/filter-frame.xhtml";
const {CSSFilterEditorWidget} = require("devtools/shared/widgets/FilterWidget");
add_task(function* () {
yield promiseTab("about:blank");
let [host, win, doc] = yield createHost("bottom", TEST_URI);
const container = doc.querySelector("#container");
let widget = new CSSFilterEditorWidget(container, "none");
// First render
yield widget.once("render");
const NAME = "Test";
const VALUE = "blur(2px) contrast(150%)";
yield showFilterPopupPresetsAndCreatePreset(widget, NAME, VALUE);
let removeButton = widget.el.querySelector(".preset .remove-button");
let onRender = widget.once("render");
widget._presetClick({
target: removeButton
});
yield onRender;
is(widget.el.querySelector(".preset"), null,
"Should re-render after removing preset");
let list = yield widget.getPresets();
is(list.length, 0,
"Should remove presets from asyncStorage");
});

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

@ -283,3 +283,39 @@ function waitUntil(predicate, interval = 10) {
}, interval);
});
}
/**
* Show the presets list sidebar in the cssfilter widget popup
* @param {CSSFilterWidget} widget
* @return {Promise}
*/
function showFilterPopupPresets(widget) {
let onRender = widget.once("render");
widget._togglePresets();
return onRender;
}
/**
* Show presets list and create a sample preset with the name and value provided
* @param {CSSFilterWidget} widget
* @param {string} name
* @param {string} value
* @return {Promise}
*/
let showFilterPopupPresetsAndCreatePreset = Task.async(function*(widget, name, value) {
yield showFilterPopupPresets(widget);
let onRender = widget.once("render");
widget.setCssValue(value);
yield onRender;
let footer = widget.el.querySelector(".presets-list .footer");
footer.querySelector("input").value = name;
onRender = widget.once("render");
widget._savePreset({
preventDefault: () => {}
});
yield onRender;
});

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

@ -16,6 +16,9 @@ const STRINGS_URI = "chrome://browser/locale/devtools/filterwidget.properties";
const L10N = new ViewHelpers.L10N(STRINGS_URI);
const {cssTokenizer} = require("devtools/sourceeditor/css-tokenizer");
loader.lazyGetter(this, "asyncStorage",
() => require("devtools/toolkit/shared/async-storage"));
const DEFAULT_FILTER_TYPE = "length";
const UNIT_MAPPING = {
percentage: "%",
@ -116,31 +119,54 @@ function CSSFilterEditorWidget(el, value = "") {
this._mouseDown = this._mouseDown.bind(this);
this._keyDown = this._keyDown.bind(this);
this._input = this._input.bind(this);
this._presetClick = this._presetClick.bind(this);
this._savePreset = this._savePreset.bind(this);
this._togglePresets = this._togglePresets.bind(this);
// Passed to asyncStorage, requires binding
this.renderPresets = this.renderPresets.bind(this);
this._initMarkup();
this._buildFilterItemMarkup();
this._buildPresetItemMarkup();
this._addEventListeners();
EventEmitter.decorate(this);
this.filters = [];
this.setCssValue(value);
this.renderPresets();
}
exports.CSSFilterEditorWidget = CSSFilterEditorWidget;
CSSFilterEditorWidget.prototype = {
_initMarkup: function() {
const list = this.el.querySelector(".filters");
this.el.appendChild(list);
this.el.insertBefore(list, this.el.firstChild);
this.container = this.el;
this.list = list;
this.filtersList = this.el.querySelector("#filters");
this.presetsList = this.el.querySelector("#presets");
this.togglePresets = this.el.querySelector("#toggle-presets");
this.filterSelect = this.el.querySelector("select");
this.addPresetButton = this.el.querySelector(".presets-list .add");
this.addPresetInput = this.el.querySelector(".presets-list .footer input");
this.el.querySelector(".presets-list input").value = "";
this._populateFilterSelect();
},
_destroyMarkup: function() {
this._filterItemMarkup.remove();
this.el.remove();
this.el = this.filtersList = this._filterItemMarkup = null;
this.presetsList = this.togglePresets = this.filterSelect = null;
this.addPresetButton = null;
},
destroy: function() {
this._removeEventListeners();
this._destroyMarkup();
},
/**
* Creates <option> elements for each filter definition
* in filterList
@ -184,20 +210,42 @@ CSSFilterEditorWidget.prototype = {
let removeButton = this.doc.createElement("button");
removeButton.className = "remove-button";
value.appendChild(removeButton);
base.appendChild(name);
base.appendChild(value);
base.appendChild(removeButton);
this._filterItemMarkup = base;
},
_buildPresetItemMarkup: function() {
let base = this.doc.createElement("div");
base.classList.add("preset");
let name = this.doc.createElement("label");
base.appendChild(name);
let value = this.doc.createElement("span");
base.appendChild(value);
let removeButton = this.doc.createElement("button");
removeButton.classList.add("remove-button");
base.appendChild(removeButton);
this._presetItemMarkup = base;
},
_addEventListeners: function() {
this.addButton = this.el.querySelector("#add-filter");
this.addButton.addEventListener("click", this._addButtonClick);
this.list.addEventListener("click", this._removeButtonClick);
this.list.addEventListener("mousedown", this._mouseDown);
this.list.addEventListener("keydown", this._keyDown);
this.filtersList.addEventListener("click", this._removeButtonClick);
this.filtersList.addEventListener("mousedown", this._mouseDown);
this.filtersList.addEventListener("keydown", this._keyDown);
this.presetsList.addEventListener("click", this._presetClick);
this.togglePresets.addEventListener("click", this._togglePresets);
this.addPresetButton.addEventListener("click", this._savePreset);
// These events are event delegators for
// drag-drop re-ordering and label-dragging
@ -205,11 +253,29 @@ CSSFilterEditorWidget.prototype = {
this.win.addEventListener("mouseup", this._mouseUp);
// Used to workaround float-precision problems
this.list.addEventListener("input", this._input);
this.filtersList.addEventListener("input", this._input);
},
_removeEventListeners: function() {
this.addButton.removeEventListener("click", this._addButtonClick);
this.filtersList.removeEventListener("click", this._removeButtonClick);
this.filtersList.removeEventListener("mousedown", this._mouseDown);
this.filtersList.removeEventListener("keydown", this._keyDown);
this.presetsList.removeEventListener("click", this._presetClick);
this.togglePresets.removeEventListener("click", this._togglePresets);
this.addPresetButton.removeEventListener("click", this._savePreset);
// These events are used for drag drop re-ordering
this.win.removeEventListener("mousemove", this._mouseMove);
this.win.removeEventListener("mouseup", this._mouseUp);
// Used to workaround float-precision problems
this.filtersList.removeEventListener("input", this._input);
},
_getFilterElementIndex: function(el) {
return [...this.list.children].indexOf(el);
return [...this.filtersList.children].indexOf(el);
},
_keyDown: function(e) {
@ -297,7 +363,7 @@ CSSFilterEditorWidget.prototype = {
filterEl.startingY = e.pageY;
filterEl.classList.add("dragging");
this.container.classList.add("dragging");
this.el.classList.add("dragging");
// label-dragging
} else if (e.target.classList.contains("devtools-draglabel")) {
let label = e.target,
@ -357,7 +423,7 @@ CSSFilterEditorWidget.prototype = {
},
_dragFilterElement: function(e) {
const rect = this.list.getBoundingClientRect(),
const rect = this.filtersList.getBoundingClientRect(),
top = e.pageY - LIST_PADDING,
bottom = e.pageY + LIST_PADDING;
// don't allow dragging over top/bottom of list
@ -365,7 +431,7 @@ CSSFilterEditorWidget.prototype = {
return;
}
const filterEl = this.list.querySelector(".dragging");
const filterEl = this.filtersList.querySelector(".dragging");
const delta = e.pageY - filterEl.startingY;
filterEl.style.top = delta + "px";
@ -376,7 +442,7 @@ CSSFilterEditorWidget.prototype = {
change = change > 0 ? Math.floor(change) :
change < 0 ? Math.ceil(change) : change;
const children = this.list.children;
const children = this.filtersList.children;
const index = [...children].indexOf(filterEl);
const destination = index + change;
@ -392,9 +458,9 @@ CSSFilterEditorWidget.prototype = {
const target = change > 0 ? children[destination + 1]
: children[destination];
if (target) {
this.list.insertBefore(filterEl, target);
this.filtersList.insertBefore(filterEl, target);
} else {
this.list.appendChild(filterEl);
this.filtersList.appendChild(filterEl);
}
filterEl.removeAttribute("style");
@ -442,30 +508,83 @@ CSSFilterEditorWidget.prototype = {
if (!this.isReorderingFilter) {
return;
}
let filterEl = this.list.querySelector(".dragging");
let filterEl = this.filtersList.querySelector(".dragging");
this.isReorderingFilter = false;
filterEl.classList.remove("dragging");
this.container.classList.remove("dragging");
this.el.classList.remove("dragging");
filterEl.removeAttribute("style");
this.emit("updated", this.getCssValue());
this.render();
},
_presetClick: function(e) {
let el = e.target;
let preset = el.closest(".preset");
if (!preset) {
return;
}
let id = +preset.dataset.id;
this.getPresets().then(presets => {
if (el.classList.contains("remove-button")) {
// If the click happened on the remove button.
presets.splice(id, 1);
this.setPresets(presets).then(this.renderPresets, Cu.reportError);
} else {
// Or if the click happened on a preset.
let p = presets[id];
this.setCssValue(p.value);
this.addPresetInput.value = p.name;
}
}, Cu.reportError);
},
_togglePresets: function() {
this.el.classList.toggle("show-presets");
this.emit("render");
},
_savePreset: function(e) {
e.preventDefault();
let name = this.addPresetInput.value,
value = this.getCssValue();
if (!name || !value || value === "none") {
this.emit("preset-save-error");
return;
}
this.getPresets().then(presets => {
let index = presets.findIndex(preset => preset.name === name);
if (index > -1) {
presets[index].value = value;
} else {
presets.push({name, value});
}
this.setPresets(presets).then(this.renderPresets, Cu.reportError);
}, Cu.reportError);
},
/**
* Clears the list and renders filters, binding required events.
* There are some delegated events bound in _addEventListeners method
*/
render: function() {
if (!this.filters.length) {
this.list.innerHTML = `<p> ${L10N.getStr("emptyFilterList")} <br />
this.filtersList.innerHTML = `<p> ${L10N.getStr("emptyFilterList")} <br />
${L10N.getStr("addUsingList")} </p>`;
this.emit("render");
return;
}
this.list.innerHTML = "";
this.filtersList.innerHTML = "";
let base = this._filterItemMarkup;
@ -515,19 +634,48 @@ CSSFilterEditorWidget.prototype = {
unitPreview.remove();
}
this.list.appendChild(el);
this.filtersList.appendChild(el);
}
let el = this.list.querySelector(`.filter:last-of-type input`);
if (el) {
el.focus();
let lastInput = this.filtersList.querySelector(`.filter:last-of-type input`);
if (lastInput) {
lastInput.focus();
// move cursor to end of input
el.setSelectionRange(el.value.length, el.value.length);
const end = lastInput.value.length;
lastInput.setSelectionRange(end, end);
}
this.emit("render");
},
renderPresets: function() {
this.getPresets().then(presets => {
if (!presets || !presets.length) {
this.presetsList.innerHTML = `<p>${L10N.getStr("emptyPresetList")}</p>`;
this.emit("render");
return;
}
let base = this._presetItemMarkup;
this.presetsList.innerHTML = "";
for (let [index, preset] of presets.entries()) {
let el = base.cloneNode(true);
let [label, span] = el.children;
el.dataset.id = index;
label.textContent = preset.name;
span.textContent = preset.value;
this.presetsList.appendChild(el);
}
this.emit("render");
});
},
/**
* returns definition of a filter as defined in filterList
*
@ -689,29 +837,19 @@ CSSFilterEditorWidget.prototype = {
this.emit("updated", this.getCssValue());
},
_removeEventListeners: function() {
this.addButton.removeEventListener("click", this._addButtonClick);
this.list.removeEventListener("click", this._removeButtonClick);
this.list.removeEventListener("mousedown", this._mouseDown);
this.list.removeEventListener("keydown", this._keyDown);
getPresets: function() {
return asyncStorage.getItem("cssFilterPresets").then(presets => {
if (!presets) {
return [];
}
// These events are used for drag drop re-ordering
this.win.removeEventListener("mousemove", this._mouseMove);
this.win.removeEventListener("mouseup", this._mouseUp);
// Used to workaround float-precision problems
this.list.removeEventListener("input", this._input);
return presets;
}, Cu.reportError);
},
_destroyMarkup: function() {
this._filterItemMarkup.remove();
this.el.remove();
this.el = this.list = this.container = this._filterItemMarkup = null;
},
destroy: function() {
this._removeEventListeners();
this._destroyMarkup();
setPresets: function(presets) {
return asyncStorage.setItem("cssFilterPresets", presets)
.catch(Cu.reportError);
}
};

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

@ -863,8 +863,9 @@ Tooltip.prototype = {
* that resolves to the instance of the widget when ready.
*/
setFilterContent: function(filter) {
let dimensions = {width: "350", height: "350"};
let dimensions = {width: "500", height: "200"};
let panel = this.panel;
return this.setIFrameContent(dimensions, FILTER_FRAME).then(onLoaded);
function onLoaded(iframe) {
@ -874,14 +875,8 @@ Tooltip.prototype = {
let container = win.document.getElementById("container");
let widget = new CSSFilterEditorWidget(container, filter);
iframe.height = doc.offsetHeight;
widget.on("render", () => {
iframe.height = doc.offsetHeight;
});
// Resolve to the widget instance whenever the popup becomes visible
if (panel.state == "open") {
if (panel.state === "open") {
def.resolve(widget);
} else {
panel.addEventListener("popupshown", function shown() {

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

@ -16,14 +16,26 @@
<body>
<div id="container">
<div class="filters">
<div class="filters-list">
<div id="filters"></div>
<div class="footer">
<select value="">
<option value="">&filterListSelectPlaceholder;</option>
</select>
<button id="add-filter" class="add">&addNewFilterButton;</button>
<button id="toggle-presets">&presetsToggleButton;</button>
</div>
</div>
<div id="editor-footer">
<select value="">
<option value="">&filterListSelectPlaceholder;</option>
</select>
<button id="add-filter">&addNewFilterButton;</button>
<div class="presets-list">
<div id="presets"></div>
<div class="footer">
<input value="" class="devtools-textinput"
placeholder="&newPresetPlaceholder;"></input>
<button class="add">&savePresetButton;</button>
</div>
</div>
</div>
</body>
</html>

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

@ -2,74 +2,103 @@
* 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/. */
#container {
color: var(--theme-body-color);
padding: 5px;
html, body {
height: 100%;
margin: 0;
overflow: hidden;
font: message-box;
color: var(--theme-body-color);
}
/* Main container: Displays the filters and presets in 2 columns */
#container {
height: 100%;
display: flex;
position: relative;
}
#container.dragging {
-moz-user-select: none;
}
.theme-light #add-filter,
.theme-light .remove-button {
filter: invert(1);
}
.filter {
.filters-list,
.presets-list {
display: flex;
margin-bottom: 10px;
flex-direction: column;
box-sizing: border-box;
}
.filters-list {
/* Allow the filters list to take the full width when the presets list is
hidden */
flex-grow: 1;
padding: 0 6px;
}
.presets-list {
/* Make sure that when the presets list is shown, it has a fixed width */
width: 200px;
padding-left: 6px;
transition: width .1s;
flex-shrink: 0;
border-left: 1px solid var(--theme-splitter-color);
}
.presets-list .add {
margin-top: 4px;
}
#container:not(.show-presets) .presets-list {
width: 0;
border-left: none;
padding-left: 0;
}
#container.show-presets .filters-list {
width: 300px;
}
/* The list of filters and list of presets should push their footers to the
bottom, so they can take as much space as there is */
#filters,
#presets {
flex-grow: 1;
/* Avoid pushing below the tooltip's area */
overflow-y: auto;
}
/* The filters and presets list both have footers displayed at the bottom.
These footers have some input (taking up as much space as possible) and an
add button next */
.footer {
display: flex;
margin: 10px 3px;
}
.footer :not(button) {
flex-grow: 1;
margin-right: 3px;
}
/* Styles for 1 filter function item */
.filter,
.filter-name,
.filter-value {
display: flex;
align-items: center;
}
.filter {
margin: 5px 0;
}
.filter-name {
padding-right: 10px;
flex: 1;
}
.filter-value {
min-width: 150px;
flex: 2;
}
.remove-button {
width: 16px;
height: 16px;
background: url(chrome://browser/skin/devtools/close@2x.png);
background-size: 16px;
font-size: 0;
border: none;
cursor: pointer;
}
/* drag/drop handle */
#container i {
width: 10px;
margin-right: 15px;
padding: 10px 0;
cursor: grab;
}
#container i::before {
content: '';
display: block;
width: 10px;
height: 1px;
background: currentColor;
box-shadow: 0 3px 0 0 currentColor,
0 -3px 0 0 currentColor;
}
#container .dragging {
position: relative;
z-index: 1;
cursor: grab;
width: 120px;
margin-right: 10px;
}
.filter-name label {
@ -81,14 +110,105 @@
cursor: ew-resize;
}
/* drag/drop handle */
.filter-name i {
width: 10px;
height: 10px;
margin-right: 10px;
cursor: grab;
background: linear-gradient(to bottom,
currentColor 0,
currentcolor 1px,
transparent 1px,
transparent 2px);
background-repeat: repeat-y;
background-size: auto 4px;
background-position: 0 1px;
}
.filter-value {
min-width: 150px;
margin-right: 10px;
flex: 1;
}
.filter-value input {
min-width: 50%;
flex-grow: 1;
}
.filter-value span {
max-width: 20px;
width: 20px;
.theme-light .add,
.theme-light .remove-button {
filter: invert(1);
}
.preset {
display: flex;
margin-bottom: 10px;
cursor: pointer;
padding: 3px 5px;
flex-direction: row;
flex-wrap: wrap;
}
.preset label,
.preset span {
display: flex;
align-items: center;
}
.preset label {
flex: 1 0;
cursor: pointer;
color: var(--theme-body-color);
}
.preset:hover {
background: var(--theme-selection-background);
}
.preset:hover label, .preset:hover span {
color: var(--theme-selection-color);
}
.theme-light .preset:hover .remove-button {
filter: invert(0);
}
.preset .remove-button {
order: 2;
}
.preset span {
flex: 2 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
order: 3;
color: var(--theme-body-color-alt);
}
.remove-button {
width: 16px;
height: 16px;
background: url(chrome://browser/skin/devtools/close@2x.png);
background-size: cover;
font-size: 0;
border: none;
cursor: pointer;
}
.hidden {
display: none !important;
}
#container .dragging {
position: relative;
z-index: 10;
cursor: grab;
}
/* message shown when there's no filter specified */
@ -97,20 +217,7 @@
line-height: 20px;
}
#editor-footer {
display: flex;
justify-content: flex-end;
}
#editor-footer select {
flex-grow: 1;
box-sizing: border-box;
font: inherit;
margin: 0 3px;
}
#add-filter {
-moz-appearance: none;
.add {
background: url(chrome://browser/skin/devtools/add.svg);
background-size: cover;
border: none;

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

@ -18,7 +18,6 @@ const overlays = require("devtools/styleinspector/style-inspector-overlays");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/devtools/Templater.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@ -221,37 +220,6 @@ CssHtmlTree.l10n = function CssHtmlTree_l10n(aName)
}
};
/**
* Clone the given template node, and process it by resolving ${} references
* in the template.
*
* @param {nsIDOMElement} aTemplate the template note to use.
* @param {nsIDOMElement} aDestination the destination node where the
* processed nodes will be displayed.
* @param {object} aData the data to pass to the template.
* @param {Boolean} aPreserveDestination If true then the template will be
* appended to aDestination's content else aDestination.innerHTML will be
* cleared before the template is appended.
*/
CssHtmlTree.processTemplate = function CssHtmlTree_processTemplate(aTemplate,
aDestination, aData, aPreserveDestination)
{
if (!aPreserveDestination) {
aDestination.innerHTML = "";
}
// All the templater does is to populate a given DOM tree with the given
// values, so we need to clone the template first.
let duplicated = aTemplate.cloneNode(true);
// See https://github.com/mozilla/domtemplate/blob/master/README.md
// for docs on the template() function
template(duplicated, aData, { allowEval: true });
while (duplicated.firstChild) {
aDestination.appendChild(duplicated.firstChild);
}
};
XPCOMUtils.defineLazyGetter(CssHtmlTree, "_strings", function() {
return Services.strings.createBundle(
"chrome://global/locale/devtools/styleinspector.properties");
@ -1407,6 +1375,7 @@ PropertyView.prototype = {
promises.push(selector.ready);
}
this.matchedSelectorsContainer.innerHTML = "";
this.matchedSelectorsContainer.appendChild(frag);
return promise.all(promises);
},

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

@ -436,7 +436,8 @@
@RESPATH@/components/addoncompat.manifest
@RESPATH@/components/multiprocessShims.js
@RESPATH@/components/defaultShims.js
@RESPATH@/components/remoteTagService.js
@RESPATH@/components/utils.manifest
@RESPATH@/components/simpleServices.js
@RESPATH@/components/pluginGlue.manifest
@RESPATH@/components/ProcessSingleton.manifest
@RESPATH@/components/MainProcessSingleton.js
@ -888,6 +889,8 @@ bin/libfreebl_32int64_3.so
@RESPATH@/components/DataStoreImpl.js
@RESPATH@/components/dom_datastore.xpt
@RESPATH@/components/dom_audiochannel.xpt
; Shutdown Terminator
@RESPATH@/components/nsTerminatorTelemetry.js
@RESPATH@/components/terminator.manifest

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