This commit is contained in:
Carsten "Tomcat" Book 2014-04-17 12:56:53 +02:00
Родитель 51c83448d0 064329fc1f
Коммит 4a4d624b6a
73 изменённых файлов: 571 добавлений и 344 удалений

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

@ -1436,15 +1436,21 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
if (tag == nsGkAtoms::abbr || if (tag == nsGkAtoms::abbr ||
tag == nsGkAtoms::acronym || tag == nsGkAtoms::acronym ||
tag == nsGkAtoms::article ||
tag == nsGkAtoms::aside ||
tag == nsGkAtoms::blockquote || tag == nsGkAtoms::blockquote ||
tag == nsGkAtoms::form || tag == nsGkAtoms::form ||
tag == nsGkAtoms::footer ||
tag == nsGkAtoms::header ||
tag == nsGkAtoms::h1 || tag == nsGkAtoms::h1 ||
tag == nsGkAtoms::h2 || tag == nsGkAtoms::h2 ||
tag == nsGkAtoms::h3 || tag == nsGkAtoms::h3 ||
tag == nsGkAtoms::h4 || tag == nsGkAtoms::h4 ||
tag == nsGkAtoms::h5 || tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 || tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::q) { tag == nsGkAtoms::nav ||
tag == nsGkAtoms::q ||
tag == nsGkAtoms::section) {
nsRefPtr<Accessible> accessible = nsRefPtr<Accessible> accessible =
new HyperTextAccessibleWrap(aContent, document); new HyperTextAccessibleWrap(aContent, document);
return accessible.forget(); return accessible.forget();

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

@ -3,7 +3,8 @@ const Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/XPCOMUtils.jsm');
this.EXPORTED_SYMBOLS = ['Roles', 'Events', 'Relations', 'Filters', 'States']; this.EXPORTED_SYMBOLS = ['Roles', 'Events', 'Relations',
'Filters', 'States', 'Prefilters'];
function ConstantsMap (aObject, aPrefix, aMap = {}, aModifier = null) { function ConstantsMap (aObject, aPrefix, aMap = {}, aModifier = null) {
let offset = aPrefix.length; let offset = aPrefix.length;
@ -35,6 +36,12 @@ XPCOMUtils.defineLazyGetter(
return ConstantsMap(Ci.nsIAccessibleRelation, 'RELATION_'); return ConstantsMap(Ci.nsIAccessibleRelation, 'RELATION_');
}); });
XPCOMUtils.defineLazyGetter(
this, 'Prefilters',
function() {
return ConstantsMap(Ci.nsIAccessibleTraversalRule, 'PREFILTER_');
});
XPCOMUtils.defineLazyGetter( XPCOMUtils.defineLazyGetter(
this, 'Filters', this, 'Filters',
function() { function() {

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

@ -19,6 +19,8 @@ XPCOMUtils.defineLazyModuleGetter(this, 'Filters',
'resource://gre/modules/accessibility/Constants.jsm'); 'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'States', XPCOMUtils.defineLazyModuleGetter(this, 'States',
'resource://gre/modules/accessibility/Constants.jsm'); 'resource://gre/modules/accessibility/Constants.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'Prefilters',
'resource://gre/modules/accessibility/Constants.jsm');
let gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images'); let gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images');
@ -146,21 +148,18 @@ var gSimpleMatchFunc = function gSimpleMatchFunc(aAccessible) {
} }
}; };
var gSimplePreFilter = Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT | var gSimplePreFilter = Prefilters.DEFUNCT |
Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE | Prefilters.INVISIBLE |
Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN | Prefilters.ARIA_HIDDEN |
Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT; Prefilters.TRANSPARENT;
this.TraversalRules = { this.TraversalRules = {
Simple: new BaseTraversalRule(gSimpleTraversalRoles, gSimpleMatchFunc), Simple: new BaseTraversalRule(gSimpleTraversalRoles, gSimpleMatchFunc),
SimpleOnScreen: new BaseTraversalRule( SimpleOnScreen: new BaseTraversalRule(
gSimpleTraversalRoles, gSimpleMatchFunc, gSimpleTraversalRoles, gSimpleMatchFunc,
Ci.nsIAccessibleTraversalRule.PREFILTER_DEFUNCT | Prefilters.DEFUNCT | Prefilters.INVISIBLE | Prefilters.ARIA_HIDDEN |
Ci.nsIAccessibleTraversalRule.PREFILTER_INVISIBLE | Prefilters.TRANSPARENT | Prefilters.OFFSCREEN),
Ci.nsIAccessibleTraversalRule.PREFILTER_ARIA_HIDDEN |
Ci.nsIAccessibleTraversalRule.PREFILTER_TRANSPARENT |
Ci.nsIAccessibleTraversalRule.PREFILTER_OFFSCREEN),
Anchor: new BaseTraversalRule( Anchor: new BaseTraversalRule(
[Roles.LINK], [Roles.LINK],

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

@ -29,6 +29,15 @@
testRole("aside", ROLE_NOTE); testRole("aside", ROLE_NOTE);
testRole("section", ROLE_SECTION); testRole("section", ROLE_SECTION);
// Bug 996821
// Check that landmark elements get accessibles with styled overflow.
testRole("section_overflow", ROLE_SECTION);
testRole("nav_overflow", ROLE_SECTION);
testRole("header_overflow", ROLE_HEADER);
testRole("aside_overflow", ROLE_NOTE);
testRole("footer_overflow", ROLE_FOOTER);
testRole("article_overflow", ROLE_DOCUMENT);
// test html:div // test html:div
testRole("sec", ROLE_SECTION); testRole("sec", ROLE_SECTION);
@ -127,6 +136,19 @@
<aside id="aside">by the way I am an aside</aside> <aside id="aside">by the way I am an aside</aside>
<section id="section">a section</section> <section id="section">a section</section>
<section style="overflow: hidden;" id="section_overflow">
<nav style="overflow: hidden;"
id="nav_overflow">overflow nav</nav>
<header style="overflow: hidden;"
id="header_overflow">overflow header</header>
<aside style="overflow: hidden;"
id="aside_overflow">overflow aside</aside>
<footer style="overflow: hidden;"
id="footer_overflow">overflow footer</footer>
</section>
<article style="overflow: hidden;"
id="article_overflow">overflow article</article>
<p id="p">A paragraph for comparison.</p> <p id="p">A paragraph for comparison.</p>
<div id="sec">A normal div</div> <div id="sec">A normal div</div>
<blockquote id="quote">A citation</blockquote> <blockquote id="quote">A citation</blockquote>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="55bcc2d7e44dc805c24b57d1e783fc26e8a2ee86"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="55bcc2d7e44dc805c24b57d1e783fc26e8a2ee86"/>

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

@ -17,7 +17,7 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
@ -131,6 +131,6 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="f8e49f3837230cfbb2d6fbcf239d1f25b57b39a7"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="f8e49f3837230cfbb2d6fbcf239d1f25b57b39a7"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/> <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="72e3a520e3c700839f07ba0113fd527b923c3330"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="72e3a520e3c700839f07ba0113fd527b923c3330"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="3b002889eca9e47f77ef10af44619c8c56df069b"/> <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="6a7ada569fd37c09ed4bbee6eb78cea5b467b229"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/> <project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
</manifest> </manifest>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52c909ccead537f8f9dbf634f3e6639078a8b0bd"> <project name="platform_build" path="build" remote="b2g" revision="52c909ccead537f8f9dbf634f3e6639078a8b0bd">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="55bcc2d7e44dc805c24b57d1e783fc26e8a2ee86"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="55bcc2d7e44dc805c24b57d1e783fc26e8a2ee86"/>

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

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>

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

@ -4,6 +4,6 @@
"remote": "", "remote": "",
"branch": "" "branch": ""
}, },
"revision": "e1fc74c2ae523e7cce5be01e1a29b43defaec124", "revision": "35bd8bfb0ee9dce0eb9dcfdbb43587517b655121",
"repo_path": "/integration/gaia-central" "repo_path": "/integration/gaia-central"
} }

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -17,7 +17,7 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8d6c36d74ba9aefbc8c3618fc93dd4907a0dbf5e"/>
@ -127,7 +127,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/> <project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/> <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/> <project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="3b002889eca9e47f77ef10af44619c8c56df069b"/> <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="6a7ada569fd37c09ed4bbee6eb78cea5b467b229"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/> <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/> <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/> <project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="7591e9dc782ac2e97d63a96f9deb71c7b3588328"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="dadf0e60a6421f5b57ee9fc536c6617212805c19"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -34,14 +34,14 @@
<preference id="browser.download.useDownloadDir" <preference id="browser.download.useDownloadDir"
name="browser.download.useDownloadDir" name="browser.download.useDownloadDir"
type="bool"/> type="bool"/>
<preference id="browser.download.folderList"
name="browser.download.folderList"
type="int"/>
<preference id="browser.download.dir" <preference id="browser.download.dir"
name="browser.download.dir" name="browser.download.dir"
type="file" type="file"
onchange="gMainPane.displayDownloadDirPref();"/> onchange="gMainPane.displayDownloadDirPref();"/>
<preference id="browser.download.folderList"
name="browser.download.folderList"
type="int"/>
<!-- Tab preferences <!-- Tab preferences
Preferences: Preferences:

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

@ -1,7 +1,7 @@
// this will take strings_to_send.length*500 ms = 5 sec // this will take strings_to_send.length*500 ms = 5 sec
var timer = null; var timer = null;
var strings_to_send = ["data\r\n\nda", "ta", ":", "de", "layed1\n\n", var strings_to_send = ["retry:999999999\ndata\r\n\nda", "ta", ":", "de", "layed1\n\n",
"", "",
"", "",
"data:delayed2\n\n", "", ""]; "data:delayed2\n\n", "", ""];

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

@ -37,7 +37,7 @@ namespace mozilla {
* Even though the ring buffer is divided into fixed size slots, it still can * Even though the ring buffer is divided into fixed size slots, it still can
* store the data which size is larger than one slot size. * store the data which size is larger than one slot size.
* */ * */
#define BUFFER_SLOT_NUM 8192 #define BUFFER_SLOT_NUM 512
#define BUFFER_SLOT_DEFAULT_SIZE 256 #define BUFFER_SLOT_DEFAULT_SIZE 256
#define BUFFER_SLOT_MAX_SIZE 8192 #define BUFFER_SLOT_MAX_SIZE 8192
#define BUFFER_SLOT_INVALID -1 #define BUFFER_SLOT_INVALID -1

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

@ -819,6 +819,8 @@ InterAppCommService.prototype = {
// To prevent the hacked child process from sending commands to parent // To prevent the hacked child process from sending commands to parent
// to do illegal connections, we need to check its manifest URL. // to do illegal connections, we need to check its manifest URL.
if (aMessage.name !== "child-process-shutdown" && if (aMessage.name !== "child-process-shutdown" &&
// TODO: fix bug 988142 to re-enable "InterAppMessagePort:Unregister".
aMessage.name !== "InterAppMessagePort:Unregister" &&
kMessages.indexOf(aMessage.name) != -1) { kMessages.indexOf(aMessage.name) != -1) {
if (!target.assertContainApp(message.manifestURL)) { if (!target.assertContainApp(message.manifestURL)) {
if (DEBUG) { if (DEBUG) {

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

@ -1392,6 +1392,13 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex,
return; return;
} }
// aCallIndex can be UINT32_MAX for the pending outgoing call state update.
// aCallIndex will be updated again after real call state changes. See Bug
// 990467.
if (aCallIndex == UINT32_MAX) {
return;
}
while (aCallIndex >= mCurrentCallArray.Length()) { while (aCallIndex >= mCurrentCallArray.Length()) {
Call call; Call call;
mCurrentCallArray.AppendElement(call); mCurrentCallArray.AppendElement(call);

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

@ -139,6 +139,8 @@ nsGonkCameraControl::Initialize()
// Set preferred preview frame format. // Set preferred preview frame format.
mParams.Set(CAMERA_PARAM_PREVIEWFORMAT, NS_LITERAL_STRING("yuv420sp")); mParams.Set(CAMERA_PARAM_PREVIEWFORMAT, NS_LITERAL_STRING("yuv420sp"));
// Turn off any normal pictures returned by the HDR scene mode
mParams.Set(CAMERA_PARAM_SCENEMODE_HDR_RETURNNORMALPICTURE, false);
PushParametersImpl(); PushParametersImpl();
// Grab any other settings we'll need later. // Grab any other settings we'll need later.

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

@ -147,7 +147,6 @@ protected:
bool mFlashSupported; bool mFlashSupported;
bool mLuminanceSupported; bool mLuminanceSupported;
bool mAutoFlashModeOverridden; bool mAutoFlashModeOverridden;
Atomic<uint32_t> mDeferConfigUpdate; Atomic<uint32_t> mDeferConfigUpdate;
GonkCameraParameters mParams; GonkCameraParameters mParams;

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

@ -81,6 +81,10 @@ GonkCameraParameters::Parameters::GetTextKey(uint32_t aKey)
return "iso"; return "iso";
case CAMERA_PARAM_LUMINANCE: case CAMERA_PARAM_LUMINANCE:
return "luminance-condition"; return "luminance-condition";
case CAMERA_PARAM_SCENEMODE_HDR_RETURNNORMALPICTURE:
// Not every platform defines KEY_QC_HDR_NEED_1X;
// for those that don't, we use the raw string key.
return "hdr-need-1x";
case CAMERA_PARAM_SUPPORTED_PREVIEWSIZES: case CAMERA_PARAM_SUPPORTED_PREVIEWSIZES:
return KEY_SUPPORTED_PREVIEW_SIZES; return KEY_SUPPORTED_PREVIEW_SIZES;
@ -685,6 +689,19 @@ GonkCameraParameters::GetTranslated(uint32_t aKey, uint32_t& aValue)
return NS_OK; return NS_OK;
} }
// Handle bools
nsresult
GonkCameraParameters::SetTranslated(uint32_t aKey, const bool& aValue)
{
return SetImpl(aKey, aValue);
}
nsresult
GonkCameraParameters::GetTranslated(uint32_t aKey, bool& aValue)
{
return GetImpl(aKey, aValue);
}
nsresult nsresult
ParseItem(const char* aStart, const char* aEnd, ICameraControl::Size* aItem) ParseItem(const char* aStart, const char* aEnd, ICameraControl::Size* aItem)
{ {

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

@ -103,13 +103,18 @@ protected:
{ {
public: public:
using android::CameraParameters::set; using android::CameraParameters::set;
using android::CameraParameters::get;
using android::CameraParameters::TRUE;
using android::CameraParameters::FALSE;
void set(const char* aKey, float aValue) { setFloat(aKey, aValue); } void set(const char* aKey, float aValue) { setFloat(aKey, aValue); }
void set(const char* aKey, double aValue) { setFloat(aKey, aValue); } void set(const char* aKey, double aValue) { setFloat(aKey, aValue); }
void set(const char* aKey, bool aValue) { set(aKey, aValue ? TRUE : FALSE); }
void get(const char* aKey, float& aRet) { aRet = getFloat(aKey); } void get(const char* aKey, float& aRet) { aRet = getFloat(aKey); }
void get(const char* aKey, double& aRet) { aRet = getFloat(aKey); } void get(const char* aKey, double& aRet) { aRet = getFloat(aKey); }
void get(const char* aKey, const char*& aRet) { aRet = android::CameraParameters::get(aKey); } void get(const char* aKey, const char*& aRet) { aRet = get(aKey); }
void get(const char* aKey, int& aRet) { aRet = getInt(aKey); } void get(const char* aKey, int& aRet) { aRet = getInt(aKey); }
void get(const char* aKey, bool& aRet) { aRet = strcmp(get(aKey), FALSE); }
static const char* GetTextKey(uint32_t aKey); static const char* GetTextKey(uint32_t aKey);
}; };
@ -173,6 +178,8 @@ protected:
nsresult GetTranslated(uint32_t aKey, int& aValue); nsresult GetTranslated(uint32_t aKey, int& aValue);
nsresult SetTranslated(uint32_t aKey, const uint32_t& aValue); nsresult SetTranslated(uint32_t aKey, const uint32_t& aValue);
nsresult GetTranslated(uint32_t aKey, uint32_t& aValue); nsresult GetTranslated(uint32_t aKey, uint32_t& aValue);
nsresult SetTranslated(uint32_t aKey, const bool& aValue);
nsresult GetTranslated(uint32_t aKey, bool& aValue);
nsresult GetTranslated(uint32_t aKey, nsTArray<nsString>& aValues); nsresult GetTranslated(uint32_t aKey, nsTArray<nsString>& aValues);
nsresult GetTranslated(uint32_t aKey, nsTArray<double>& aValues); nsresult GetTranslated(uint32_t aKey, nsTArray<double>& aValues);

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

@ -51,6 +51,7 @@ enum {
CAMERA_PARAM_SENSORANGLE, CAMERA_PARAM_SENSORANGLE,
CAMERA_PARAM_ISOMODE, CAMERA_PARAM_ISOMODE,
CAMERA_PARAM_LUMINANCE, CAMERA_PARAM_LUMINANCE,
CAMERA_PARAM_SCENEMODE_HDR_RETURNNORMALPICTURE,
// supported features // supported features
CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, CAMERA_PARAM_SUPPORTED_PREVIEWSIZES,

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

@ -94,12 +94,15 @@ var findResult1;
function verifyBlob(blob1, blob2, isLast) function verifyBlob(blob1, blob2, isLast)
{ {
is(blob1 instanceof SpecialPowers.Ci.nsIDOMBlob, true, is(blob1 instanceof SpecialPowers.Ci.nsIDOMBlob, true,
"Instance of nsIDOMBlob"); "blob1 is an instance of nsIDOMBlob");
is(blob1 instanceof SpecialPowers.Ci.nsIDOMFile, is(blob2 instanceof SpecialPowers.Ci.nsIDOMBlob, true,
blob2 instanceof SpecialPowers.Ci.nsIDOMFile, "blob2 is an instance of nsIDOMBlob");
"Instance of nsIDOMFile"); isnot(blob1 instanceof SpecialPowers.Ci.nsIDOMFile, true,
is(blob1.size, blob2.size, "Correct size"); "blob1 is an instance of nsIDOMFile");
is(blob1.type, blob2.type, "Correct type"); isnot(blob2 instanceof SpecialPowers.Ci.nsIDOMFile, true,
"blob2 is an instance of nsIDOMFile");
ise(blob1.size, blob2.size, "Same size");
ise(blob1.type, blob2.type, "Same type");
var buffer1; var buffer1;
var buffer2; var buffer2;
@ -125,16 +128,18 @@ function verifyBlob(blob1, blob2, isLast)
function verifyBlobArray(blobs1, blobs2) function verifyBlobArray(blobs1, blobs2)
{ {
is(blobs1 instanceof Array, true, "Got an array object"); is(blobs1 instanceof Array, true, "blobs1 is an array object");
is(blobs1.length, blobs2.length, "Correct length"); is(blobs2 instanceof Array, true, "blobs2 is an array object");
ise(blobs1.length, blobs2.length, "Same length");
if (!blobs1.length) { if (!blobs1.length) {
next(); next();
return; return;
} }
for (var i = 0; i < blobs1.length; i++) for (var i = 0; i < blobs1.length; i++) {
verifyBlob(blobs1[i], blobs2[i], i == blobs1.length - 1); verifyBlob(blobs1[i], blobs2[i], i == blobs1.length - 1);
}
} }
var req; var req;
@ -170,7 +175,7 @@ var steps = [
ok(req.result.length == 1, "Found exactly 1 contact."); ok(req.result.length == 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ok(findResult1.id == sample_id1, "Same ID"); ok(findResult1.id == sample_id1, "Same ID");
verifyBlobArray(createResult1.photo, properties1.photo); verifyBlobArray(findResult1.photo, properties1.photo);
}; };
req.onerror = onFailure; req.onerror = onFailure;
}, },
@ -195,7 +200,7 @@ var steps = [
ok(req.result.length == 1, "Found exactly 1 contact."); ok(req.result.length == 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ok(findResult1.id == sample_id1, "Same ID"); ok(findResult1.id == sample_id1, "Same ID");
verifyBlobArray(createResult1.photo, properties2.photo); verifyBlobArray(findResult1.photo, properties2.photo);
}; };
req.onerror = onFailure; req.onerror = onFailure;
}, },

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

@ -8,7 +8,6 @@
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PopupNotifications.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PeerConnectionIdp", XPCOMUtils.defineLazyModuleGetter(this, "PeerConnectionIdp",
"resource://gre/modules/media/PeerConnectionIdp.jsm"); "resource://gre/modules/media/PeerConnectionIdp.jsm");

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

@ -74,6 +74,8 @@ function wrapDomRequestAsPromise(aRequest) {
return deferred.promise; return deferred.promise;
} }
let workingFrame;
/** /**
* Get mozSettings value specified by @aKey. * Get mozSettings value specified by @aKey.
* *
@ -93,7 +95,8 @@ function wrapDomRequestAsPromise(aRequest) {
* @return A deferred promise. * @return A deferred promise.
*/ */
function getSettings(aKey, aAllowError) { function getSettings(aKey, aAllowError) {
let request = navigator.mozSettings.createLock().get(aKey); let request =
workingFrame.contentWindow.navigator.mozSettings.createLock().get(aKey);
return wrapDomRequestAsPromise(request) return wrapDomRequestAsPromise(request)
.then(function resolve(aEvent) { .then(function resolve(aEvent) {
ok(true, "getSettings(" + aKey + ") - success"); ok(true, "getSettings(" + aKey + ") - success");
@ -120,7 +123,8 @@ function getSettings(aKey, aAllowError) {
* @return A deferred promise. * @return A deferred promise.
*/ */
function setSettings(aSettings, aAllowError) { function setSettings(aSettings, aAllowError) {
let request = navigator.mozSettings.createLock().set(aSettings); let request =
workingFrame.contentWindow.navigator.mozSettings.createLock().set(aSettings);
return wrapDomRequestAsPromise(request) return wrapDomRequestAsPromise(request)
.then(function resolve() { .then(function resolve() {
ok(true, "setSettings(" + JSON.stringify(aSettings) + ")"); ok(true, "setSettings(" + JSON.stringify(aSettings) + ")");
@ -195,7 +199,6 @@ function setDataApnSettings(aApnSettings, aAllowError) {
return setSettings1(SETTINGS_KEY_DATA_APN_SETTINGS, aApnSettings, aAllowError); return setSettings1(SETTINGS_KEY_DATA_APN_SETTINGS, aApnSettings, aAllowError);
} }
let workingFrame;
let mobileConnection; let mobileConnection;
/** /**
@ -282,7 +285,8 @@ function waitForManagerEvent(aEventName, aServiceId) {
let mobileConn = mobileConnection; let mobileConn = mobileConnection;
if (aServiceId !== undefined) { if (aServiceId !== undefined) {
mobileConn = navigator.mozMobileConnections[aServiceId]; mobileConn =
workingFrame.contentWindow.navigator.mozMobileConnections[aServiceId];
} }
mobileConn.addEventListener(aEventName, function onevent(aEvent) { mobileConn.addEventListener(aEventName, function onevent(aEvent) {
@ -407,7 +411,8 @@ function setDataEnabledAndWait(aEnabled, aServiceId) {
Promise.all(promises).then(function keepWaiting() { Promise.all(promises).then(function keepWaiting() {
let mobileConn = mobileConnection; let mobileConn = mobileConnection;
if (aServiceId !== undefined) { if (aServiceId !== undefined) {
mobileConn = navigator.mozMobileConnections[aServiceId]; mobileConn =
workingFrame.contentWindow.navigator.mozMobileConnections[aServiceId];
} }
// To ignore some transient states, we only resolve that deferred promise // To ignore some transient states, we only resolve that deferred promise
// when the |connected| state equals to the expected one and never rejects. // when the |connected| state equals to the expected one and never rejects.
@ -467,7 +472,8 @@ function setEmulatorRoamingAndWait(aRoaming, aServiceId) {
.then(() => { .then(() => {
let mobileConn = mobileConnection; let mobileConn = mobileConnection;
if (aServiceId !== undefined) { if (aServiceId !== undefined) {
mobileConn = navigator.mozMobileConnections[aServiceId]; mobileConn =
workingFrame.contentWindow.navigator.mozMobileConnections[aServiceId];
} }
is(mobileConn[aWhich].roaming, aRoaming, is(mobileConn[aWhich].roaming, aRoaming,
aWhich + ".roaming") aWhich + ".roaming")

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

@ -6,8 +6,8 @@ MARIONETTE_HEAD_JS = "head.js";
const SETTINGS_KEY_DATA_DEFAULT_ID = "ril.data.defaultServiceId"; const SETTINGS_KEY_DATA_DEFAULT_ID = "ril.data.defaultServiceId";
let connections = window.navigator.mozMobileConnections; let connections;
let numOfRadioInterfaces = getNumOfRadioInterfaces(); let numOfRadioInterfaces;
let currentDataDefaultId = 0; let currentDataDefaultId = 0;
function muxModem(id) { function muxModem(id) {
@ -142,6 +142,9 @@ function testDisableData() {
} }
startDSDSTestCommon(function() { startDSDSTestCommon(function() {
connections = workingFrame.contentWindow.navigator.mozMobileConnections;
numOfRadioInterfaces = getNumOfRadioInterfaces();
return testEnableData() return testEnableData()
.then(testSwitchDefaultDataToSimTwo) .then(testSwitchDefaultDataToSimTwo)
.then(testDisableDataRoamingWhileRoaming) .then(testDisableDataRoamingWhileRoaming)

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

@ -8,6 +8,6 @@ startTestCommon(function() {
let connections = let connections =
workingFrame.contentWindow.navigator.mozMobileConnections; workingFrame.contentWindow.navigator.mozMobileConnections;
let num = SpecialPowers.getIntPref("ril.numRadioInterfaces"); let num = getNumOfRadioInterfaces();
is(connections.length, num, "ril.numRadioInterfaces"); is(connections.length, num, "ril.numRadioInterfaces");
}); });

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

@ -229,7 +229,11 @@ GetRetainedImageFromSourceSurface(SourceSurface *aSurface)
TemporaryRef<SourceSurface> TemporaryRef<SourceSurface>
DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const
{ {
return nullptr; if (aSurface->GetType() == SurfaceType::COREGRAPHICS_IMAGE ||
aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT) {
return aSurface;
}
return aSurface->GetDataSurface();
} }
class UnboundnessFixer class UnboundnessFixer

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

@ -1204,8 +1204,27 @@ DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData,
TemporaryRef<SourceSurface> TemporaryRef<SourceSurface>
DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const
{ {
// Unsupported! if (aSurface->GetType() == SurfaceType::D2D1_BITMAP ||
return nullptr; aSurface->GetType() == SurfaceType::D2D1_DRAWTARGET) {
return aSurface;
}
RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
DataSourceSurface::MappedSurface map;
if (!data->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}
RefPtr<SourceSurfaceD2D> newSurf = new SourceSurfaceD2D();
bool success = newSurf->InitFromData(map.mData, data->GetSize(), map.mStride, data->GetFormat(), mRT);
data->Unmap();
if (!success) {
return nullptr;
}
return newSurf;
} }
TemporaryRef<SourceSurface> TemporaryRef<SourceSurface>

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

@ -921,6 +921,34 @@ DrawTargetD2D1::GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTrans
return image; return image;
} }
TemporaryRef<SourceSurface>
DrawTargetD2D1::OptimizeSourceSurface(SourceSurface* aSurface) const
{
if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) {
return aSurface;
}
RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
DataSourceSurface::MappedSurface map;
if (!data->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}
RefPtr<ID2D1Bitmap1> bitmap;
HRESULT hr = mDC->CreateBitmap(D2DIntSize(data->GetSize()), map.mData, map.mStride,
D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE, D2DPixelFormat(data->GetFormat())),
byRef(bitmap));
data->Unmap();
if (!bitmap) {
return nullptr;
}
return new SourceSurfaceD2D1(bitmap.get(), mDC, data->GetFormat(), data->GetSize());
}
void void
DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform) DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform)
{ {

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

@ -104,7 +104,7 @@ public:
const IntSize &aSize, const IntSize &aSize,
int32_t aStride, int32_t aStride,
SurfaceFormat aFormat) const; SurfaceFormat aFormat) const;
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const { return nullptr; } virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
virtual TemporaryRef<SourceSurface> virtual TemporaryRef<SourceSurface>
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return nullptr; } CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return nullptr; }

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

@ -602,16 +602,7 @@ DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const
return aSurface; return aSurface;
} }
if (aSurface->GetType() != SurfaceType::DATA) { return aSurface->GetDataSurface();
return nullptr;
}
RefPtr<DataSourceSurface> data = aSurface->GetDataSurface();
RefPtr<SourceSurface> surface = CreateSourceSurfaceFromData(data->GetData(),
data->GetSize(),
data->Stride(),
data->GetFormat());
return data.forget();
} }
TemporaryRef<SourceSurface> TemporaryRef<SourceSurface>

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

@ -432,7 +432,7 @@ public:
template<size_t N> template<size_t N>
static void InitializeExtensionsBitSet(std::bitset<N>& extensionsBitset, const char* extStr, const char** extList, bool verbose = false) static void InitializeExtensionsBitSet(std::bitset<N>& extensionsBitset, const char* extStr, const char** extList, bool verbose = false)
{ {
char* exts = strdup(extStr); char* exts = ::strdup(extStr);
if (verbose) if (verbose)
printf_stderr("Extensions: %s\n", exts); printf_stderr("Extensions: %s\n", exts);

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

@ -6024,15 +6024,20 @@ StackArgBytes(const VectorT &argTypes)
return iter.stackBytesConsumedSoFar(); return iter.stackBytesConsumedSoFar();
} }
static unsigned
StackDecrementForCall(MacroAssembler &masm, unsigned bytesToPush)
{
// Include extra padding so that, after pushing the bytesToPush,
// the stack is aligned for a call instruction.
unsigned alreadyPushed = AlignmentAtPrologue + masm.framePushed();
return AlignBytes(alreadyPushed + bytesToPush, StackAlignment) - alreadyPushed;
}
template <class VectorT> template <class VectorT>
static unsigned static unsigned
StackDecrementForCall(MacroAssembler &masm, const VectorT &argTypes, unsigned extraBytes = 0) StackDecrementForCall(MacroAssembler &masm, const VectorT &argTypes, unsigned extraBytes = 0)
{ {
// Include extra padding so that, after pushing the arguments and return StackDecrementForCall(masm, StackArgBytes(argTypes) + extraBytes);
// extraBytes, the stack is aligned for a call instruction.
unsigned argBytes = StackArgBytes(argTypes);
unsigned alreadyPushed = AlignmentAtPrologue + masm.framePushed();
return AlignBytes(alreadyPushed + extraBytes + argBytes, StackAlignment) - alreadyPushed;
} }
static const unsigned FramePushedAfterSave = NonVolatileRegs.gprs().size() * sizeof(intptr_t) + static const unsigned FramePushedAfterSave = NonVolatileRegs.gprs().size() * sizeof(intptr_t) +
@ -6300,8 +6305,10 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript
masm.align(CodeAlignment); masm.align(CodeAlignment);
m.setInterpExitOffset(exitIndex); m.setInterpExitOffset(exitIndex);
masm.setFramePushed(0); masm.setFramePushed(0);
#if defined(JS_CODEGEN_ARM)
masm.Push(lr);
#endif
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
MIRType typeArray[] = { MIRType_Pointer, // cx MIRType typeArray[] = { MIRType_Pointer, // cx
MIRType_Pointer, // exitDatum MIRType_Pointer, // exitDatum
MIRType_Int32, // argc MIRType_Int32, // argc
@ -6316,7 +6323,7 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript
masm.reserveStack(stackDec); masm.reserveStack(stackDec);
// Fill the argument array. // Fill the argument array.
unsigned offsetToCallerStackArgs = NativeFrameSize + masm.framePushed(); unsigned offsetToCallerStackArgs = AlignmentAtPrologue + masm.framePushed();
unsigned offsetToArgv = StackArgBytes(invokeArgTypes); unsigned offsetToArgv = StackArgBytes(invokeArgTypes);
Register scratch = ABIArgGenerator::NonArgReturnVolatileReg0; Register scratch = ABIArgGenerator::NonArgReturnVolatileReg0;
FillArgumentArray(m, exit.sig().args(), offsetToArgv, offsetToCallerStackArgs, scratch); FillArgumentArray(m, exit.sig().args(), offsetToArgv, offsetToCallerStackArgs, scratch);
@ -6387,59 +6394,6 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript
// registers to restore. // registers to restore.
masm.freeStack(stackDec); masm.freeStack(stackDec);
masm.ret(); masm.ret();
#else
const unsigned arrayLength = Max<size_t>(1, exit.sig().args().length());
const unsigned arraySize = arrayLength * sizeof(Value);
const unsigned reserveSize = AlignBytes(arraySize, StackAlignment) +
ShadowStackSpace;
const unsigned callerArgsOffset = reserveSize + NativeFrameSize + sizeof(int32_t);
masm.setFramePushed(0);
masm.Push(lr);
masm.reserveStack(reserveSize + sizeof(int32_t));
// Store arguments
FillArgumentArray(m, exit.sig().args(), ShadowStackSpace, callerArgsOffset, IntArgReg0);
// argument 0: cx
Register activation = IntArgReg3;
LoadAsmJSActivationIntoRegister(masm, activation);
LoadJSContextFromActivation(masm, activation, IntArgReg0);
// argument 1: exitIndex
masm.mov(ImmWord(exitIndex), IntArgReg1);
// argument 2: argc
masm.mov(ImmWord(exit.sig().args().length()), IntArgReg2);
// argument 3: argv
Address argv(StackPointer, ShadowStackSpace);
masm.lea(Operand(argv), IntArgReg3);
AssertStackAlignment(masm);
switch (exit.sig().retType().which()) {
case RetType::Void:
masm.call(AsmJSImm_InvokeFromAsmJS_Ignore);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
break;
case RetType::Signed:
masm.call(AsmJSImm_InvokeFromAsmJS_ToInt32);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
masm.unboxInt32(argv, ReturnReg);
break;
case RetType::Double:
masm.call(AsmJSImm_InvokeFromAsmJS_ToNumber);
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
masm.loadDouble(argv, ReturnFloatReg);
break;
case RetType::Float:
MOZ_ASSUME_UNREACHABLE("Float32 shouldn't be returned from a FFI");
break;
}
masm.freeStack(reserveSize + sizeof(int32_t));
masm.ret();
#endif
} }
static void static void
@ -6452,11 +6406,8 @@ GenerateOOLConvert(ModuleCompiler &m, RetType retType, Label *throwLabel)
MIRTypeVector callArgTypes(m.cx()); MIRTypeVector callArgTypes(m.cx());
callArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray)); callArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray));
// Reserve space for a call to InvokeFromAsmJS_* and an array of values // The stack is assumed to be aligned. The frame is allocated by GenerateFFIIonExit and
// passed to this FFI call. // the stack usage here needs to kept in sync with GenerateFFIIonExit.
unsigned arraySize = sizeof(Value);
unsigned stackDec = StackDecrementForCall(masm, callArgTypes, arraySize);
masm.reserveStack(stackDec);
// Store value // Store value
unsigned offsetToArgv = StackArgBytes(callArgTypes); unsigned offsetToArgv = StackArgBytes(callArgTypes);
@ -6504,8 +6455,6 @@ GenerateOOLConvert(ModuleCompiler &m, RetType retType, Label *throwLabel)
default: default:
MOZ_ASSUME_UNREACHABLE("Unsupported convert type"); MOZ_ASSUME_UNREACHABLE("Unsupported convert type");
} }
masm.freeStack(stackDec);
} }
static void static void
@ -6517,29 +6466,57 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
m.setIonExitOffset(exitIndex); m.setIonExitOffset(exitIndex);
masm.setFramePushed(0); masm.setFramePushed(0);
RegisterSet restoreSet = RegisterSet::Intersect(RegisterSet::All(), #if defined(JS_CODEGEN_X64)
RegisterSet::Not(RegisterSet::Volatile())); masm.Push(HeapReg);
#if defined(JS_CODEGEN_ARM) #elif defined(JS_CODEGEN_ARM)
masm.Push(lr); // The lr register holds the return address and needs to be saved. The GlobalReg
// (r10) and HeapReg (r11) also need to be restored before returning to asm.js code.
// The NANReg also needs to be restored, but is a constant and is reloaded before
// returning to asm.js code.
masm.PushRegsInMask(RegisterSet(GeneralRegisterSet((1<<GlobalReg.code()) |
(1<<HeapReg.code()) |
(1<<lr.code())),
FloatRegisterSet(uint32_t(0))));
#endif #endif
masm.PushRegsInMask(restoreSet);
// Arguments are in the following order on the stack: // The stack frame is used for the call into Ion and also for calls into C for OOL
// conversion of the result. A frame large enough for both is allocated.
//
// Arguments to the Ion function are in the following order on the stack:
// descriptor | callee | argc | this | arg1 | arg2 | ... // descriptor | callee | argc | this | arg1 | arg2 | ...
// Reserve and align space for the arguments
MIRTypeVector emptyVector(m.cx());
unsigned argBytes = 3 * sizeof(size_t) + (1 + exit.sig().args().length()) * sizeof(Value); unsigned argBytes = 3 * sizeof(size_t) + (1 + exit.sig().args().length()) * sizeof(Value);
unsigned extraBytes = 0;
// On ARM, we call with ma_callIonNoPush which, following the Ion calling convention,
// stores the return address into *sp. This means we need to include an extra word of
// space before the arguments in the stack allocation. (On x86/x64, the call
// instruction does the push itself and the ABI just requires us to be aligned before
// the call instruction.)
unsigned offsetToArgs = 0;
#if defined(JS_CODEGEN_ARM) #if defined(JS_CODEGEN_ARM)
extraBytes += sizeof(size_t); offsetToArgs += sizeof(size_t);
#endif #endif
unsigned stackDec = StackDecrementForCall(masm, emptyVector, argBytes + extraBytes);
masm.reserveStack(stackDec - extraBytes); unsigned stackDecForIonCall = StackDecrementForCall(masm, argBytes + offsetToArgs);
// Reserve space for a call to AsmJSImm_CoerceInPlace_* and an array of values used by
// OOLConvert which reuses the same frame. This code needs to be kept in sync with the
// stack usage in GenerateOOLConvert.
MIRType typeArray[] = { MIRType_Pointer, MIRType_Pointer }; // cx, argv
MIRTypeVector callArgTypes(m.cx());
callArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray));
unsigned stackDecForOOLCall = StackDecrementForCall(masm, callArgTypes, sizeof(Value));
// Allocate a frame large enough for both of the above calls.
unsigned stackDec = Max(stackDecForIonCall, stackDecForOOLCall);
masm.reserveStack(stackDec);
AssertStackAlignment(masm);
// 1. Descriptor // 1. Descriptor
uint32_t descriptor = MakeFrameDescriptor(masm.framePushed() + extraBytes, JitFrame_Entry); size_t argOffset = offsetToArgs;
masm.storePtr(ImmWord(uintptr_t(descriptor)), Address(StackPointer, 0)); uint32_t descriptor = MakeFrameDescriptor(masm.framePushed(), JitFrame_Entry);
masm.storePtr(ImmWord(uintptr_t(descriptor)), Address(StackPointer, argOffset));
argOffset += sizeof(size_t);
// 2. Callee // 2. Callee
Register callee = ABIArgGenerator::NonArgReturnVolatileReg0; Register callee = ABIArgGenerator::NonArgReturnVolatileReg0;
@ -6561,24 +6538,26 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
masm.loadPtr(Address(callee, offsetof(AsmJSModule::ExitDatum, fun)), callee); masm.loadPtr(Address(callee, offsetof(AsmJSModule::ExitDatum, fun)), callee);
// 2.3. Save callee // 2.3. Save callee
masm.storePtr(callee, Address(StackPointer, sizeof(size_t))); masm.storePtr(callee, Address(StackPointer, argOffset));
argOffset += sizeof(size_t);
// 3. Argc // 3. Argc
unsigned argc = exit.sig().args().length(); unsigned argc = exit.sig().args().length();
masm.storePtr(ImmWord(uintptr_t(argc)), Address(StackPointer, 2 * sizeof(size_t))); masm.storePtr(ImmWord(uintptr_t(argc)), Address(StackPointer, argOffset));
argOffset += sizeof(size_t);
// 4. |this| value // 4. |this| value
masm.storeValue(UndefinedValue(), Address(StackPointer, 3 * sizeof(size_t))); masm.storeValue(UndefinedValue(), Address(StackPointer, argOffset));
argOffset += sizeof(Value);
// 5. Fill the arguments // 5. Fill the arguments
unsigned offsetToArgs = 3 * sizeof(size_t) + sizeof(Value);
unsigned offsetToCallerStackArgs = masm.framePushed(); unsigned offsetToCallerStackArgs = masm.framePushed();
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) #if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
offsetToCallerStackArgs += NativeFrameSize; offsetToCallerStackArgs += NativeFrameSize;
#else
offsetToCallerStackArgs += ShadowStackSpace;
#endif #endif
FillArgumentArray(m, exit.sig().args(), offsetToArgs, offsetToCallerStackArgs, scratch); FillArgumentArray(m, exit.sig().args(), argOffset, offsetToCallerStackArgs, scratch);
argOffset += exit.sig().args().length() * sizeof(Value);
JS_ASSERT(argOffset == offsetToArgs + argBytes);
// Get the pointer to the ion code // Get the pointer to the ion code
Label done, oolConvert; Label done, oolConvert;
@ -6590,36 +6569,94 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
masm.branchIfFunctionHasNoScript(callee, &ionFailed); masm.branchIfFunctionHasNoScript(callee, &ionFailed);
#endif #endif
masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrScript()), scratch); masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrScript()), callee);
masm.loadBaselineOrIonNoArgCheck(scratch, scratch, SequentialExecution, maybeDebugBreakpoint); masm.loadBaselineOrIonNoArgCheck(callee, callee, SequentialExecution, maybeDebugBreakpoint);
LoadAsmJSActivationIntoRegister(masm, callee); AssertStackAlignment(masm);
masm.push(scratch);
masm.setupUnalignedABICall(1, scratch); {
masm.passABIArg(callee); // Enable Activation.
masm.callWithABI(AsmJSImm_EnableActivationFromAsmJS); //
masm.pop(scratch); // This sequence requires four registers, and needs to preserve the 'callee'
// register, so there are five live registers.
JS_ASSERT(callee == AsmJSIonExitRegCallee);
Register reg0 = AsmJSIonExitRegE0;
Register reg1 = AsmJSIonExitRegE1;
Register reg2 = AsmJSIonExitRegE2;
Register reg3 = AsmJSIonExitRegE3;
LoadAsmJSActivationIntoRegister(masm, reg0);
// The following is inlined:
// JSContext *cx = activation->cx();
// Activation *act = cx->mainThread().activation();
// act.active_ = true;
// act.prevIonTop_ = cx->mainThread().ionTop;
// act.prevJitJSContext_ = cx->mainThread().jitJSContext;
// cx->mainThread().jitJSContext = cx;
// On the ARM store8() uses the secondScratchReg (lr) as a temp.
size_t offsetOfActivation = offsetof(JSRuntime, mainThread) +
PerThreadData::offsetOfActivation();
size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop);
size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) +
offsetof(PerThreadData, jitJSContext);
masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg3);
masm.loadPtr(Address(reg3, JSContext::offsetOfRuntime()), reg0);
masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
masm.store8(Imm32(1), Address(reg1, JitActivation::offsetOfActiveUint8()));
masm.loadPtr(Address(reg0, offsetOfIonTop), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevIonTop()));
masm.loadPtr(Address(reg0, offsetOfJitJSContext), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevJitJSContext()));
masm.storePtr(reg3, Address(reg0, offsetOfJitJSContext));
}
// 2. Call // 2. Call
#if defined(JS_CODEGEN_ARM) && defined(DEBUG) AssertStackAlignment(masm);
// ARM still needs to push, before stack is aligned #if defined(JS_CODEGEN_ARM)
masm.Push(scratch); masm.ma_callIonNoPush(callee);
// The return address has been popped from the stack, so adjust the stack
// without changing the frame-pushed counter to keep the stack aligned.
masm.subPtr(Imm32(4), sp);
#else
masm.callIon(callee);
#endif #endif
AssertStackAlignment(masm); AssertStackAlignment(masm);
#if defined(JS_CODEGEN_ARM) && defined(DEBUG)
masm.freeStack(sizeof(size_t));
#endif
masm.callIon(scratch);
masm.freeStack(stackDec - extraBytes);
masm.push(JSReturnReg_Type); {
masm.push(JSReturnReg_Data); // Disable Activation.
LoadAsmJSActivationIntoRegister(masm, callee); //
masm.setupUnalignedABICall(1, scratch); // This sequence needs three registers, and must preserve the JSReturnReg_Data and
masm.passABIArg(callee); // JSReturnReg_Type, so there are five live registers.
masm.callWithABI(AsmJSImm_DisableActivationFromAsmJS); JS_ASSERT(JSReturnReg_Data == AsmJSIonExitRegReturnData);
masm.pop(JSReturnReg_Data); JS_ASSERT(JSReturnReg_Type == AsmJSIonExitRegReturnType);
masm.pop(JSReturnReg_Type); Register reg0 = AsmJSIonExitRegD0;
Register reg1 = AsmJSIonExitRegD1;
Register reg2 = AsmJSIonExitRegD2;
LoadAsmJSActivationIntoRegister(masm, reg0);
// The following is inlined:
// JSContext *cx = activation->cx();
// Activation *act = cx->mainThread().activation();
// act.active_ = false;
// cx->mainThread().ionTop = prevIonTop_;
// cx->mainThread().jitJSContext = prevJitJSContext_;
// On the ARM store8() uses the secondScratchReg (lr) as a temp.
size_t offsetOfActivation = offsetof(JSRuntime, mainThread) +
PerThreadData::offsetOfActivation();
size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop);
size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) +
offsetof(PerThreadData, jitJSContext);
masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg0);
masm.loadPtr(Address(reg0, JSContext::offsetOfRuntime()), reg0);
masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
masm.store8(Imm32(0), Address(reg1, JitActivation::offsetOfActiveUint8()));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevIonTop()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfIonTop));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitJSContext()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfJitJSContext));
}
#ifdef DEBUG #ifdef DEBUG
masm.branchTestMagicValue(Assembler::Equal, JSReturnOperand, JS_ION_ERROR, throwLabel); masm.branchTestMagicValue(Assembler::Equal, JSReturnOperand, JS_ION_ERROR, throwLabel);
@ -6645,8 +6682,20 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
} }
masm.bind(&done); masm.bind(&done);
masm.PopRegsInMask(restoreSet); masm.freeStack(stackDec);
#if defined(JS_CODEGEN_ARM)
masm.ma_vimm(GenericNaN(), NANReg);
masm.PopRegsInMask(RegisterSet(GeneralRegisterSet((1<<GlobalReg.code()) |
(1<<HeapReg.code()) |
(1<<pc.code())),
FloatRegisterSet(uint32_t(0))));
#else
# if defined(JS_CODEGEN_X64)
masm.Pop(HeapReg);
# endif
masm.ret(); masm.ret();
#endif
JS_ASSERT(masm.framePushed() == 0);
// oolConvert // oolConvert
if (oolConvert.used()) { if (oolConvert.used()) {

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

@ -149,24 +149,6 @@ CoerceInPlace_ToNumber(JSContext *cx, MutableHandleValue val)
return true; return true;
} }
static void
EnableActivationFromAsmJS(AsmJSActivation *activation)
{
JSContext *cx = activation->cx();
Activation *act = cx->mainThread().activation();
JS_ASSERT(act->isJit());
act->asJit()->setActive(cx);
}
static void
DisableActivationFromAsmJS(AsmJSActivation *activation)
{
JSContext *cx = activation->cx();
Activation *act = cx->mainThread().activation();
JS_ASSERT(act->isJit());
act->asJit()->setActive(cx, false);
}
namespace js { namespace js {
// Defined in AsmJS.cpp: // Defined in AsmJS.cpp:
@ -242,10 +224,6 @@ AddressOf(AsmJSImmKind kind, ExclusiveContext *cx)
return RedirectCall(FuncCast(CoerceInPlace_ToNumber), Args_General2); return RedirectCall(FuncCast(CoerceInPlace_ToNumber), Args_General2);
case AsmJSImm_ToInt32: case AsmJSImm_ToInt32:
return RedirectCall(FuncCast<int32_t (double)>(js::ToInt32), Args_Int_Double); return RedirectCall(FuncCast<int32_t (double)>(js::ToInt32), Args_Int_Double);
case AsmJSImm_EnableActivationFromAsmJS:
return RedirectCall(FuncCast(EnableActivationFromAsmJS), Args_General1);
case AsmJSImm_DisableActivationFromAsmJS:
return RedirectCall(FuncCast(DisableActivationFromAsmJS), Args_General1);
#if defined(JS_CODEGEN_ARM) #if defined(JS_CODEGEN_ARM)
case AsmJSImm_aeabi_idivmod: case AsmJSImm_aeabi_idivmod:
return RedirectCall(FuncCast(__aeabi_idivmod), Args_General2); return RedirectCall(FuncCast(__aeabi_idivmod), Args_General2);

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

@ -80,7 +80,6 @@ class ABIArgGenerator
uint32_t stackBytesConsumedSoFar() const { return stackOffset_; } uint32_t stackBytesConsumedSoFar() const { return stackOffset_; }
static const Register NonArgReturnVolatileReg0; static const Register NonArgReturnVolatileReg0;
static const Register NonArgReturnVolatileReg1; static const Register NonArgReturnVolatileReg1;
}; };
static MOZ_CONSTEXPR_VAR Register PreBarrierReg = r1; static MOZ_CONSTEXPR_VAR Register PreBarrierReg = r1;
@ -98,6 +97,22 @@ static MOZ_CONSTEXPR_VAR FloatRegister ScratchFloatReg = { FloatRegisters::d15 }
static MOZ_CONSTEXPR_VAR FloatRegister NANReg = { FloatRegisters::d14 }; static MOZ_CONSTEXPR_VAR FloatRegister NANReg = { FloatRegisters::d14 };
// Registers used in the GenerateFFIIonExit Enable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = r4;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = r0;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = r1;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = r2;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = r3;
// Registers used in the GenerateFFIIonExit Disable Activation block.
// None of these may be the second scratch register (lr).
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = r2;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = r3;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = r0;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = r1;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = r4;
static MOZ_CONSTEXPR_VAR FloatRegister d0 = {FloatRegisters::d0}; static MOZ_CONSTEXPR_VAR FloatRegister d0 = {FloatRegisters::d0};
static MOZ_CONSTEXPR_VAR FloatRegister d1 = {FloatRegisters::d1}; static MOZ_CONSTEXPR_VAR FloatRegister d1 = {FloatRegisters::d1};
static MOZ_CONSTEXPR_VAR FloatRegister d2 = {FloatRegisters::d2}; static MOZ_CONSTEXPR_VAR FloatRegister d2 = {FloatRegisters::d2};

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

@ -690,8 +690,6 @@ enum AsmJSImmKind
AsmJSImm_CoerceInPlace_ToInt32, AsmJSImm_CoerceInPlace_ToInt32,
AsmJSImm_CoerceInPlace_ToNumber, AsmJSImm_CoerceInPlace_ToNumber,
AsmJSImm_ToInt32, AsmJSImm_ToInt32,
AsmJSImm_EnableActivationFromAsmJS,
AsmJSImm_DisableActivationFromAsmJS,
#if defined(JS_CODEGEN_ARM) #if defined(JS_CODEGEN_ARM)
AsmJSImm_aeabi_idivmod, AsmJSImm_aeabi_idivmod,
AsmJSImm_aeabi_uidivmod, AsmJSImm_aeabi_uidivmod,

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

@ -136,6 +136,20 @@ static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp0 = rbx;
static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp1 = rcx; static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp1 = rcx;
static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_output = rsi; static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_output = rsi;
// Registers used in the GenerateFFIIonExit Enable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = r10;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = rax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = rdi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = rbx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = rsi;
// Registers used in the GenerateFFIIonExit Disable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = rax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = rdi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = rbx;
class ABIArgGenerator class ABIArgGenerator
{ {
#if defined(XP_WIN) #if defined(XP_WIN)

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

@ -87,6 +87,20 @@ class ABIArgGenerator
static MOZ_CONSTEXPR_VAR Register OsrFrameReg = edx; static MOZ_CONSTEXPR_VAR Register OsrFrameReg = edx;
static MOZ_CONSTEXPR_VAR Register PreBarrierReg = edx; static MOZ_CONSTEXPR_VAR Register PreBarrierReg = edx;
// Registers used in the GenerateFFIIonExit Enable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = edi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = eax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = ebx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = edx;
// Registers used in the GenerateFFIIonExit Disable Activation block.
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = edx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = ecx;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = edi;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = eax;
static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = esi;
// GCC stack is aligned on 16 bytes, but we don't maintain the invariant in // GCC stack is aligned on 16 bytes, but we don't maintain the invariant in
// jitted code. // jitted code.
#if defined(__GNUC__) #if defined(__GNUC__)

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

@ -408,6 +408,10 @@ struct JSContext : public js::ExclusiveContext,
JSRuntime *runtime() const { return runtime_; } JSRuntime *runtime() const { return runtime_; }
js::PerThreadData &mainThread() const { return runtime()->mainThread; } js::PerThreadData &mainThread() const { return runtime()->mainThread; }
static size_t offsetOfRuntime() {
return offsetof(JSContext, runtime_);
}
friend class js::ExclusiveContext; friend class js::ExclusiveContext;
friend class JS::AutoSaveExceptionState; friend class JS::AutoSaveExceptionState;

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

@ -583,6 +583,9 @@ class PerThreadData : public PerThreadDataFriendFields
static unsigned offsetOfAsmJSActivationStackReadOnly() { static unsigned offsetOfAsmJSActivationStackReadOnly() {
return offsetof(PerThreadData, asmJSActivationStack_); return offsetof(PerThreadData, asmJSActivationStack_);
} }
static unsigned offsetOfActivation() {
return offsetof(PerThreadData, activation_);
}
js::AsmJSActivation *asmJSActivationStackFromAnyThread() const { js::AsmJSActivation *asmJSActivationStackFromAnyThread() const {
return asmJSActivationStack_; return asmJSActivationStack_;

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

@ -1516,6 +1516,9 @@ jit::JitActivation::~JitActivation()
} }
} }
// setActive() is inlined in GenerateFFIIonExit() with explicit masm instructions so
// changes to the logic here need to be reflected in GenerateFFIIonExit() in the enable
// and disable activation instruction sequences.
void void
jit::JitActivation::setActive(JSContext *cx, bool active) jit::JitActivation::setActive(JSContext *cx, bool active)
{ {

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

@ -1335,6 +1335,16 @@ class JitActivation : public Activation
bool firstFrameIsConstructing() const { bool firstFrameIsConstructing() const {
return firstFrameIsConstructing_; return firstFrameIsConstructing_;
} }
static size_t offsetOfPrevIonTop() {
return offsetof(JitActivation, prevIonTop_);
}
static size_t offsetOfPrevJitJSContext() {
return offsetof(JitActivation, prevJitJSContext_);
}
static size_t offsetOfActiveUint8() {
JS_ASSERT(sizeof(bool) == 1);
return offsetof(JitActivation, active_);
}
#ifdef CHECK_OSIPOINT_REGISTERS #ifdef CHECK_OSIPOINT_REGISTERS
void setCheckRegs(bool check) { void setCheckRegs(bool check) {

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

@ -376,19 +376,6 @@ XPCWrappedNative::GetNewOrUsed(xpcObjectHelper& helper,
if (parent != plannedParent) { if (parent != plannedParent) {
XPCWrappedNativeScope* betterScope = GetObjectScope(parent); XPCWrappedNativeScope* betterScope = GetObjectScope(parent);
if (MOZ_UNLIKELY(!betterScope)) {
printf_stderr("Uh oh, hit an object without a scope! Crashing shortly.\n");
printf_stderr("IsMainThread: %u\n", (uint32_t) NS_IsMainThread());
char* className = nullptr;
sciWrapper.GetCallback()->GetClassName(&className);
printf_stderr("SH Class Name: %s\n", className);
nsMemory::Free(className);
printf_stderr("plannedParent object class: %s\n", js::GetObjectClass(plannedParent)->name);
printf_stderr("plannedParent Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(plannedParent))->name);
printf_stderr("parent Object class: %s\n", js::GetObjectClass(parent)->name);
printf_stderr("parent Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(parent))->name);
MOZ_CRASH();
}
if (betterScope != Scope) if (betterScope != Scope)
return GetNewOrUsed(helper, betterScope, Interface, resultWrapper); return GetNewOrUsed(helper, betterScope, Interface, resultWrapper);

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

@ -738,7 +738,7 @@ protected:
bool ParseTextAlignLast(nsCSSValue& aValue); bool ParseTextAlignLast(nsCSSValue& aValue);
bool ParseTextDecoration(); bool ParseTextDecoration();
bool ParseTextDecorationLine(nsCSSValue& aValue); bool ParseTextDecorationLine(nsCSSValue& aValue);
bool ParseTextCombineHorizontal(nsCSSValue& aValue); bool ParseTextCombineUpright(nsCSSValue& aValue);
bool ParseTextOverflow(nsCSSValue& aValue); bool ParseTextOverflow(nsCSSValue& aValue);
bool ParseTouchAction(nsCSSValue& aValue); bool ParseTouchAction(nsCSSValue& aValue);
@ -9322,8 +9322,8 @@ CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue,
return ParseTextAlignLast(aValue); return ParseTextAlignLast(aValue);
case eCSSProperty_text_decoration_line: case eCSSProperty_text_decoration_line:
return ParseTextDecorationLine(aValue); return ParseTextDecorationLine(aValue);
case eCSSProperty_text_combine_horizontal: case eCSSProperty_text_combine_upright:
return ParseTextCombineHorizontal(aValue); return ParseTextCombineUpright(aValue);
case eCSSProperty_text_overflow: case eCSSProperty_text_overflow:
return ParseTextOverflow(aValue); return ParseTextOverflow(aValue);
case eCSSProperty_touch_action: case eCSSProperty_touch_action:
@ -12433,16 +12433,16 @@ CSSParserImpl::ParseTouchAction(nsCSSValue& aValue)
} }
bool bool
CSSParserImpl::ParseTextCombineHorizontal(nsCSSValue& aValue) CSSParserImpl::ParseTextCombineUpright(nsCSSValue& aValue)
{ {
if (!ParseVariant(aValue, VARIANT_HK, if (!ParseVariant(aValue, VARIANT_HK,
nsCSSProps::kTextCombineHorizontalKTable)) { nsCSSProps::kTextCombineUprightKTable)) {
return false; return false;
} }
// if 'digits', need to check for an explicit number [2, 3, 4] // if 'digits', need to check for an explicit number [2, 3, 4]
if (eCSSUnit_Enumerated == aValue.GetUnit() && if (eCSSUnit_Enumerated == aValue.GetUnit() &&
aValue.GetIntValue() == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) { aValue.GetIntValue() == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) {
if (!GetToken(true)) { if (!GetToken(true)) {
return true; return true;
} }
@ -12451,11 +12451,11 @@ CSSParserImpl::ParseTextCombineHorizontal(nsCSSValue& aValue)
case 2: // already set, nothing to do case 2: // already set, nothing to do
break; break;
case 3: case 3:
aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3, aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3,
eCSSUnit_Enumerated); eCSSUnit_Enumerated);
break; break;
case 4: case 4:
aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_4, aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_4,
eCSSUnit_Enumerated); eCSSUnit_Enumerated);
break; break;
default: default:

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

@ -3011,15 +3011,15 @@ CSS_PROP_SHORTHAND(
CSS_PROPERTY_PARSE_FUNCTION, CSS_PROPERTY_PARSE_FUNCTION,
"") "")
CSS_PROP_TEXT( CSS_PROP_TEXT(
text-combine-horizontal, text-combine-upright,
text_combine_horizontal, text_combine_upright,
TextCombineHorizontal, TextCombineUpright,
CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_PARSER_FUNCTION, CSS_PROPERTY_VALUE_PARSER_FUNCTION,
"layout.css.vertical-text.enabled", "layout.css.vertical-text.enabled",
0, 0,
kTextCombineHorizontalKTable, kTextCombineUprightKTable,
offsetof(nsStyleText, mTextCombineHorizontal), offsetof(nsStyleText, mTextCombineUpright),
eStyleAnimType_EnumU8) eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET( CSS_PROP_TEXTRESET(
-moz-text-decoration-color, -moz-text-decoration-color,

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

@ -1570,10 +1570,10 @@ KTableValue nsCSSProps::kTextAlignLastKTable[] = {
eCSSKeyword_UNKNOWN,-1 eCSSKeyword_UNKNOWN,-1
}; };
const KTableValue nsCSSProps::kTextCombineHorizontalKTable[] = { const KTableValue nsCSSProps::kTextCombineUprightKTable[] = {
eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_HORIZ_NONE, eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE,
eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_HORIZ_ALL, eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL,
eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2, // w/o number ==> 2 eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2, // w/o number ==> 2
eCSSKeyword_UNKNOWN,-1 eCSSKeyword_UNKNOWN,-1
}; };

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

@ -618,7 +618,7 @@ public:
// "layout.css.text-align-true-value.enabled" changes: // "layout.css.text-align-true-value.enabled" changes:
static KTableValue kTextAlignKTable[]; static KTableValue kTextAlignKTable[];
static KTableValue kTextAlignLastKTable[]; static KTableValue kTextAlignLastKTable[];
static const KTableValue kTextCombineHorizontalKTable[]; static const KTableValue kTextCombineUprightKTable[];
static const KTableValue kTextDecorationLineKTable[]; static const KTableValue kTextDecorationLineKTable[];
static const KTableValue kTextDecorationStyleKTable[]; static const KTableValue kTextDecorationStyleKTable[];
static const KTableValue kTextOrientationKTable[]; static const KTableValue kTextOrientationKTable[];

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

@ -953,13 +953,13 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
switch(aProperty) { switch(aProperty) {
case eCSSProperty_text_combine_horizontal: case eCSSProperty_text_combine_upright:
if (intValue <= NS_STYLE_TEXT_COMBINE_HORIZ_ALL) { if (intValue <= NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) {
AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue), AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue),
aResult); aResult);
} else if (intValue == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) { } else if (intValue == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) {
aResult.AppendLiteral("digits 2"); aResult.AppendLiteral("digits 2");
} else if (intValue == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3) { } else if (intValue == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3) {
aResult.AppendLiteral("digits 3"); aResult.AppendLiteral("digits 3");
} else { } else {
aResult.AppendLiteral("digits 4"); aResult.AppendLiteral("digits 4");

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

@ -3125,18 +3125,18 @@ nsComputedDOMStyle::DoGetTextAlignLast()
} }
CSSValue* CSSValue*
nsComputedDOMStyle::DoGetTextCombineHorizontal() nsComputedDOMStyle::DoGetTextCombineUpright()
{ {
nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue; nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
uint8_t tch = StyleText()->mTextCombineHorizontal; uint8_t tch = StyleText()->mTextCombineUpright;
if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_ALL) { if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) {
val->SetIdent( val->SetIdent(
nsCSSProps::ValueToKeywordEnum(tch, nsCSSProps::ValueToKeywordEnum(tch,
nsCSSProps::kTextCombineHorizontalKTable)); nsCSSProps::kTextCombineUprightKTable));
} else if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) { } else if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) {
val->SetString(NS_LITERAL_STRING("digits 2")); val->SetString(NS_LITERAL_STRING("digits 2"));
} else if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3) { } else if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3) {
val->SetString(NS_LITERAL_STRING("digits 3")); val->SetString(NS_LITERAL_STRING("digits 3"));
} else { } else {
val->SetString(NS_LITERAL_STRING("digits 4")); val->SetString(NS_LITERAL_STRING("digits 4"));

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

@ -376,7 +376,7 @@ private:
mozilla::dom::CSSValue* DoGetLineHeight(); mozilla::dom::CSSValue* DoGetLineHeight();
mozilla::dom::CSSValue* DoGetTextAlign(); mozilla::dom::CSSValue* DoGetTextAlign();
mozilla::dom::CSSValue* DoGetTextAlignLast(); mozilla::dom::CSSValue* DoGetTextAlignLast();
mozilla::dom::CSSValue* DoGetTextCombineHorizontal(); mozilla::dom::CSSValue* DoGetTextCombineUpright();
mozilla::dom::CSSValue* DoGetTextDecoration(); mozilla::dom::CSSValue* DoGetTextDecoration();
mozilla::dom::CSSValue* DoGetTextDecorationColor(); mozilla::dom::CSSValue* DoGetTextDecorationColor();
mozilla::dom::CSSValue* DoGetTextDecorationLine(); mozilla::dom::CSSValue* DoGetTextDecorationLine();

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

@ -195,7 +195,7 @@ COMPUTED_STYLE_PROP(right, Right)
//// COMPUTED_STYLE_PROP(size, Size) //// COMPUTED_STYLE_PROP(size, Size)
COMPUTED_STYLE_PROP(table_layout, TableLayout) COMPUTED_STYLE_PROP(table_layout, TableLayout)
COMPUTED_STYLE_PROP(text_align, TextAlign) COMPUTED_STYLE_PROP(text_align, TextAlign)
COMPUTED_STYLE_PROP(text_combine_horizontal, TextCombineHorizontal) COMPUTED_STYLE_PROP(text_combine_upright, TextCombineUpright)
COMPUTED_STYLE_PROP(text_decoration, TextDecoration) COMPUTED_STYLE_PROP(text_decoration, TextDecoration)
COMPUTED_STYLE_PROP(text_indent, TextIndent) COMPUTED_STYLE_PROP(text_indent, TextIndent)
COMPUTED_STYLE_PROP(text_orientation, TextOrientation) COMPUTED_STYLE_PROP(text_orientation, TextOrientation)

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

@ -4261,13 +4261,13 @@ nsRuleNode::ComputeTextData(void* aStartStruct,
parentText->mTextOrientation, parentText->mTextOrientation,
NS_STYLE_TEXT_ORIENTATION_AUTO, 0, 0, 0, 0); NS_STYLE_TEXT_ORIENTATION_AUTO, 0, 0, 0, 0);
// text-combine-horizontal: enum, inherit, initial // text-combine-upright: enum, inherit, initial
SetDiscrete(*aRuleData->ValueForTextCombineHorizontal(), SetDiscrete(*aRuleData->ValueForTextCombineUpright(),
text->mTextCombineHorizontal, text->mTextCombineUpright,
canStoreInRuleTree, canStoreInRuleTree,
SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT, SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT,
parentText->mTextCombineHorizontal, parentText->mTextCombineUpright,
NS_STYLE_TEXT_COMBINE_HORIZ_NONE, 0, 0, 0, 0); NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE, 0, 0, 0, 0);
COMPUTE_END_INHERITED(Text, text) COMPUTE_END_INHERITED(Text, text)
} }

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

@ -843,11 +843,11 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS 2 #define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS 2
// See nsStyleText // See nsStyleText
#define NS_STYLE_TEXT_COMBINE_HORIZ_NONE 0 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE 0
#define NS_STYLE_TEXT_COMBINE_HORIZ_ALL 1 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL 1
#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2 2 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2 2
#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3 3 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3 3
#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_4 4 #define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_4 4
// See nsStyleText // See nsStyleText
#define NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT 0 #define NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT 0

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

@ -3058,7 +3058,7 @@ nsStyleText::nsStyleText(void)
mHyphens = NS_STYLE_HYPHENS_MANUAL; mHyphens = NS_STYLE_HYPHENS_MANUAL;
mTextSizeAdjust = NS_STYLE_TEXT_SIZE_ADJUST_AUTO; mTextSizeAdjust = NS_STYLE_TEXT_SIZE_ADJUST_AUTO;
mTextOrientation = NS_STYLE_TEXT_ORIENTATION_AUTO; mTextOrientation = NS_STYLE_TEXT_ORIENTATION_AUTO;
mTextCombineHorizontal = NS_STYLE_TEXT_COMBINE_HORIZ_NONE; mTextCombineUpright = NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE;
mControlCharacterVisibility = NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN; mControlCharacterVisibility = NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN;
mLetterSpacing.SetNormalValue(); mLetterSpacing.SetNormalValue();
@ -3082,7 +3082,7 @@ nsStyleText::nsStyleText(const nsStyleText& aSource)
mHyphens(aSource.mHyphens), mHyphens(aSource.mHyphens),
mTextSizeAdjust(aSource.mTextSizeAdjust), mTextSizeAdjust(aSource.mTextSizeAdjust),
mTextOrientation(aSource.mTextOrientation), mTextOrientation(aSource.mTextOrientation),
mTextCombineHorizontal(aSource.mTextCombineHorizontal), mTextCombineUpright(aSource.mTextCombineUpright),
mControlCharacterVisibility(aSource.mControlCharacterVisibility), mControlCharacterVisibility(aSource.mControlCharacterVisibility),
mTabSize(aSource.mTabSize), mTabSize(aSource.mTabSize),
mWordSpacing(aSource.mWordSpacing), mWordSpacing(aSource.mWordSpacing),
@ -3107,7 +3107,7 @@ nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
return NS_STYLE_HINT_FRAMECHANGE; return NS_STYLE_HINT_FRAMECHANGE;
} }
if (mTextCombineHorizontal != aOther.mTextCombineHorizontal || if (mTextCombineUpright != aOther.mTextCombineUpright ||
mControlCharacterVisibility != aOther.mControlCharacterVisibility) { mControlCharacterVisibility != aOther.mControlCharacterVisibility) {
return nsChangeHint_ReconstructFrame; return nsChangeHint_ReconstructFrame;
} }

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

@ -1526,7 +1526,7 @@ struct nsStyleText {
uint8_t mHyphens; // [inherited] see nsStyleConsts.h uint8_t mHyphens; // [inherited] see nsStyleConsts.h
uint8_t mTextSizeAdjust; // [inherited] see nsStyleConsts.h uint8_t mTextSizeAdjust; // [inherited] see nsStyleConsts.h
uint8_t mTextOrientation; // [inherited] see nsStyleConsts.h uint8_t mTextOrientation; // [inherited] see nsStyleConsts.h
uint8_t mTextCombineHorizontal; // [inherited] see nsStyleConsts.h uint8_t mTextCombineUpright; // [inherited] see nsStyleConsts.h
uint8_t mControlCharacterVisibility; // [inherited] see nsStyleConsts.h uint8_t mControlCharacterVisibility; // [inherited] see nsStyleConsts.h
int32_t mTabSize; // [inherited] see nsStyleConsts.h int32_t mTabSize; // [inherited] see nsStyleConsts.h

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

@ -4398,8 +4398,8 @@ if (SpecialPowers.getBoolPref("layout.css.vertical-text.enabled")) {
other_values: [ "upright", "sideways" ], other_values: [ "upright", "sideways" ],
invalid_values: [ "none", "3em" ] invalid_values: [ "none", "3em" ]
}, },
"text-combine-horizontal": { "text-combine-upright": {
domProp: "textCombineHorizontal", domProp: "textCombineUpright",
inherited: true, inherited: true,
type: CSS_TYPE_LONGHAND, type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ], initial_values: [ "none" ],

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

@ -68,7 +68,7 @@ function step() {
// ---- // ----
var gProps = { var gProps = {
"layout.css.vertical-text.enabled": ["text-combine-horizontal", "text-orientation", "writing-mode"], "layout.css.vertical-text.enabled": ["text-combine-upright", "text-orientation", "writing-mode"],
"layout.css.font-features.enabled": ["font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], "layout.css.font-features.enabled": ["font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"],
"layout.css.image-orientation.enabled": ["image-orientation"], "layout.css.image-orientation.enabled": ["image-orientation"],
"layout.css.mix-blend-mode.enabled": ["mix-blend-mode"], "layout.css.mix-blend-mode.enabled": ["mix-blend-mode"],

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

@ -1687,6 +1687,11 @@ function RecordResult(testRunTime, errorMsg, scriptResults)
function LoadFailed(why) function LoadFailed(why)
{ {
++gTestResults.FailedLoad; ++gTestResults.FailedLoad;
// Once bug 896840 is fixed, this can go away, but for now it will give log
// output that is TBPL starable for bug 789751 and bug 720452.
if (!why) {
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | load failed with unknown reason\n");
}
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " + gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " +
gURLs[0]["url" + gState].spec + " | load failed: " + why + "\n"); gURLs[0]["url" + gState].spec + " | load failed: " + why + "\n");
FlushTestLog(); FlushTestLog();

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

@ -126,6 +126,7 @@ struct RtspConnectionHandler : public AHandler {
mSetupTracksSuccessful(false), mSetupTracksSuccessful(false),
mSeekPending(false), mSeekPending(false),
mPausePending(false), mPausePending(false),
mAborted(false),
mFirstAccessUnit(true), mFirstAccessUnit(true),
mNTPAnchorUs(-1), mNTPAnchorUs(-1),
mMediaAnchorUs(-1), mMediaAnchorUs(-1),
@ -412,6 +413,7 @@ struct RtspConnectionHandler : public AHandler {
{ {
int32_t result; int32_t result;
CHECK(msg->findInt32("result", &result)); CHECK(msg->findInt32("result", &result));
mAborted = false;
LOGI("connection request completed with result %d (%s)", LOGI("connection request completed with result %d (%s)",
result, strerror(-result)); result, strerror(-result));
@ -459,6 +461,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("DESCRIBE completed with result %d (%s)", LOGI("DESCRIBE completed with result %d (%s)",
result, strerror(-result)); result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (result == OK) { if (result == OK) {
sp<RefBase> obj; sp<RefBase> obj;
@ -578,6 +584,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("SETUP(%d) completed with result %d (%s)", LOGI("SETUP(%d) completed with result %d (%s)",
index, result, strerror(-result)); index, result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (result == OK) { if (result == OK) {
CHECK(track != NULL); CHECK(track != NULL);
@ -711,6 +721,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("PLAY completed with result %d (%s)", LOGI("PLAY completed with result %d (%s)",
result, strerror(-result)); result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (result == OK) { if (result == OK) {
sp<RefBase> obj; sp<RefBase> obj;
@ -816,6 +830,7 @@ struct RtspConnectionHandler : public AHandler {
mReceivedFirstRTCPPacket = false; mReceivedFirstRTCPPacket = false;
mReceivedFirstRTPPacket = false; mReceivedFirstRTPPacket = false;
mSeekable = false; mSeekable = false;
mAborted = true;
sp<AMessage> reply = new AMessage('tear', id()); sp<AMessage> reply = new AMessage('tear', id());
@ -955,6 +970,11 @@ struct RtspConnectionHandler : public AHandler {
break; break;
} }
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
if (seqNum < track->mFirstSeqNumInSegment) { if (seqNum < track->mFirstSeqNumInSegment) {
LOGV("dropping stale access-unit (%d < %d)", LOGV("dropping stale access-unit (%d < %d)",
seqNum, track->mFirstSeqNumInSegment); seqNum, track->mFirstSeqNumInSegment);
@ -1047,6 +1067,10 @@ struct RtspConnectionHandler : public AHandler {
LOGI("PLAY completed with result %d (%s)", LOGI("PLAY completed with result %d (%s)",
result, strerror(-result)); result, strerror(-result));
if (mAborted) {
LOGV("we're aborted, dropping stale packet.");
break;
}
mCheckPending = false; mCheckPending = false;
postAccessUnitTimeoutCheck(); postAccessUnitTimeoutCheck();
@ -1301,6 +1325,7 @@ private:
bool mSetupTracksSuccessful; bool mSetupTracksSuccessful;
bool mSeekPending; bool mSeekPending;
bool mPausePending; bool mPausePending;
bool mAborted;
bool mFirstAccessUnit; bool mFirstAccessUnit;
int64_t mNTPAnchorUs; int64_t mNTPAnchorUs;

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

@ -16,7 +16,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Timer.jsm"); Cu.import("resource://gre/modules/Timer.jsm");
Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/FxAccountsCommon.js"); Cu.import("resource://gre/modules/FxAccountsCommon.js");
Cu.import("resource://gre/modules/FxAccountsUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsClient", XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsClient",
"resource://gre/modules/FxAccountsClient.jsm"); "resource://gre/modules/FxAccountsClient.jsm");
@ -201,6 +200,47 @@ AccountState.prototype = {
}, },
} }
/**
* Copies properties from a given object to another object.
*
* @param from (object)
* The object we read property descriptors from.
* @param to (object)
* The object that we set property descriptors on.
* @param options (object) (optional)
* {keys: [...]}
* Lets the caller pass the names of all properties they want to be
* copied. Will copy all properties of the given source object by
* default.
* {bind: object}
* Lets the caller specify the object that will be used to .bind()
* all function properties we find to. Will bind to the given target
* object by default.
*/
function copyObjectProperties(from, to, opts = {}) {
let keys = (opts && opts.keys) || Object.keys(from);
let thisArg = (opts && opts.bind) || to;
for (let prop of keys) {
let desc = Object.getOwnPropertyDescriptor(from, prop);
if (typeof(desc.value) == "function") {
desc.value = desc.value.bind(thisArg);
}
if (desc.get) {
desc.get = desc.get.bind(thisArg);
}
if (desc.set) {
desc.set = desc.set.bind(thisArg);
}
Object.defineProperty(to, prop, desc);
}
}
/** /**
* The public API's constructor. * The public API's constructor.
*/ */
@ -211,11 +251,11 @@ this.FxAccounts = function (mockInternal) {
// Copy all public properties to the 'external' object. // Copy all public properties to the 'external' object.
let prototype = FxAccountsInternal.prototype; let prototype = FxAccountsInternal.prototype;
let options = {keys: publicProperties, bind: internal}; let options = {keys: publicProperties, bind: internal};
FxAccountsUtils.copyObjectProperties(prototype, external, options); copyObjectProperties(prototype, external, options);
// Copy all of the mock's properties to the internal object. // Copy all of the mock's properties to the internal object.
if (mockInternal && !mockInternal.onlySetInternal) { if (mockInternal && !mockInternal.onlySetInternal) {
FxAccountsUtils.copyObjectProperties(mockInternal, internal); copyObjectProperties(mockInternal, internal);
} }
if (mockInternal) { if (mockInternal) {

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

@ -1,49 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
this.EXPORTED_SYMBOLS = ["FxAccountsUtils"];
this.FxAccountsUtils = Object.freeze({
/**
* Copies properties from a given object to another object.
*
* @param from (object)
* The object we read property descriptors from.
* @param to (object)
* The object that we set property descriptors on.
* @param options (object) (optional)
* {keys: [...]}
* Lets the caller pass the names of all properties they want to be
* copied. Will copy all properties of the given source object by
* default.
* {bind: object}
* Lets the caller specify the object that will be used to .bind()
* all function properties we find to. Will bind to the given target
* object by default.
*/
copyObjectProperties: function (from, to, opts = {}) {
let keys = (opts && opts.keys) || Object.keys(from);
let thisArg = (opts && opts.bind) || to;
for (let prop of keys) {
let desc = Object.getOwnPropertyDescriptor(from, prop);
if (typeof(desc.value) == "function") {
desc.value = desc.value.bind(thisArg);
}
if (desc.get) {
desc.get = desc.get.bind(thisArg);
}
if (desc.set) {
desc.set = desc.set.bind(thisArg);
}
Object.defineProperty(to, prop, desc);
}
}
});

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

@ -12,8 +12,7 @@ EXTRA_JS_MODULES += [
'Credentials.jsm', 'Credentials.jsm',
'FxAccounts.jsm', 'FxAccounts.jsm',
'FxAccountsClient.jsm', 'FxAccountsClient.jsm',
'FxAccountsCommon.js', 'FxAccountsCommon.js'
'FxAccountsUtils.jsm'
] ]
# For now, we will only be using the FxA manager in B2G. # For now, we will only be using the FxA manager in B2G.

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

@ -79,9 +79,18 @@ var Authentication = {
}); });
try { try {
return cb.wait(); cb.wait();
if (Weave.Status.login !== Weave.LOGIN_SUCCEEDED) {
Logger.logInfo("Logging into Weave.");
Weave.Service.login();
Logger.AssertEqual(Weave.Status.login, Weave.LOGIN_SUCCEEDED,
"Weave logged in");
}
return true;
} catch (error) { } catch (error) {
throw new Error("signIn() failed with: " + JSON.stringify(error)); throw new Error("signIn() failed with: " + error.message);
} }
} }
}; };

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

@ -68,9 +68,16 @@ var Authentication = {
Weave.Service.identity.basicPassword = account["password"]; Weave.Service.identity.basicPassword = account["password"];
Weave.Service.identity.syncKey = account["passphrase"]; Weave.Service.identity.syncKey = account["passphrase"];
// Fake the login if (Weave.Status.login !== Weave.LOGIN_SUCCEEDED) {
Weave.Service.login(); Logger.logInfo("Logging into Weave.");
Weave.Svc.Obs.notify("weave:service:setup-complete"); Weave.Service.login();
Logger.AssertEqual(Weave.Status.login, Weave.LOGIN_SUCCEEDED,
"Weave logged in");
// Bug 997279: Temporary workaround until we can ensure that Sync itself
// sends this notification for the first login attempt by TPS
Weave.Svc.Obs.notify("weave:service:setup-complete");
}
return true; return true;
} }

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

@ -837,7 +837,6 @@ let TPS = {
let account = this.fxaccounts_enabled ? this.config.fx_account let account = this.fxaccounts_enabled ? this.config.fx_account
: this.config.sync_account; : this.config.sync_account;
Authentication.signIn(account); Authentication.signIn(account);
this.waitForSetupComplete(); this.waitForSetupComplete();
Logger.AssertEqual(Weave.Status.service, Weave.STATUS_OK, "Weave status OK"); Logger.AssertEqual(Weave.Status.service, Weave.STATUS_OK, "Weave status OK");
this.waitForTracking(); this.waitForTracking();

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

@ -79,15 +79,13 @@ StartupCache::CollectReports(nsIHandleReportCallback* aHandleReport,
"mapping."); "mapping.");
return NS_OK; return NS_OK;
}; }
static const char sStartupCacheName[] = "startupCache." SC_WORDSIZE "." SC_ENDIAN; static const char sStartupCacheName[] = "startupCache." SC_WORDSIZE "." SC_ENDIAN;
#if defined(XP_WIN) && defined(MOZ_METRO) #if defined(XP_WIN) && defined(MOZ_METRO)
static const char sMetroStartupCacheName[] = "metroStartupCache." SC_WORDSIZE "." SC_ENDIAN; static const char sMetroStartupCacheName[] = "metroStartupCache." SC_WORDSIZE "." SC_ENDIAN;
#endif #endif
static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
StartupCache* StartupCache*
StartupCache::GetSingleton() StartupCache::GetSingleton()
{ {

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

@ -2,17 +2,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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 * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsID.h" #include "nsID.h"
#include "prprf.h" #include "prprf.h"
#include "nsMemory.h" #include "nsMemory.h"
static const char gIDFormat[] =
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
static const char gIDFormat2[] =
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
/** /**
* Multiplies the_int_var with 16 (0x10) and adds the value of the * Multiplies the_int_var with 16 (0x10) and adds the value of the
* hexadecimal digit the_char. If it fails it returns false from * hexadecimal digit the_char. If it fails it returns false from
@ -51,8 +45,8 @@ static const char gIDFormat2[] =
*/ */
#define PARSE_HYPHEN(char_pointer) if(*(char_pointer++) != '-') return false #define PARSE_HYPHEN(char_pointer) if(*(char_pointer++) != '-') return false
/* /*
* Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} string into * Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} string into
* an nsID. It can also handle the old format without the { and }. * an nsID. It can also handle the old format without the { and }.
*/ */
@ -81,19 +75,22 @@ bool nsID::Parse(const char *aIDStr)
PARSE_CHARS_TO_NUM(aIDStr, m3[i], 2); PARSE_CHARS_TO_NUM(aIDStr, m3[i], 2);
i++; i++;
} }
return expectFormat1 ? *aIDStr == '}' : true; return expectFormat1 ? *aIDStr == '}' : true;
} }
#ifndef XPCOM_GLUE_AVOID_NSPR #ifndef XPCOM_GLUE_AVOID_NSPR
static const char gIDFormat[] =
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
/* /*
* Returns an allocated string in {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} * Returns an allocated string in {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
* format. The string is allocated with NS_Alloc and should be freed by * format. The string is allocated with NS_Alloc and should be freed by
* the caller. * the caller.
*/ */
char *nsID::ToString() const char *nsID::ToString() const
{ {
char *res = (char*)NS_Alloc(NSID_LENGTH); char *res = (char*)NS_Alloc(NSID_LENGTH);

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

@ -17,7 +17,6 @@
*/ */
static const int32_t kMinGrowArrayBy = 8; static const int32_t kMinGrowArrayBy = 8;
static const int32_t kMaxGrowArrayBy = 1024; static const int32_t kMaxGrowArrayBy = 1024;
static const int32_t kAutoClearCompactSizeFactor = 4;
/** /**
* This is the threshold (in bytes) of the mImpl struct, past which * This is the threshold (in bytes) of the mImpl struct, past which
@ -31,7 +30,6 @@ static const int32_t kLinearThreshold = 24 * sizeof(void *);
*/ */
#define SIZEOF_IMPL(n_) (sizeof(Impl) + sizeof(void *) * ((n_) - 1)) #define SIZEOF_IMPL(n_) (sizeof(Impl) + sizeof(void *) * ((n_) - 1))
/** /**
* Compute the number of elements that an mImpl struct of |n| bytes * Compute the number of elements that an mImpl struct of |n| bytes
* will hold. * will hold.