Merge b2ginbound to central, a=merge
authorWes Kocher <wkocher@mozilla.com>
Wed, 07 Oct 2015 11:04:26 -0700
changeset 266583 1e1fa696e2b626ead6817b7c5bd871fec5d5ab5a
parent 266568 49d87bbe0122d894c8e45f0b409c42dfe1c36737 (current diff)
parent 266582 fd27291437bf1a69ae11cbe50426a0e856e2085a (diff)
child 266584 c6ede6f30f3dc886543bb1c76fd7c8b5a151786b
child 266596 d91b3618f990fce14d8459fd2a6822ea6a4353c6
child 266634 eb3424a2e2856a7a1302e28dcfabcee70773272b
child 266705 2499a66d5b37595ec35063b0a6c3d7ed1a9cf154
push id29494
push userkwierso@gmail.com
push dateWed, 07 Oct 2015 18:04:30 +0000
treeherdermozilla-central@1e1fa696e2b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge b2ginbound to central, a=merge
caps/BasePrincipal.cpp
dom/telephony/Telephony.cpp
dom/telephony/Telephony.h
dom/telephony/TelephonyCall.cpp
dom/telephony/TelephonyCall.h
dom/telephony/TelephonyCallGroup.cpp
dom/telephony/TelephonyCallGroup.h
dom/telephony/TelephonyDialCallback.cpp
dom/telephony/gonk/TelephonyService.js
dom/tv/TVTuner.cpp
--- a/b2g/chrome/content/content.css
+++ b/b2g/chrome/content/content.css
@@ -120,17 +120,17 @@ xul|button,
 select[size],
 select[multiple],
 select[size][multiple],
 textarea,
 * > input:not([type="image"]) {
   border-style: solid;
   border-color: #7d7d7d;
   color: #414141;
-  background: white linear-gradient(rgba(115,115,115,0.5) 0, rgba(215,215,215,0.5) 3px, rgba(255,255,255,0.2) 16px);
+  background-color: white;
 }
 
 /* Selects are handled by the form helper, see bug 685197 */
 select option, select optgroup {
   pointer-events: none;
 }
 
 select:not([size]):not([multiple]),
@@ -142,21 +142,21 @@ select[size="1"],
 button {
   border-style: solid;
   border-color: #7d7d7d;
   color: #414141;
   background: white linear-gradient(rgba(255,255,255,0.2) 0, rgba(215,215,215,0.5) 18px, rgba(115,115,115,0.5) 100%);
 }
 
 input[type="checkbox"] {
-  background: white linear-gradient(rgba(115,115,115,0.5) 0, rgba(215,215,215,0.5) 2px, rgba(255,255,255,0.2) 6px);
+  background-color: white;
 }
 
 input[type="radio"] {
-  background: radial-gradient(at 6px 6px, rgba(255,255,255,0.2) 3px, rgba(195,195,195,0.5) 5px, rgba(115,115,115,0.5) 100%);
+  background-color: white;
 }
 
 select {
   border-width: 1px;
   padding: 1px;
 }
 
 select:not([size]):not([multiple]),
@@ -221,17 +221,17 @@ select[size]:focus,
 select[multiple]:focus,
 select[size][multiple]:focus,
 textarea:focus,
 input[type="file"]:focus > input[type="text"],
 * > input:not([type="image"]):focus {
   outline: 0px !important;
   border-style: solid;
   border-color: rgb(94,128,153);
-  background: white linear-gradient(rgba(27,113,177,0.5) 0, rgba(198,225,246,0.2) 3px, rgba(255,255,255,0.2) 16px);
+  background-color: white;
 }
 
 select:not([size]):not([multiple]):focus,
 select[size="0"]:focus,
 select[size="1"]:focus,
 input[type="button"]:focus,
 input[type="submit"]:focus,
 input[type="reset"]:focus,
@@ -242,56 +242,48 @@ button:focus {
   background: white linear-gradient(rgba(255,255,255,0.2) 0, rgba(198,225,256,0.2) 18px, rgba(27,113,177,0.5) 100%);
 }
 
 input[type="checkbox"]:focus,
 input[type="radio"]:focus {
   border-color: #99c6e0 !important;
 }
 
-input[type="checkbox"]:focus {
-  background: white linear-gradient(rgba(27,113,177,0.5) 0, rgba(198,225,246,0.2) 2px, rgba(255,255,255,0.2) 6px);
-}
-
-input[type="radio"]:focus {
-  background: radial-gradient(at 6px 6px, rgba(255,255,255,0.2) 3px, rgba(198,225,246,0.2) 5px, rgba(27,113,177,0.5) 100%);
-}
-
 /* we need to be specific for selects because the above rules are specific too */
 textarea[disabled],
 select[size][disabled],
 select[multiple][disabled],
 select[size][multiple][disabled],
 select:not([size]):not([multiple])[disabled],
 select[size="0"][disabled],
 select[size="1"][disabled],
 button[disabled],
 * > input:not([type="image"])[disabled] {
   color: rgba(0,0,0,0.3);
   border-color: rgba(125,125,125,0.4);
   border-style: solid;
   border-width: 1px;
-  background: transparent linear-gradient(rgba(185,185,185,0.4) 0, rgba(235,235,235,0.4) 3px, rgba(255,255,255,0.4) 100%);
+  background-color: #f5f5f5;
 }
 
 select:not([size]):not([multiple])[disabled],
 select[size="0"][disabled],
 select[size="1"][disabled] {
-  background: transparent linear-gradient(rgba(255,255,255,0.4) 0, rgba(235,235,235,0.4) 3px, rgba(185,185,185,0.4) 100%);
+  background-color: #f5f5f5;
 }
 
 input[type="button"][disabled],
 input[type="submit"][disabled],
 input[type="reset"][disabled],
 button[disabled] {
   -moz-padding-start: 7px;
   -moz-padding-end: 7px;
   padding-block-start: 0;
   padding-block-end: 0;
-  background: transparent linear-gradient(rgba(255,255,255,0.4) 0, rgba(235,235,235,0.4) 3px, rgba(185,185,185,0.4) 100%);
+  background-color: #f5f5f5;
 }
 
 input[type="radio"][disabled],
 input[type="radio"][disabled]:active,
 input[type="radio"][disabled]:hover,
 input[type="radio"][disabled]:hover:active,
 input[type="checkbox"][disabled],
 input[type="checkbox"][disabled]:active,
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="065f6361461030d32c6dc08d716b013bfadab1d9"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="065f6361461030d32c6dc08d716b013bfadab1d9"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "77d463a009a1425e413edaae92b237e116708560", 
+        "git_revision": "b99837aa2294348317bcae68acabe71d9a83d774", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "c00c454a571f087579b93184b878363351844ae2", 
+    "revision": "cd2549520049a8532b966d3edda167f7bc444fba", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -13,17 +13,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="77d463a009a1425e413edaae92b237e116708560"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="b99837aa2294348317bcae68acabe71d9a83d774"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/caps/BasePrincipal.cpp
+++ b/caps/BasePrincipal.cpp
@@ -115,20 +115,20 @@ public:
     MOZ_ASSERT(aOriginAttributes);
   }
 
   bool URLParamsIterator(const nsString& aName,
                          const nsString& aValue) override
   {
     if (aName.EqualsLiteral("appId")) {
       nsresult rv;
-      mOriginAttributes->mAppId = aValue.ToInteger(&rv);
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return false;
-      }
+      int64_t val  = aValue.ToInteger64(&rv);
+      NS_ENSURE_SUCCESS(rv, false);
+      NS_ENSURE_TRUE(val <= UINT32_MAX, false);
+      mOriginAttributes->mAppId = static_cast<uint32_t>(val);
 
       return true;
     }
 
     if (aName.EqualsLiteral("inBrowser")) {
       if (!aValue.EqualsLiteral("1")) {
         return false;
       }
@@ -140,20 +140,20 @@ public:
     if (aName.EqualsLiteral("addonId")) {
       MOZ_RELEASE_ASSERT(mOriginAttributes->mAddonId.IsEmpty());
       mOriginAttributes->mAddonId.Assign(aValue);
       return true;
     }
 
     if (aName.EqualsLiteral("userContextId")) {
       nsresult rv;
-      mOriginAttributes->mUserContextId = aValue.ToInteger(&rv);
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return false;
-      }
+      int64_t val  = aValue.ToInteger64(&rv);
+      NS_ENSURE_SUCCESS(rv, false);
+      NS_ENSURE_TRUE(val <= UINT32_MAX, false);
+      mOriginAttributes->mUserContextId  = static_cast<uint32_t>(val);
 
       return true;
     }
 
     if (aName.EqualsLiteral("signedPkg")) {
       MOZ_RELEASE_ASSERT(mOriginAttributes->mSignedPkg.IsEmpty());
       mOriginAttributes->mSignedPkg.Assign(aValue);
       return true;
--- a/caps/moz.build
+++ b/caps/moz.build
@@ -44,11 +44,14 @@ UNIFIED_SOURCES += [
 ]
 
 LOCAL_INCLUDES += [
     '/docshell/base',
     '/dom/base',
     '/js/xpconnect/src',
 ]
 
+if CONFIG['ENABLE_TESTS']:
+    DIRS += ['tests/gtest']
+
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
new file mode 100644
--- /dev/null
+++ b/caps/tests/gtest/TestOriginAttributes.cpp
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "gtest/gtest.h"
+#include "mozilla/BasePrincipal.h"
+
+using mozilla::OriginAttributes;
+
+static void
+TestSuffix(const OriginAttributes& attrs)
+{
+  nsAutoCString suffix;
+  attrs.CreateSuffix(suffix);
+
+  OriginAttributes attrsFromSuffix;
+  attrsFromSuffix.PopulateFromSuffix(suffix);
+
+  EXPECT_EQ(attrs, attrsFromSuffix);
+}
+
+TEST(OriginAttributes, Suffix_default)
+{
+  OriginAttributes attrs;
+  TestSuffix(attrs);
+}
+
+TEST(OriginAttributes, Suffix_appId_inBrowser)
+{
+  OriginAttributes attrs(1, true);
+  TestSuffix(attrs);
+}
+
+TEST(OriginAttributes, Suffix_maxAppId_inBrowser)
+{
+  OriginAttributes attrs(4294967295, true);
+  TestSuffix(attrs);
+}
new file mode 100644
--- /dev/null
+++ b/caps/tests/gtest/moz.build
@@ -0,0 +1,13 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+UNIFIED_SOURCES += [
+    'TestOriginAttributes.cpp'
+]
+
+include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'xul-gtest'
--- a/dom/telephony/Telephony.cpp
+++ b/dom/telephony/Telephony.cpp
@@ -161,37 +161,29 @@ Telephony::GetNumServices() {
 
 // static
 bool
 Telephony::IsValidServiceId(uint32_t aServiceId)
 {
   return aServiceId < GetNumServices();
 }
 
-// static
-bool
-Telephony::IsActiveState(uint16_t aCallState) {
-  return aCallState == nsITelephonyService::CALL_STATE_DIALING ||
-      aCallState == nsITelephonyService::CALL_STATE_ALERTING ||
-      aCallState == nsITelephonyService::CALL_STATE_CONNECTED;
-}
-
 uint32_t
 Telephony::GetServiceId(const Optional<uint32_t>& aServiceId,
                         bool aGetIfActiveCall)
 {
   if (aServiceId.WasPassed()) {
     return aServiceId.Value();
   } else if (aGetIfActiveCall) {
     nsTArray<nsRefPtr<TelephonyCall> > &calls = mCalls;
-    if (mGroup->CallState() == nsITelephonyService::CALL_STATE_CONNECTED) {
+    if (mGroup->IsActive()) {
       calls = mGroup->CallsArray();
     }
     for (uint32_t i = 0; i < calls.Length(); i++) {
-      if (IsActiveState(calls[i]->CallState())) {
+      if (calls[i]->IsActive()) {
         return calls[i]->mServiceId;
       }
     }
   }
 
   uint32_t serviceId = 0;
   mService->GetDefaultServiceId(&serviceId);
   return serviceId;
@@ -252,27 +244,27 @@ Telephony::CreateCallId(const nsAString&
     new TelephonyCallId(GetOwner(), aNumber, aNumberPresentation,
                         aName, aNamePresentation);
 
   return id.forget();
 }
 
 already_AddRefed<TelephonyCall>
 Telephony::CreateCall(TelephonyCallId* aId, uint32_t aServiceId,
-                      uint32_t aCallIndex, uint16_t aCallState,
+                      uint32_t aCallIndex, TelephonyCallState aState,
                       bool aEmergency, bool aConference,
                       bool aSwitchable, bool aMergeable)
 {
   // We don't have to create an already ended call.
-  if (aCallState == nsITelephonyService::CALL_STATE_DISCONNECTED) {
+  if (aState == TelephonyCallState::Disconnected) {
     return nullptr;
   }
 
   nsRefPtr<TelephonyCall> call =
-    TelephonyCall::Create(this, aId, aServiceId, aCallIndex, aCallState,
+    TelephonyCall::Create(this, aId, aServiceId, aCallIndex, aState,
                           aEmergency, aConference, aSwitchable, aMergeable);
 
   NS_ASSERTION(call, "This should never fail!");
   NS_ASSERTION(aConference ? mGroup->CallsArray().Contains(call)
                            : mCalls.Contains(call),
                "Should have auto-added new call!");
 
   return call.forget();
@@ -333,71 +325,76 @@ Telephony::HandleCallInfo(nsITelephonyCa
   aInfo->GetClientId(&serviceId);
   aInfo->GetCallIndex(&callIndex);
   aInfo->GetCallState(&callState);
   aInfo->GetIsEmergency(&isEmergency);
   aInfo->GetIsConference(&isConference);
   aInfo->GetIsSwitchable(&isSwitchable);
   aInfo->GetIsMergeable(&isMergeable);
 
+  TelephonyCallState state = TelephonyCall::ConvertToTelephonyCallState(callState);
+
   nsRefPtr<TelephonyCall> call = GetCallFromEverywhere(serviceId, callIndex);
-
+  // Handle a newly created call.
   if (!call) {
     nsRefPtr<TelephonyCallId> id = CreateCallId(aInfo);
-    call = CreateCall(id, serviceId, callIndex, callState, isEmergency,
+    call = CreateCall(id, serviceId, callIndex, state, isEmergency,
                       isConference, isSwitchable, isMergeable);
-
-    if (call && callState == nsITelephonyService::CALL_STATE_INCOMING) {
+    // The newly created call is an incoming call.
+    if (call &&
+        state == TelephonyCallState::Incoming) {
       nsresult rv = DispatchCallEvent(NS_LITERAL_STRING("incoming"), call);
       NS_ENSURE_SUCCESS(rv, rv);
     }
-  } else {
-    call->UpdateEmergency(isEmergency);
-    call->UpdateSwitchable(isSwitchable);
-    call->UpdateMergeable(isMergeable);
+    return NS_OK;
+  } 
 
-    nsAutoString number;
-    aInfo->GetNumber(number);
-    nsRefPtr<TelephonyCallId> id = call->Id();
-    id->UpdateNumber(number);
-
-    nsAutoString disconnectedReason;
-    aInfo->GetDisconnectedReason(disconnectedReason);
+  // Update an existing call
+  call->UpdateEmergency(isEmergency);
+  call->UpdateSwitchable(isSwitchable);
+  call->UpdateMergeable(isMergeable);
 
-    // State changed.
-    if (call->CallState() != callState) {
-      if (callState == nsITelephonyService::CALL_STATE_DISCONNECTED) {
-        call->UpdateDisconnectedReason(disconnectedReason);
-        call->ChangeState(nsITelephonyService::CALL_STATE_DISCONNECTED);
-        return NS_OK;
-      }
+  nsAutoString number;
+  aInfo->GetNumber(number);
+  nsRefPtr<TelephonyCallId> id = call->Id();
+  id->UpdateNumber(number);
 
-      // We don't fire the statechange event on a call in conference here.
-      // Instead, the event will be fired later in
-      // TelephonyCallGroup::ChangeState(). Thus the sequence of firing the
-      // statechange events is guaranteed: first on TelephonyCallGroup then on
-      // individual TelephonyCall objects.
-      bool fireEvent = !isConference;
-      call->ChangeStateInternal(callState, fireEvent);
+  nsAutoString disconnectedReason;
+  aInfo->GetDisconnectedReason(disconnectedReason);
+
+  // State changed.
+  if (call->State() != state) {
+    if (state == TelephonyCallState::Disconnected) {
+      call->UpdateDisconnectedReason(disconnectedReason);
+      call->ChangeState(TelephonyCallState::Disconnected);
+      return NS_OK;
     }
 
-    // Group changed.
-    nsRefPtr<TelephonyCallGroup> group = call->GetGroup();
+    // We don't fire the statechange event on a call in conference here.
+    // Instead, the event will be fired later in
+    // TelephonyCallGroup::ChangeState(). Thus the sequence of firing the
+    // statechange events is guaranteed: first on TelephonyCallGroup then on
+    // individual TelephonyCall objects.
+    bool fireEvent = !isConference;
+    call->ChangeStateInternal(state, fireEvent);
+  }
 
-    if (!group && isConference) {
-      // Add to conference.
-      NS_ASSERTION(mCalls.Contains(call), "Should in mCalls");
-      mGroup->AddCall(call);
-      RemoveCall(call);
-    } else if (group && !isConference) {
-      // Remove from conference.
-      NS_ASSERTION(mGroup->CallsArray().Contains(call), "Should in mGroup");
-      mGroup->RemoveCall(call);
-      AddCall(call);
-    }
+  // Group changed.
+  nsRefPtr<TelephonyCallGroup> group = call->GetGroup();
+
+  if (!group && isConference) {
+    // Add to conference.
+    NS_ASSERTION(mCalls.Contains(call), "Should in mCalls");
+    mGroup->AddCall(call);
+    RemoveCall(call);
+  } else if (group && !isConference) {
+    // Remove from conference.
+    NS_ASSERTION(mGroup->CallsArray().Contains(call), "Should in mGroup");
+    mGroup->RemoveCall(call);
+    AddCall(call);
   }
 
   return NS_OK;
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(Telephony)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(Telephony,
@@ -618,28 +615,31 @@ void
 Telephony::SetSpeakerEnabled(bool aEnabled, ErrorResult& aRv)
 {
   aRv = mService->SetSpeakerEnabled(aEnabled);
 }
 
 void
 Telephony::GetActive(Nullable<OwningTelephonyCallOrTelephonyCallGroup>& aValue)
 {
-  if (mGroup->CallState() == nsITelephonyService::CALL_STATE_CONNECTED) {
+  if (mGroup->IsActive()) {
     aValue.SetValue().SetAsTelephonyCallGroup() = mGroup;
-  } else {
-    // Search the first active call.
-    for (uint32_t i = 0; i < mCalls.Length(); i++) {
-      if (IsActiveState(mCalls[i]->CallState())) {
-        aValue.SetValue().SetAsTelephonyCall() = mCalls[i];
-        return;
-      }
+    return;
+  }
+
+  // Search for the active call.
+  for (uint32_t i = 0; i < mCalls.Length(); i++) {
+    if (mCalls[i]->IsActive()) {
+      aValue.SetValue().SetAsTelephonyCall() = mCalls[i];
+      return;
     }
-    aValue.SetNull();
   }
+
+  // Nothing active found.
+  aValue.SetNull();
 }
 
 already_AddRefed<CallsList>
 Telephony::Calls() const
 {
   nsRefPtr<CallsList> list = mCallsList;
   return list.forget();
 }
@@ -742,37 +742,29 @@ NS_IMETHODIMP
 Telephony::EnumerateCallState(nsITelephonyCallInfo* aInfo)
 {
   return HandleCallInfo(aInfo);
 }
 
 NS_IMETHODIMP
 Telephony::ConferenceCallStateChanged(uint16_t aCallState)
 {
-  mGroup->ChangeState(aCallState);
+  // The current design of Telephony Stack gaurantees that the calls within a
+  // call group are updated before this method being called, so we can let a
+  // call update its state by its own, and we can discard |aCallState| here.
+  // Anyway, this method is going to be deprecated in Bug 1155072.
+  mGroup->ChangeState();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Telephony::EnumerateCallStateComplete()
 {
   // Set conference state.
-  if (mGroup->CallsArray().Length() >= 2) {
-    const nsTArray<nsRefPtr<TelephonyCall> > &calls = mGroup->CallsArray();
-
-    uint16_t callState = calls[0]->CallState();
-    for (uint32_t i = 1; i < calls.Length(); i++) {
-      if (calls[i]->CallState() != callState) {
-        callState = nsITelephonyService::CALL_STATE_UNKNOWN;
-        break;
-      }
-    }
-
-    mGroup->ChangeState(callState);
-  }
+  mGroup->ChangeState();
 
   HandleAudioAgentState();
   if (mReadyPromise) {
     mReadyPromise->MaybeResolve(JS::UndefinedHandleValue);
   }
 
   if (NS_FAILED(mService->RegisterListener(mListener))) {
     NS_WARNING("Failed to register listener!");
--- a/dom/telephony/Telephony.h
+++ b/dom/telephony/Telephony.h
@@ -185,19 +185,16 @@ private:
   IsValidNumber(const nsAString& aNumber);
 
   static uint32_t
   GetNumServices();
 
   static bool
   IsValidServiceId(uint32_t aServiceId);
 
-  static bool
-  IsActiveState(uint16_t aCallState);
-
   uint32_t
   GetServiceId(const Optional<uint32_t>& aServiceId,
                bool aGetIfActiveCall = false);
 
   already_AddRefed<Promise>
   DialInternal(uint32_t aServiceId, const nsAString& aNumber, bool aEmergency,
                ErrorResult& aRv);
 
@@ -207,19 +204,23 @@ private:
   already_AddRefed<TelephonyCallId>
   CreateCallId(const nsAString& aNumber,
                uint16_t aNumberPresentation = nsITelephonyService::CALL_PRESENTATION_ALLOWED,
                const nsAString& aName = EmptyString(),
                uint16_t aNamePresentation = nsITelephonyService::CALL_PRESENTATION_ALLOWED);
 
   already_AddRefed<TelephonyCall>
   CreateCall(TelephonyCallId* aId,
-             uint32_t aServiceId, uint32_t aCallIndex, uint16_t aCallState,
-             bool aEmergency = false, bool aConference = false,
-             bool aSwitchable = true, bool aMergeable = true);
+             uint32_t aServiceId,
+             uint32_t aCallIndex,
+             TelephonyCallState aState,
+             bool aEmergency = false,
+             bool aConference = false,
+             bool aSwitchable = true,
+             bool aMergeable = true);
 
   nsresult
   NotifyEvent(const nsAString& aType);
 
   nsresult
   NotifyCallsChanged(TelephonyCall* aCall);
 
   nsresult
--- a/dom/telephony/TelephonyCall.cpp
+++ b/dom/telephony/TelephonyCall.cpp
@@ -29,26 +29,61 @@
        ++entry, ++i) {                                                  \
     if (_string.EqualsASCII(entry->value)) {                            \
       _enum.SetValue(static_cast<_enumType>(i));                        \
       break;                                                            \
     }                                                                   \
   }                                                                     \
 }
 
+#ifdef TELEPHONY_CALL_STATE
+#undef TELEPHONY_CALL_STATE
+#endif
+
+#define TELEPHONY_CALL_STATE(_state) \
+  (TelephonyCallStateValues::strings[static_cast<int32_t>(_state)].value)
+
 using namespace mozilla::dom;
 using namespace mozilla::dom::telephony;
 using mozilla::ErrorResult;
 
 // static
+TelephonyCallState
+TelephonyCall::ConvertToTelephonyCallState(uint32_t aCallState)
+{
+  switch (aCallState) {
+    case nsITelephonyService::CALL_STATE_DIALING:
+      return TelephonyCallState::Dialing;
+    case nsITelephonyService::CALL_STATE_ALERTING:
+      return TelephonyCallState::Alerting;
+    case nsITelephonyService::CALL_STATE_CONNECTED:
+      return TelephonyCallState::Connected;
+    case nsITelephonyService::CALL_STATE_HELD:
+      return TelephonyCallState::Held;
+    case nsITelephonyService::CALL_STATE_DISCONNECTED:
+      return TelephonyCallState::Disconnected;
+    case nsITelephonyService::CALL_STATE_INCOMING:
+      return TelephonyCallState::Incoming;
+  }
+
+  NS_NOTREACHED("Unknown state!");
+  return TelephonyCallState::Disconnected;
+}
+
+// static
 already_AddRefed<TelephonyCall>
-TelephonyCall::Create(Telephony* aTelephony, TelephonyCallId* aId,
-                      uint32_t aServiceId, uint32_t aCallIndex,
-                      uint16_t aCallState, bool aEmergency, bool aConference,
-                      bool aSwitchable, bool aMergeable)
+TelephonyCall::Create(Telephony* aTelephony,
+                      TelephonyCallId* aId,
+                      uint32_t aServiceId,
+                      uint32_t aCallIndex,
+                      TelephonyCallState aState,
+                      bool aEmergency,
+                      bool aConference,
+                      bool aSwitchable,
+                      bool aMergeable)
 {
   NS_ASSERTION(aTelephony, "Null aTelephony pointer!");
   NS_ASSERTION(aId, "Null aId pointer!");
   NS_ASSERTION(aCallIndex >= 1, "Invalid call index!");
 
   nsRefPtr<TelephonyCall> call = new TelephonyCall(aTelephony->GetOwner());
 
   call->mTelephony = aTelephony;
@@ -56,18 +91,17 @@ TelephonyCall::Create(Telephony* aTeleph
   call->mServiceId = aServiceId;
   call->mCallIndex = aCallIndex;
   call->mEmergency = aEmergency;
   call->mGroup = aConference ? aTelephony->ConferenceGroup() : nullptr;
   call->mSwitchable = aSwitchable;
   call->mMergeable = aMergeable;
   call->mError = nullptr;
 
-  call->ChangeStateInternal(aCallState, false);
-
+  call->ChangeStateInternal(aState, false);
   return call.forget();
 }
 
 TelephonyCall::TelephonyCall(nsPIDOMWindow* aOwner)
   : DOMEventTargetHelper(aOwner),
     mLive(false)
 {
 }
@@ -78,76 +112,72 @@ TelephonyCall::~TelephonyCall()
 
 JSObject*
 TelephonyCall::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return TelephonyCallBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
-TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
+TelephonyCall::ChangeStateInternal(TelephonyCallState aState, bool aFireEvents)
 {
   nsRefPtr<TelephonyCall> kungFuDeathGrip(this);
 
-  mCallState = aCallState;
-  switch (aCallState) {
-    case nsITelephonyService::CALL_STATE_DIALING:
-      mState.AssignLiteral("dialing");
-      break;
-    case nsITelephonyService::CALL_STATE_ALERTING:
-      mState.AssignLiteral("alerting");
-      break;
-    case nsITelephonyService::CALL_STATE_CONNECTED:
-      mState.AssignLiteral("connected");
-      break;
-    case nsITelephonyService::CALL_STATE_HELD:
-      mState.AssignLiteral("held");
-      break;
-    case nsITelephonyService::CALL_STATE_DISCONNECTED:
-      mState.AssignLiteral("disconnected");
-      break;
-    case nsITelephonyService::CALL_STATE_INCOMING:
-      mState.AssignLiteral("incoming");
-      break;
-    default:
-      NS_NOTREACHED("Unknown state!");
-  }
+  // Update current state
+  mState = aState;
 
-  if (aCallState == nsITelephonyService::CALL_STATE_DISCONNECTED) {
+  // Handle disconnected calls
+  if (mState == TelephonyCallState::Disconnected) {
     NS_ASSERTION(mLive, "Should be live!");
     mLive = false;
     if (mGroup) {
       mGroup->RemoveCall(this);
     } else {
       mTelephony->RemoveCall(this);
     }
-  } else if (!mLive) {
+  } else if (!mLive) { // Handle newly added calls
     mLive = true;
     if (mGroup) {
       mGroup->AddCall(this);
     } else {
       mTelephony->AddCall(this);
     }
   }
 
+  // Dispatch call state changed and call state event
   if (aFireEvents) {
-    nsresult rv = DispatchCallEvent(NS_LITERAL_STRING("statechange"), this);
-    if (NS_FAILED(rv)) {
-      NS_WARNING("Failed to dispatch specific event!");
-    }
+    NotifyStateChanged();
+  }
+}
+
+nsresult
+TelephonyCall::NotifyStateChanged()
+{
+  // Since |mState| can be changed after statechange handler called back here,
+  // we must save current state. Maybe we should figure out something smarter.
+  TelephonyCallState prevState = mState;
 
-    // This can change if the statechange handler called back here... Need to
-    // figure out something smarter.
-    if (mCallState == aCallState) {
-      rv = DispatchCallEvent(mState, this);
-      if (NS_FAILED(rv)) {
-        NS_WARNING("Failed to dispatch specific event!");
-      }
-    }
+  nsresult res = DispatchCallEvent(NS_LITERAL_STRING("statechange"), this);
+  if (NS_FAILED(res)) {
+    NS_WARNING("Failed to dispatch specific event!");
   }
+
+  // Check whether |mState| remains the same after the statechange handler.
+  if (mState != prevState) {
+    NS_WARNING("Call State has changed by statechange handler!");
+    return res;
+  }
+
+  res = DispatchCallEvent(NS_ConvertASCIItoUTF16(TELEPHONY_CALL_STATE(mState)),
+                          this);
+  if (NS_FAILED(res)) {
+    NS_WARNING("Failed to dispatch a specific event!");
+  }
+
+  return res;
 }
 
 nsresult
 TelephonyCall::DispatchCallEvent(const nsAString& aType,
                                  TelephonyCall* aCall)
 {
   MOZ_ASSERT(aCall);
 
@@ -273,19 +303,20 @@ TelephonyCall::GetGroup() const
 already_AddRefed<Promise>
 TelephonyCall::Answer(ErrorResult& aRv)
 {
   nsRefPtr<Promise> promise = CreatePromise(aRv);
   if (!promise) {
     return nullptr;
   }
 
-  if (mCallState != nsITelephonyService::CALL_STATE_INCOMING) {
+  if (mState != TelephonyCallState::Incoming) {
     NS_WARNING(nsPrintfCString("Answer on non-incoming call is rejected!"
-                               " (State: %u)", mCallState).get());
+                               " (State: %s)",
+                               TELEPHONY_CALL_STATE(mState)).get());
     promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
     return promise.forget();
   }
 
   nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
   aRv = mTelephony->Service()->AnswerCall(mServiceId, mCallIndex, callback);
   NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
 
@@ -295,25 +326,26 @@ TelephonyCall::Answer(ErrorResult& aRv)
 already_AddRefed<Promise>
 TelephonyCall::HangUp(ErrorResult& aRv)
 {
   nsRefPtr<Promise> promise = CreatePromise(aRv);
   if (!promise) {
     return nullptr;
   }
 
-  if (mCallState == nsITelephonyService::CALL_STATE_DISCONNECTED) {
-    NS_WARNING(nsPrintfCString("HangUp on previously disconnected call"
-                               " is rejected! (State: %u)", mCallState).get());
+  if (mState == TelephonyCallState::Disconnected) {
+    NS_WARNING(nsPrintfCString("HangUp on a disconnected call is rejected!"
+                               " (State: %s)",
+                               TELEPHONY_CALL_STATE(mState)).get());
     promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
     return promise.forget();
   }
 
   nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
-  aRv = mCallState == nsITelephonyService::CALL_STATE_INCOMING ?
+  aRv = mState == TelephonyCallState::Incoming ?
     mTelephony->Service()->RejectCall(mServiceId, mCallIndex, callback) :
     mTelephony->Service()->HangUpCall(mServiceId, mCallIndex, callback);
   NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
@@ -329,40 +361,23 @@ TelephonyCall::Hold(ErrorResult& aRv)
   if (NS_WARN_IF(aRv.Failed() &&
                  !aRv.ErrorCodeIs(NS_ERROR_DOM_INVALID_STATE_ERR))) {
     return nullptr;
   }
 
   return promise.forget();
 }
 
-already_AddRefed<Promise>
-TelephonyCall::Resume(ErrorResult& aRv)
-{
-  nsRefPtr<Promise> promise = CreatePromise(aRv);
-  if (!promise) {
-    return nullptr;
-  }
-
-  nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
-  aRv = Resume(callback);
-  if (NS_WARN_IF(aRv.Failed() &&
-                 !aRv.ErrorCodeIs(NS_ERROR_DOM_INVALID_STATE_ERR))) {
-    return nullptr;
-  }
-
-  return promise.forget();
-}
-
 nsresult
 TelephonyCall::Hold(nsITelephonyCallback* aCallback)
 {
-  if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
+  if (mState != TelephonyCallState::Connected) {
     NS_WARNING(nsPrintfCString("Hold non-connected call is rejected!"
-                               " (State: %u)", mCallState).get());
+                               " (State: %s)",
+                               TELEPHONY_CALL_STATE(mState)).get());
     aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   if (mGroup) {
     NS_WARNING("Hold a call in conference is rejected!");
     aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
     return NS_ERROR_DOM_INVALID_STATE_ERR;
@@ -384,21 +399,41 @@ TelephonyCall::Hold(nsITelephonyCallback
     // object. Otherwise, the state here will be inconsistent with the backend
     // RIL and will never be right.
     return NS_OK;
   }
 
   return NS_OK;
 }
 
+already_AddRefed<Promise>
+TelephonyCall::Resume(ErrorResult& aRv)
+{
+  nsRefPtr<Promise> promise = CreatePromise(aRv);
+  if (!promise) {
+    return nullptr;
+  }
+
+  nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
+  aRv = Resume(callback);
+  if (NS_WARN_IF(aRv.Failed() &&
+                 !aRv.ErrorCodeIs(NS_ERROR_DOM_INVALID_STATE_ERR))) {
+    return nullptr;
+  }
+
+  return promise.forget();
+}
+
 nsresult
 TelephonyCall::Resume(nsITelephonyCallback* aCallback)
 {
-  if (mCallState != nsITelephonyService::CALL_STATE_HELD) {
-    NS_WARNING("Resume non-held call is rejected!");
+  if (mState != TelephonyCallState::Held) {
+    NS_WARNING(nsPrintfCString("Resume non-held call is rejected!"
+                               " (State: %s)",
+                               TELEPHONY_CALL_STATE(mState)).get());
     aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   if (mGroup) {
     NS_WARNING("Resume a call in conference is rejected!");
     aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
     return NS_ERROR_DOM_INVALID_STATE_ERR;
--- a/dom/telephony/TelephonyCall.h
+++ b/dom/telephony/TelephonyCall.h
@@ -24,26 +24,25 @@ class TelephonyCall final : public DOMEv
 {
   nsRefPtr<Telephony> mTelephony;
   nsRefPtr<TelephonyCallGroup> mGroup;
 
   nsRefPtr<TelephonyCallId> mId;
   nsRefPtr<TelephonyCallId> mSecondId;
 
   uint32_t mServiceId;
-  nsString mState;
+  TelephonyCallState mState;
   bool mEmergency;
   nsRefPtr<DOMError> mError;
   Nullable<TelephonyCallDisconnectedReason> mDisconnectedReason;
 
   bool mSwitchable;
   bool mMergeable;
 
   uint32_t mCallIndex;
-  uint16_t mCallState;
   bool mLive;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCall,
                                            DOMEventTargetHelper)
   friend class Telephony;
@@ -60,20 +59,20 @@ public:
 
   // WebIDL
   already_AddRefed<TelephonyCallId>
   Id() const;
 
   already_AddRefed<TelephonyCallId>
   GetSecondId() const;
 
-  void
-  GetState(nsString& aState) const
+  TelephonyCallState
+  State() const
   {
-    aState.Assign(mState);
+    return mState;
   }
 
   bool
   Emergency() const
   {
     return mEmergency;
   }
 
@@ -84,16 +83,24 @@ public:
   }
 
   bool
   Mergeable() const
   {
     return mMergeable;
   }
 
+  bool
+  IsActive() const
+  {
+    return mState == TelephonyCallState::Dialing ||
+           mState == TelephonyCallState::Alerting ||
+           mState == TelephonyCallState::Connected;
+  }
+
   already_AddRefed<DOMError>
   GetError() const;
 
   Nullable<TelephonyCallDisconnectedReason>
   GetDisconnectedReason() const
   {
     return mDisconnectedReason;
   }
@@ -117,46 +124,46 @@ public:
   IMPL_EVENT_HANDLER(dialing)
   IMPL_EVENT_HANDLER(alerting)
   IMPL_EVENT_HANDLER(connected)
   IMPL_EVENT_HANDLER(disconnected)
   IMPL_EVENT_HANDLER(held)
   IMPL_EVENT_HANDLER(error)
   IMPL_EVENT_HANDLER(groupchange)
 
+  static TelephonyCallState
+  ConvertToTelephonyCallState(uint32_t aCallState);
+
   static already_AddRefed<TelephonyCall>
   Create(Telephony* aTelephony, TelephonyCallId* aId,
-         uint32_t aServiceId, uint32_t aCallIndex, uint16_t aCallState,
+         uint32_t aServiceId, uint32_t aCallIndex, TelephonyCallState aState,
          bool aEmergency = false, bool aConference = false,
          bool aSwitchable = true, bool aMergeable = true);
 
   void
-  ChangeState(uint16_t aCallState)
+  ChangeState(TelephonyCallState aState)
   {
-    ChangeStateInternal(aCallState, true);
+    ChangeStateInternal(aState, true);
   }
 
+  nsresult
+  NotifyStateChanged();
+
   uint32_t
   ServiceId() const
   {
     return mServiceId;
   }
 
   uint32_t
   CallIndex() const
   {
     return mCallIndex;
   }
 
-  uint16_t
-  CallState() const
-  {
-    return mCallState;
-  }
-
   void
   UpdateEmergency(bool aEmergency)
   {
     mEmergency = aEmergency;
   }
 
   void
   UpdateSwitchable(bool aSwitchable) {
@@ -189,17 +196,17 @@ private:
 
   nsresult
   Hold(nsITelephonyCallback* aCallback);
 
   nsresult
   Resume(nsITelephonyCallback* aCallback);
 
   void
-  ChangeStateInternal(uint16_t aCallState, bool aFireEvents);
+  ChangeStateInternal(TelephonyCallState aState, bool aFireEvents);
 
   nsresult
   DispatchCallEvent(const nsAString& aType,
                     TelephonyCall* aCall);
 
   already_AddRefed<Promise>
   CreatePromise(ErrorResult& aRv);
 };
--- a/dom/telephony/TelephonyCallGroup.cpp
+++ b/dom/telephony/TelephonyCallGroup.cpp
@@ -5,26 +5,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TelephonyCallGroup.h"
 
 #include "CallsList.h"
 #include "Telephony.h"
 #include "mozilla/dom/CallEvent.h"
 #include "mozilla/dom/CallGroupErrorEvent.h"
-#include "mozilla/dom/TelephonyCallGroupBinding.h"
 #include "mozilla/dom/telephony/TelephonyCallback.h"
 
+#include "nsPrintfCString.h"
+
+#ifdef TELEPHONY_GROUP_STATE
+#undef TELEPHONY_GROUP_STATE
+#endif
+
+#define TELEPHONY_GROUP_STATE(_state) \
+  (TelephonyCallGroupStateValues::strings[static_cast<int32_t>(_state)].value)
+
 using namespace mozilla::dom;
 using namespace mozilla::dom::telephony;
 using mozilla::ErrorResult;
 
 TelephonyCallGroup::TelephonyCallGroup(nsPIDOMWindow* aOwner)
   : DOMEventTargetHelper(aOwner)
-  , mCallState(nsITelephonyService::CALL_STATE_UNKNOWN)
 {
 }
 
 TelephonyCallGroup::~TelephonyCallGroup()
 {
 }
 
 // static
@@ -32,16 +39,17 @@ already_AddRefed<TelephonyCallGroup>
 TelephonyCallGroup::Create(Telephony* aTelephony)
 {
   NS_ASSERTION(aTelephony, "Null telephony!");
 
   nsRefPtr<TelephonyCallGroup> group =
     new TelephonyCallGroup(aTelephony->GetOwner());
 
   group->mTelephony = aTelephony;
+  group->mState = TelephonyCallGroupState::_empty;
   group->mCallsList = new CallsList(aTelephony, group);
 
   return group.forget();
 }
 
 JSObject*
 TelephonyCallGroup::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
@@ -77,58 +85,94 @@ TelephonyCallGroup::NotifyError(const ns
 
   nsRefPtr<CallGroupErrorEvent> event =
     CallGroupErrorEvent::Constructor(this, NS_LITERAL_STRING("error"), init);
 
   return DispatchTrustedEvent(event);
 }
 
 void
-TelephonyCallGroup::ChangeState(uint16_t aCallState)
+TelephonyCallGroup::ChangeState()
 {
-  if (mCallState == aCallState) {
+  MOZ_ASSERT(mCalls.Length() != 1);
+  if (mCalls.Length() == 0) {
+    ChangeStateInternal(TelephonyCallGroupState::_empty);
     return;
   }
 
-  mCallState = aCallState;
-  switch (aCallState) {
-    case nsITelephonyService::CALL_STATE_UNKNOWN:
-      mState.AssignLiteral("");
-      break;
-    case nsITelephonyService::CALL_STATE_CONNECTED:
-      mState.AssignLiteral("connected");
-      break;
-    case nsITelephonyService::CALL_STATE_HELD:
-      mState.AssignLiteral("held");
-      break;
-    default:
-      NS_NOTREACHED("Unknown state!");
-  }
-
-  nsresult rv = DispatchCallEvent(NS_LITERAL_STRING("statechange"), nullptr);
-  if (NS_FAILED(rv)) {
-    NS_WARNING("Failed to dispatch specific event!");
-  }
-  if (!mState.IsEmpty()) {
-    // This can change if the statechange handler called back here... Need to
-    // figure out something smarter.
-    if (mCallState == aCallState) {
-      rv = DispatchCallEvent(mState, nullptr);
-      if (NS_FAILED(rv)) {
-        NS_WARNING("Failed to dispatch specific event!");
-      }
+  TelephonyCallState state = mCalls[0]->State();
+  for (uint32_t i = 1; i < mCalls.Length(); i++) {
+    if (mCalls[i]->State() != state) {
+      MOZ_ASSERT(false, "Various call states are found in a call group!");
+      ChangeStateInternal(TelephonyCallGroupState::_empty);
+      return;
     }
   }
 
+  TelephonyCallGroupState groupState = TelephonyCallGroupState::_empty;
+  switch (state) {
+    case TelephonyCallState::Connected:
+      groupState = TelephonyCallGroupState::Connected;
+      break;
+    case TelephonyCallState::Held:
+      groupState = TelephonyCallGroupState::Held;
+      break;
+    default:
+      NS_NOTREACHED(nsPrintfCString("Invavild call state for a call group(%s)!",
+                                    TELEPHONY_CALL_STATE(state)).get());
+  }
+
+  ChangeStateInternal(groupState);
+}
+
+void
+TelephonyCallGroup::ChangeStateInternal(TelephonyCallGroupState aState)
+{
+  if (mState == aState) {
+    return;
+  }
+ 
+  // Update Current State
+  mState = aState;
+ 
+  // Dispatch related events
+  NotifyStateChanged();
+}
+
+nsresult
+TelephonyCallGroup::NotifyStateChanged()
+{
+  // Since |mState| can be changed after statechange handler called back here,
+  // we must save current state. Maybe we should figure out something smarter.
+  TelephonyCallGroupState prevState = mState;
+
+  nsresult res = DispatchCallEvent(NS_LITERAL_STRING("statechange"), nullptr);
+  if (NS_FAILED(res)) {
+    NS_WARNING("Failed to dispatch specific event!");
+  }
+
+  // Check whether |mState| remains the same after the statechange handler.
+  // Besides, If there is no conference call at all, then we dont't have to
+  // dispatch the state evnet.
+  if (mState == prevState) {
+    res = DispatchCallEvent(NS_ConvertASCIItoUTF16(TELEPHONY_GROUP_STATE(mState)),
+                            nullptr);
+    if (NS_FAILED(res)) {
+      NS_WARNING("Failed to dispatch specific event!");
+    }
+  }
+
+  // Notify each call within to dispatch call state change event
   for (uint32_t index = 0; index < mCalls.Length(); index++) {
-    nsRefPtr<TelephonyCall> call = mCalls[index];
-    call->ChangeState(aCallState);
+    if (NS_FAILED(mCalls[index]->NotifyStateChanged())){
+      res = NS_ERROR_FAILURE;
+    }
+  }
 
-    MOZ_ASSERT(call->CallState() == aCallState);
-  }
+  return res;
 }
 
 nsresult
 TelephonyCallGroup::NotifyCallsChanged(TelephonyCall* aCall)
 {
   return DispatchCallEvent(NS_LITERAL_STRING("callschanged"), aCall);
 }
 
@@ -167,37 +211,36 @@ TelephonyCallGroup::CanConference(const 
                                   const TelephonyCall* aSecondCall)
 {
   if (!aCall.Mergeable()) {
     return false;
   }
 
   if (!aSecondCall) {
     MOZ_ASSERT(!mCalls.IsEmpty());
-
-    return (mCallState == nsITelephonyService::CALL_STATE_CONNECTED &&
-            aCall.CallState() == nsITelephonyService::CALL_STATE_HELD) ||
-           (mCallState == nsITelephonyService::CALL_STATE_HELD &&
-            aCall.CallState() == nsITelephonyService::CALL_STATE_CONNECTED);
+    return (mState == TelephonyCallGroupState::Connected &&
+            aCall.State() == TelephonyCallState::Held) ||
+           (mState == TelephonyCallGroupState::Held &&
+            aCall.State() == TelephonyCallState::Connected);
   }
 
-  MOZ_ASSERT(mCallState == nsITelephonyService::CALL_STATE_UNKNOWN);
+  MOZ_ASSERT(mState != TelephonyCallGroupState::_empty);
 
   if (aCall.ServiceId() != aSecondCall->ServiceId()) {
     return false;
   }
 
   if (!aSecondCall->Mergeable()) {
     return false;
   }
 
-  return (aCall.CallState() == nsITelephonyService::CALL_STATE_CONNECTED &&
-          aSecondCall->CallState() == nsITelephonyService::CALL_STATE_HELD) ||
-         (aCall.CallState() == nsITelephonyService::CALL_STATE_HELD &&
-          aSecondCall->CallState() == nsITelephonyService::CALL_STATE_CONNECTED);
+  return (aCall.State() == TelephonyCallState::Connected &&
+          aSecondCall->State() == TelephonyCallState::Held) ||
+         (aCall.State() == TelephonyCallState::Held &&
+          aSecondCall->State() == TelephonyCallState::Connected);
 }
 
 already_AddRefed<TelephonyCall>
 TelephonyCallGroup::GetCall(uint32_t aServiceId, uint32_t aCallIndex)
 {
   nsRefPtr<TelephonyCall> call;
 
   for (uint32_t index = 0; index < mCalls.Length(); index++) {
@@ -292,17 +335,17 @@ TelephonyCallGroup::Remove(TelephonyCall
 {
   MOZ_ASSERT(!mCalls.IsEmpty());
 
   nsRefPtr<Promise> promise = CreatePromise(aRv);
   if (!promise) {
     return nullptr;
   }
 
-  if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
+  if (mState != TelephonyCallGroupState::Connected) {
     NS_WARNING("Remove call from a non-connected call group. Ignore!");
     promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
     return promise.forget();
   }
 
   uint32_t serviceId = aCall.ServiceId();
   uint32_t callIndex = aCall.CallIndex();
 
@@ -325,16 +368,24 @@ TelephonyCallGroup::HangUp(ErrorResult& 
 {
   MOZ_ASSERT(!mCalls.IsEmpty());
 
   nsRefPtr<Promise> promise = CreatePromise(aRv);
   if (!promise) {
     return nullptr;
   }
 
+  if (mState == TelephonyCallGroupState::_empty) {
+    NS_WARNING(nsPrintfCString("We don't have a call group now!"
+                               " (State: %s)",
+                               TELEPHONY_GROUP_STATE(mState)).get());
+    promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
+    return promise.forget();
+  }
+
   nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
   aRv = mTelephony->Service()->HangUpConference(mCalls[0]->ServiceId(),
                                                 callback);
   NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
   return promise.forget();
 }
 
 already_AddRefed<Promise>
@@ -352,16 +403,36 @@ TelephonyCallGroup::Hold(ErrorResult& aR
   if (NS_WARN_IF(aRv.Failed() &&
                  !aRv.ErrorCodeIs(NS_ERROR_DOM_INVALID_STATE_ERR))) {
     return nullptr;
   }
 
   return promise.forget();
 }
 
+nsresult
+TelephonyCallGroup::Hold(nsITelephonyCallback* aCallback)
+{
+  if (mState != TelephonyCallGroupState::Connected) {
+    NS_WARNING(nsPrintfCString("Resume non-connected call group is rejected!"
+                               " (State: %s)",
+                               TELEPHONY_GROUP_STATE(mState)).get());
+    aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
+    return NS_ERROR_DOM_INVALID_STATE_ERR;
+  }
+
+  nsresult rv = mTelephony->Service()->HoldConference(mCalls[0]->ServiceId(),
+                                                      aCallback);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return NS_ERROR_FAILURE;
+  }
+
+  return NS_OK;
+}
+
 already_AddRefed<Promise>
 TelephonyCallGroup::Resume(ErrorResult& aRv)
 {
   MOZ_ASSERT(!mCalls.IsEmpty());
 
   nsRefPtr<Promise> promise = CreatePromise(aRv);
   if (!promise) {
     return nullptr;
@@ -373,38 +444,22 @@ TelephonyCallGroup::Resume(ErrorResult& 
                  !aRv.ErrorCodeIs(NS_ERROR_DOM_INVALID_STATE_ERR))) {
     return nullptr;
   }
 
   return promise.forget();
 }
 
 nsresult
-TelephonyCallGroup::Hold(nsITelephonyCallback* aCallback)
-{
-  if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
-    NS_WARNING("Holding a non-connected call is rejected!");
-    aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
-    return NS_ERROR_DOM_INVALID_STATE_ERR;
-  }
-
-  nsresult rv = mTelephony->Service()->HoldConference(mCalls[0]->ServiceId(),
-                                                      aCallback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-nsresult
 TelephonyCallGroup::Resume(nsITelephonyCallback* aCallback)
 {
-  if (mCallState != nsITelephonyService::CALL_STATE_HELD) {
-    NS_WARNING("Resuming a non-held call is rejected!");
+  if (mState != TelephonyCallGroupState::Held) {
+    NS_WARNING(nsPrintfCString("Resume non-held call group is rejected!"
+                               " (State: %s)",
+                               TELEPHONY_GROUP_STATE(mState)).get());
     aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   nsresult rv = mTelephony->Service()->ResumeConference(mCalls[0]->ServiceId(),
                                                         aCallback);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return NS_ERROR_FAILURE;
--- a/dom/telephony/TelephonyCallGroup.h
+++ b/dom/telephony/TelephonyCallGroup.h
@@ -3,32 +3,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_telephony_telephonycallgroup_h__
 #define mozilla_dom_telephony_telephonycallgroup_h__
 
 #include "mozilla/dom/Promise.h"
+#include "mozilla/dom/TelephonyCallGroupBinding.h"
 #include "mozilla/dom/telephony/TelephonyCommon.h"
 
 namespace mozilla {
 namespace dom {
 
 class TelephonyCallGroup final : public DOMEventTargetHelper
 {
   nsRefPtr<Telephony> mTelephony;
 
   nsTArray<nsRefPtr<TelephonyCall> > mCalls;
 
   nsRefPtr<CallsList> mCallsList;
 
-  nsString mState;
-
-  uint16_t mCallState;
+  TelephonyCallGroupState mState;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCallGroup,
                                            DOMEventTargetHelper)
 
   friend class Telephony;
 
@@ -59,20 +58,25 @@ public:
   HangUp(ErrorResult& aRv);
 
   already_AddRefed<Promise>
   Hold(ErrorResult& aRv);
 
   already_AddRefed<Promise>
   Resume(ErrorResult& aRv);
 
-  void
-  GetState(nsString& aState) const
+  TelephonyCallGroupState
+  State() const
   {
-    aState = mState;
+    return mState;
+  }
+
+  bool
+  IsActive() {
+    return mState == TelephonyCallGroupState::Connected;
   }
 
   IMPL_EVENT_HANDLER(statechange)
   IMPL_EVENT_HANDLER(connected)
   IMPL_EVENT_HANDLER(held)
   IMPL_EVENT_HANDLER(callschanged)
   IMPL_EVENT_HANDLER(error)
 
@@ -89,41 +93,42 @@ public:
   GetCall(uint32_t aServiceId, uint32_t aCallIndex);
 
   const nsTArray<nsRefPtr<TelephonyCall> >&
   CallsArray() const
   {
     return mCalls;
   }
 
+  // Update its call state according to the calls wihtin itself.
   void
-  ChangeState(uint16_t aCallState);
-
-  uint16_t
-  CallState() const
-  {
-    return mCallState;
-  }
+  ChangeState();
 
   nsresult
   NotifyError(const nsAString& aName, const nsAString& aMessage);
 
 private:
   explicit TelephonyCallGroup(nsPIDOMWindow* aOwner);
   ~TelephonyCallGroup();
 
   nsresult
   Hold(nsITelephonyCallback* aCallback);
 
   nsresult
   Resume(nsITelephonyCallback* aCallback);
 
   nsresult
+  NotifyStateChanged();
+
+  nsresult
   NotifyCallsChanged(TelephonyCall* aCall);
 
+  void
+  ChangeStateInternal(TelephonyCallGroupState aState);
+
   nsresult
   DispatchCallEvent(const nsAString& aType,
                     TelephonyCall* aCall);
 
   already_AddRefed<Promise>
   CreatePromise(ErrorResult& aRv);
 
   bool CanConference(const TelephonyCall& aCall, const TelephonyCall* aSecondCall);
--- a/dom/telephony/TelephonyDialCallback.cpp
+++ b/dom/telephony/TelephonyDialCallback.cpp
@@ -54,17 +54,17 @@ TelephonyDialCallback::NotifyDialMMI(con
 NS_IMETHODIMP
 TelephonyDialCallback::NotifyDialCallSuccess(uint32_t aClientId,
                                              uint32_t aCallIndex,
                                              const nsAString& aNumber)
 {
   nsRefPtr<TelephonyCallId> id = mTelephony->CreateCallId(aNumber);
   nsRefPtr<TelephonyCall> call =
       mTelephony->CreateCall(id, aClientId, aCallIndex,
-                             nsITelephonyService::CALL_STATE_DIALING);
+                             TelephonyCallState::Dialing);
 
   mPromise->MaybeResolve(call);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TelephonyDialCallback::NotifyDialMMISuccess(const nsAString& aStatusMessage)
 {
--- a/dom/telephony/gonk/TelephonyService.js
+++ b/dom/telephony/gonk/TelephonyService.js
@@ -1065,24 +1065,32 @@ TelephonyService.prototype = {
 
       // Call waiting
       case MMI_KS_SC_CALL_WAITING:
         this._callWaitingMMI(aClientId, aMmi, aCallback);
         break;
 
       // Handle unknown MMI code as USSD.
       default:
-        this._sendUSSDInternal(aClientId, aMmi.fullMMI, aResponse => {
-          if (aResponse.errorMsg) {
-            aCallback.notifyDialMMIError(aResponse.errorMsg);
-            return;
-          }
-
-          aCallback.notifyDialMMISuccess("");
-        });
+        if (this._ussdSessions[aClientId]) {
+          // Cancel the previous ussd session first.
+          this._cancelUSSDInternal(aClientId, aResponse => {
+            // Fail to cancel ussd session, report error instead of sending ussd
+            // request.
+            if (aResponse.errorMsg) {
+              aCallback.notifyDialMMIError(aResponse.errorMsg);
+              return;
+            }
+            this._sendUSSDInternal(aClientId, aMmi.fullMMI,
+                                   this._defaultMMICallbackHandler.bind(this, aCallback));
+          });
+          return;
+        }
+        this._sendUSSDInternal(aClientId, aMmi.fullMMI,
+                               this._defaultMMICallbackHandler.bind(this, aCallback));
         break;
     }
   },
 
   /**
    * Handle call forwarding MMI code.
    *
    * @param aClientId
@@ -1679,16 +1687,24 @@ TelephonyService.prototype = {
   _defaultCallbackHandler: function(aCallback, aResponse) {
     if (aResponse.errorMsg) {
       aCallback.notifyError(aResponse.errorMsg);
     } else {
       aCallback.notifySuccess();
     }
   },
 
+  _defaultMMICallbackHandler: function(aCallback, aResponse) {
+    if (aResponse.errorMsg) {
+      aCallback.notifyDialMMIError(aResponse.errorMsg);
+    } else {
+      aCallback.notifyDialMMISuccess("");
+    }
+  },
+
   _getCallsWithState: function(aClientId, aState) {
     let calls = [];
     for (let i in this._currentCalls[aClientId]) {
       let call = this._currentCalls[aClientId][i];
       if (call.state === aState) {
         calls.push(call);
       }
     }
@@ -2133,34 +2149,19 @@ TelephonyService.prototype = {
   },
 
   sendUSSD: function(aClientId, aUssd, aCallback) {
     this._sendUSSDInternal(aClientId, aUssd,
                            this._defaultCallbackHandler.bind(this, aCallback));
   },
 
   _sendUSSDInternal: function(aClientId, aUssd, aCallback) {
-    if (!this._ussdSessions[aClientId]) {
-      this._sendToRilWorker(aClientId, "sendUSSD", { ussd: aUssd }, aResponse => {
-        this._ussdSessions[aClientId] = !aResponse.errorMsg;
-        aCallback(aResponse);
-      });
-      return;
-    }
-
-    // Cancel the previous ussd session first.
-    this._cancelUSSDInternal(aClientId, aResponse => {
-      // Fail to cancel ussd session, report error instead of sending ussd
-      // request.
-      if (aResponse.errorMsg) {
-        aCallback(aResponse);
-        return;
-      }
-
-      this._sendUSSDInternal(aClientId, aUssd, aCallback);
+    this._sendToRilWorker(aClientId, "sendUSSD", { ussd: aUssd }, aResponse => {
+      this._ussdSessions[aClientId] = !aResponse.errorMsg;
+      aCallback(aResponse);
     });
   },
 
   cancelUSSD: function(aClientId, aCallback) {
     this._cancelUSSDInternal(aClientId,
                              this._defaultCallbackHandler.bind(this, aCallback));
   },
 
--- a/dom/tv/TVSimulatorService.js
+++ b/dom/tv/TVSimulatorService.js
@@ -1,24 +1,36 @@
 /* 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/. */
 "use strict";
 
 function debug(aMsg) {
-   //dump("[TVSimulatorService] " + aMsg + "\n");
+  //dump("[TVSimulatorService] " + aMsg + "\n");
 }
 
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const Cr = Components.returnCode;
 const TV_SIMULATOR_DUMMY_DIRECTORY = "dummy";
 const TV_SIMULATOR_DUMMY_FILE      = "settings.json";
 
+// See http://seanyhlin.github.io/TV-Manager-API/#idl-def-TVSourceType
+const TV_SOURCE_TYPES = ["dvb-t","dvb-t2","dvb-c","dvb-c2","dvb-s",
+                         "dvb-s2","dvb-h","dvb-sh","atsc","atsc-m/h",
+                         "isdb-t","isdb-tb","isdb-s","isdb-c","1seg",
+                         "dtmb","cmmb","t-dmb","s-dmb"];
+function containInvalidSourceType(aElement, aIndex, aArray) {
+  return !TV_SOURCE_TYPES.includes(aElement);
+}
+
+// See http://seanyhlin.github.io/TV-Manager-API/#idl-def-TVChannelType
+const TV_CHANNEL_TYPES = ["tv","radio","data"];
+
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function TVSimulatorService() {
   this._internalTuners = null;
   this._scanCompleteTimer = null;
   this._scanningWrapTunerData = null;
   this._init();
 }
@@ -61,17 +73,17 @@ TVSimulatorService.prototype = {
       }
     } catch(e) {
       debug("Error occurred : " + e );
       return;
     } finally {
       cstream.close();
     }
 
-    let settingObj;
+    let settingsObj;
     try {
       /*
        *
        * Setting JSON file format:
        *
        * Note: This setting JSON is not allow empty array.
        *       If set the empty array, _init() will fail.
        *       e.g.
@@ -104,28 +116,34 @@ TVSimulatorService.prototype = {
        *            "audioLanugages":   ["The array of audio language"],
        *            "subtitleLanguages":["The array of subtitle language"],
        *           },]
        *         },]
        *       },]
        *     },]
        *   }
        */
-      settingObj = JSON.parse(settingStr);
+      settingsObj = JSON.parse(settingStr);
     } catch(e) {
       debug("File load error: " + e);
       return;
     }
 
+    // validation
+    if (!this._validateSettings(settingsObj)) {
+      debug("Failed to validate settings.");
+      return;
+    }
+
     // Key is as follow
     // {'tunerId':tunerId, 'sourceType':sourceType}
     this._internalTuners = new Map();
 
     // TVTunerData
-    for each (let tunerData in settingObj.tuners) {
+    for each (let tunerData in settingsObj.tuners) {
       let tuner = Cc["@mozilla.org/tv/tvtunerdata;1"]
                     .createInstance(Ci.nsITVTunerData);
       tuner.id = tunerData.id;
       tuner.streamType = tuner.TV_STREAM_TYPE_SIMULATOR;
       tuner.setSupportedSourceTypes(tunerData.supportedType.length,
                                     tunerData.supportedType);
 
       let wrapTunerData = {
@@ -398,17 +416,17 @@ TVSimulatorService.prototype = {
                                                                 aChannelNumber,
                                                                 aWin) {
     let wrapTunerData = this._getWrapTunerData(aTunerId, aSourceType);
     if (!wrapTunerData || !wrapTunerData.channels) {
       return "";
     }
 
     let wrapChannelData = wrapTunerData.channels.get(aChannelNumber);
-    if (!wrapChannelData) {
+    if (!wrapChannelData || !wrapChannelData.videoFilePath) {
       return "";
     }
 
     let videoFile = new File(this._getFilePath(wrapChannelData.videoFilePath));
     let videoBlobURL = aWin.URL.createObjectURL(videoFile);
 
     return videoBlobURL;
   },
@@ -428,11 +446,89 @@ TVSimulatorService.prototype = {
     let dsFile = Cc["@mozilla.org/file/directory_service;1"]
                    .getService(Ci.nsIProperties)
                    .get("ProfD", Ci.nsIFile);
     dsFile.append(TV_SIMULATOR_DUMMY_DIRECTORY);
     dsFile.append(fileName);
 
     return dsFile.path;
   },
+
+  _validateSettings: function TVSimValidateSettings(aSettingsObject) {
+    return this._validateTuners(aSettingsObject.tuners);
+  },
+
+  _validateTuners: function TVSimValidateTuners(aTunersObject) {
+    let tunerIds = new Array();
+    for each (let tuner in aTunersObject) {
+      if (!tuner.id ||
+          !tuner.supportedType ||
+          !tuner.supportedType.length ||
+          tuner.supportedType.some(containInvalidSourceType) ||
+          tunerIds.includes(tuner.id)) {
+        debug("invalid tuner data.");
+        return false;
+      }
+      tunerIds.push(tuner.id);
+
+      if (!this._validateSources(tuner.sources)) {
+        return false;
+      }
+    }
+    return true;
+  },
+
+  _validateSources: function TVSimValidateSources(aSourcesObject) {
+    for each (let source in aSourcesObject) {
+      if (!source.type ||
+          !TV_SOURCE_TYPES.includes(source.type)) {
+        debug("invalid source data.");
+        return false;
+      }
+
+      if (!this._validateChannels(source.channels)) {
+        return false;
+      }
+    }
+    return true;
+  },
+
+  _validateChannels: function TVSimValidateChannels(aChannelsObject) {
+    let channelNumbers = new Array();
+    for each (let channel in aChannelsObject) {
+      if (!channel.networkId ||
+          !channel.transportStreamId ||
+          !channel.serviceId ||
+          !channel.type ||
+          !TV_CHANNEL_TYPES.includes(channel.type) ||
+          !channel.number ||
+          channelNumbers.includes(channel.number) ||
+          !channel.name) {
+        debug("invalid channel data.");
+        return false;
+      }
+      channelNumbers.push(channel.number);
+
+      if (!this._validatePrograms(channel.programs)) {
+        return false;
+      }
+    }
+    return true;
+  },
+
+  _validatePrograms: function TVSimValidatePrograms(aProgramsObject) {
+    let eventIds = new Array();
+    for each (let program in aProgramsObject) {
+      if (!program.eventId ||
+          eventIds.includes(program.eventId) ||
+          !program.title ||
+          !program.startTime ||
+          !program.duration) {
+        debug("invalid program data.");
+        return false;
+      }
+      eventIds.push(program.eventId);
+    }
+    return true;
+  },
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TVSimulatorService]);
--- a/dom/tv/TVTuner.cpp
+++ b/dom/tv/TVTuner.cpp
@@ -280,17 +280,17 @@ TVTuner::CreateSimulatedMediaStream()
   }
 
   nsString currentVideoBlobUrl;
   nsresult rv = simService->GetSimulatorVideoBlobURL(mId,
                                                      ToTVSourceTypeStr(mCurrentSource->Type()),
                                                      currentChannelNumber,
                                                      domWin,
                                                      currentVideoBlobUrl);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
+  if (NS_WARN_IF(NS_FAILED(rv) || currentVideoBlobUrl.IsEmpty())) {
     return nullptr;
   }
 
   mediaElement->SetSrc(currentVideoBlobUrl, error);
   if (NS_WARN_IF(error.Failed())) {
     return nullptr;
   }
 
--- a/dom/webidl/TelephonyCall.webidl
+++ b/dom/webidl/TelephonyCall.webidl
@@ -10,17 +10,17 @@ interface TelephonyCall : EventTarget {
   readonly attribute unsigned long serviceId;
 
   readonly attribute TelephonyCallId id;
 
   // In CDMA networks, the 2nd waiting call shares the connection with the 1st
   // call. We need an additional attribute for the CDMA waiting call.
   readonly attribute TelephonyCallId? secondId;
 
-  readonly attribute DOMString state;
+  readonly attribute TelephonyCallState state;
 
   // The property "emergency" indicates whether the call number is an emergency
   // number. Only the outgoing call could have a value with true and it is
   // available after dialing state.
   readonly attribute boolean emergency;
 
   // Indicate whether the call state can be switched between "connected" and
   // "held".
@@ -51,16 +51,25 @@ interface TelephonyCall : EventTarget {
   attribute EventHandler ondisconnected;
   attribute EventHandler onheld;
   attribute EventHandler onerror;
 
   // Fired whenever the group attribute changes.
   attribute EventHandler ongroupchange;
 };
 
+enum TelephonyCallState {
+  "dialing",
+  "alerting",
+  "connected",
+  "held",
+  "disconnected",
+  "incoming",
+};
+
 enum TelephonyCallDisconnectedReason {
   "BadNumber",
   "NoRouteToDestination",
   "ChannelUnacceptable",
   "OperatorDeterminedBarring",
   "NormalCallClearing",
   "Busy",
   "NoUserResponding",
--- a/dom/webidl/TelephonyCallGroup.webidl
+++ b/dom/webidl/TelephonyCallGroup.webidl
@@ -21,16 +21,22 @@ interface TelephonyCallGroup : EventTarg
   Promise<void> hangUp();
 
   [NewObject, Throws]
   Promise<void> hold();
 
   [NewObject, Throws]
   Promise<void> resume();
 
-  readonly attribute DOMString state;
+  readonly attribute TelephonyCallGroupState state;
 
   attribute EventHandler onstatechange;
   attribute EventHandler onconnected;
   attribute EventHandler onheld;
   attribute EventHandler oncallschanged;
   attribute EventHandler onerror;
 };
+
+enum TelephonyCallGroupState {
+  "",
+  "connected",
+  "held",
+};
--- a/layout/reftests/css-invalid/textarea/reftest.list
+++ b/layout/reftests/css-invalid/textarea/reftest.list
@@ -1,12 +1,12 @@
 == textarea-valid.html textarea-ref.html
 == textarea-customerror.html textarea-ref.html
-fails-if(B2G||Mulet) == textarea-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
-fails-if(B2G||Mulet) == textarea-dyn-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
+== textarea-disabled.html textarea-ref.html
+== textarea-dyn-disabled.html textarea-ref.html
 == textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
--- a/layout/reftests/css-ui-invalid/textarea/reftest.list
+++ b/layout/reftests/css-ui-invalid/textarea/reftest.list
@@ -1,12 +1,12 @@
 == textarea-valid.html textarea-ref.html
 == textarea-customerror.html textarea-ref.html
-skip-if(B2G||Mulet) == textarea-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
-fails-if(B2G||Mulet) == textarea-dyn-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
+== textarea-disabled.html textarea-ref.html
+== textarea-dyn-disabled.html textarea-ref.html
 == textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly-not-changed.html textarea-ref.html
 == textarea-dyn-not-readonly-changed.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-maxlength-default-value-invalid.html textarea-withtext-ref.html
--- a/layout/reftests/css-ui-valid/textarea/reftest.list
+++ b/layout/reftests/css-ui-valid/textarea/reftest.list
@@ -1,12 +1,12 @@
 == textarea-valid.html textarea-ref.html
 == textarea-customerror.html textarea-ref.html
-fails-if(B2G||Mulet) == textarea-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
-random-if(B2G||Mulet) == textarea-dyn-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
+== textarea-disabled.html textarea-ref.html
+== textarea-dyn-disabled.html textarea-ref.html
 == textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-dyn-not-disabled-changed.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly-changed.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-valid-changed.html textarea-ref.html
--- a/layout/reftests/css-valid/textarea/reftest.list
+++ b/layout/reftests/css-valid/textarea/reftest.list
@@ -1,12 +1,12 @@
 == textarea-valid.html textarea-ref.html
 == textarea-customerror.html textarea-ref.html
-fails-if(B2G||Mulet) == textarea-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
-fails-if(B2G||Mulet) == textarea-dyn-disabled.html textarea-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
+== textarea-disabled.html textarea-ref.html
+== textarea-dyn-disabled.html textarea-ref.html
 == textarea-dyn-not-disabled.html textarea-ref.html
 == textarea-readonly.html textarea-ref.html
 == textarea-dyn-readonly.html textarea-ref.html
 == textarea-dyn-not-readonly.html textarea-ref.html
 == textarea-maxlength-valid.html textarea-ref.html
 == textarea-maxlength-invalid.html textarea-withtext-ref.html
 == textarea-required-valid.html textarea-withtext-ref.html
 == textarea-required-invalid.html textarea-ref.html
--- a/layout/reftests/forms/input/range/reftest.list
+++ b/layout/reftests/forms/input/range/reftest.list
@@ -12,21 +12,21 @@
 != different-fraction-of-range-unthemed-1.html different-fraction-of-range-unthemed-1-notref.html
 == same-fraction-of-range-unthemed-1.html same-fraction-of-range-unthemed-1-ref.html
 
 # dynamic value changes:
 == value-prop-unthemed.html 75pct-unthemed-common-ref.html
 == value-prop.html 75pct-common-ref.html
 == valueAsNumber-prop-unthemed.html 75pct-unthemed-common-ref.html
 == valueAsNumber-prop.html 75pct-common-ref.html
-fuzzy-if(B2G,1,1) == stepDown-unthemed.html 75pct-unthemed-common-ref.html
-fuzzy-if(B2G,1,1) == stepDown.html 75pct-common-ref.html
+fuzzy-if(B2G,2,1) == stepDown-unthemed.html 75pct-unthemed-common-ref.html
+fuzzy-if(B2G,2,1) == stepDown.html 75pct-common-ref.html
 == stepUp-unthemed.html 75pct-unthemed-common-ref.html
 == stepUp.html 75pct-common-ref.html
-fuzzy-if(B2G,1,1) == max-prop.html 100pct-common-ref.html
+fuzzy-if(B2G,2,1) == max-prop.html 100pct-common-ref.html
 == reset-value.html reset-value-ref.html
 
 # 'direction' property:
 == direction-unthemed-1.html direction-unthemed-1-ref.html
 
 # ::-moz-range-progress pseudo-element:
 fails-if(B2G||Mulet||Android) == moz-range-progress-1.html moz-range-progress-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
 == moz-range-progress-2.html moz-range-progress-2-ref.html