This commit is contained in:
Rob Campbell 2011-04-20 11:19:22 -03:00
Родитель 2e54f9d739 1cff8e30e8
Коммит 91e325d426
81 изменённых файлов: 924 добавлений и 389 удалений

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

@ -5559,7 +5559,7 @@ function middleMousePaste(event) {
// Strip embedded newlines and surrounding whitespace, to match the URL
// bar's behavior (stripsurroundingwhitespace)
clipboard.replace(/\s*\n\s*/g, "");
clipboard = clipboard.replace(/\s*\n\s*/g, "");
let url = getShortcutOrURI(clipboard);
try {
@ -7794,7 +7794,7 @@ var gIdentityHandler = {
dt.setData("text/uri-list", value);
dt.setData("text/plain", value);
dt.setData("text/html", htmlString);
dt.addElement(event.currentTarget);
dt.setDragImage(gProxyFavIcon, 16, 16);
}
};

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

@ -357,15 +357,10 @@
let promptBox = {
appendPrompt : function(args, onCloseCallback) {
let count = browser.getAttribute("tabmodalPromptShowing");
if (count)
count = parseInt(count) + 1;
else
count = 1;
browser.setAttribute("tabmodalPromptShowing", count);
let newPrompt = document.createElementNS(XUL_NS, "tabmodalprompt");
stack.appendChild(newPrompt);
browser.setAttribute("tabmodalPromptShowing", true);
newPrompt.clientTop; // style flush to assure binding is attached
let tab = self._getTabForContentWindow(browser.contentWindow);
@ -374,21 +369,22 @@
},
removePrompt : function(aPrompt) {
let count = parseInt(browser.getAttribute("tabmodalPromptShowing"));
count--;
if (count)
browser.setAttribute("tabmodalPromptShowing", count);
else
browser.removeAttribute("tabmodalPromptShowing");
stack.removeChild(aPrompt);
let prompts = this.listPrompts();
if (prompts.length) {
let prompt = prompts[prompts.length - 1];
prompt.Dialog.setDefaultFocus();
} else {
browser.removeAttribute("tabmodalPromptShowing");
browser.focus();
}
},
listPrompts : function(aPrompt) {
let prompts = [];
let els = stack.getElementsByTagNameNS(XUL_NS, "tabmodalprompt");
// NodeList --> real JS array
for (let i = 0; i < els.length; i++)
prompts.push(els[i]);
let prompts = Array.slice(els);
return prompts;
},
};
@ -952,6 +948,16 @@
// Adjust focus
do {
// If there's a tabmodal prompt showing, focus it.
if (newBrowser.hasAttribute("tabmodalPromptShowing")) {
let XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let prompts = newBrowser.parentNode.getElementsByTagNameNS(XUL_NS, "tabmodalprompt");
let prompt = prompts[prompts.length - 1];
prompt.Dialog.setDefaultFocus();
break;
}
// Focus the location bar if it was previously focused for that tab.
// In full screen mode, only bother making the location bar visible
// if the tab is a blank one.

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

@ -523,11 +523,8 @@
<handler event="DOMMouseScroll"
phase="capturing"
#ifdef XP_MACOSX
action="if (event.metaKey) this.selectEngine(event, (event.detail > 0));"/>
#else
action="if (event.ctrlKey) this.selectEngine(event, (event.detail > 0));"/>
#endif
modifiers="accel"
action="this.selectEngine(event, (event.detail > 0));"/>
</handlers>
</binding>

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

@ -50,5 +50,7 @@ MOZ_SERVICES_SYNC=1
MOZ_APP_VERSION=$FIREFOX_VERSION
MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
# Changing either of these values requires a clobber to ensure correct results,
# because branding dependencies are broken.
MOZ_BRANDING_DIRECTORY=browser/branding/nightly
MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official

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

@ -970,7 +970,6 @@ toolbar[iconsize="small"] #feed-button {
width: 24px;
height: 20px;
padding: 2px 4px;
background: url(urlbar-favicon-glow.png) center center no-repeat;
}
#page-proxy-favicon:not([src]) {
@ -987,37 +986,67 @@ toolbar[iconsize="small"] #feed-button {
/* Identity indicator */
#identity-box {
background-color: rgb(95%,95%,95%);
background-image: -moz-linear-gradient(rgba(170,170,170,.25), rgba(0,0,0,.3));
color: #444;
box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset;
border-radius: 1.5px;
background-image: -moz-linear-gradient(hsl(0,0%,98%), hsl(0,0%,92%));
box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset;
-moz-border-end: 1px solid rgba(0,0,0,.1);
padding: 1px;
margin: -1px;
-moz-margin-end: 0;
}
#identity-box:-moz-locale-dir(ltr) {
border-top-left-radius: 2.5px;
border-bottom-left-radius: 2.5px;
}
#identity-box:-moz-locale-dir(rtl) {
border-top-right-radius: 2.5px;
border-bottom-right-radius: 2.5px;
}
#identity-box:-moz-focusring {
outline: 1px dotted -moz-DialogText;
outline: 1px dotted #000;
outline-offset: -3px;
}
#identity-box:hover:active,
#identity-box[open="true"] {
background-image: -moz-linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,.1));
background-image: -moz-linear-gradient(hsl(0,0%,92%), hsl(0,0%,82%));
box-shadow: 0 1px 1px hsla(0,0%,0%,.3) inset,
0 1px 3px hsla(0,0%,0%,.3) inset;
}
#identity-icon-labels {
-moz-padding-start: 2px;
-moz-padding-end: 3px;
-moz-padding-end: 5px;
}
#identity-box.verifiedDomain {
background-color: rgba(30, 80, 170, 0.7);
color: white;
text-shadow: 0 1px 0 rgba(0,0,0,.25);
background-image: -moz-linear-gradient(hsl(215,60%,92%), hsl(215,58%,88%));
box-shadow: 0 1px 0 hsla(215,54%,33%,.05) inset;
-moz-border-end-color: hsla(215,54%,33%,.2);
color: hsl(215,54%,33%);
}
#identity-box.verifiedDomain:hover:active,
#identity-box.verifiedDomain[open="true"] {
background-image: -moz-linear-gradient(hsl(215,80%,80%), hsl(215,67%,65%));
box-shadow: 0 1px 1px hsla(215,54%,33%,.7) inset,
0 1px 3px 1px hsla(215,54%,33%,.5) inset;
}
#identity-box.verifiedIdentity {
background-color: rgba(50, 150, 50, 0.8);
color: white;
text-shadow: 0 1px 0 rgba(0,0,0,.25);
background-image: -moz-linear-gradient(hsl(91,70%,90%), hsl(93,60%,81%));
box-shadow: 0 1px 0 hsla(92,81%,16%,.05) inset;
-moz-border-end-color: hsla(92,81%,16%,.2);
color: hsl(92,81%,16%);
}
#identity-box.verifiedIdentity:hover:active,
#identity-box.verifiedIdentity[open="true"] {
background-image: -moz-linear-gradient(hsl(92,65%,70%), hsl(92,40%,48%));
box-shadow: 0 1px 1px hsla(92,81%,16%,.6) inset,
0 1px 3px 1px hsla(92,81%,16%,.5) inset;
}
/* Identity popup icons */
@ -1146,7 +1175,25 @@ toolbar[iconsize="small"] #feed-button {
/* Notification icon box */
#notification-popup-box {
margin: 0 3px;
position: relative;
background-color: #fff;
background-clip: padding-box;
padding-left: 4px;
border-radius: 2.5px 0 0 2.5px;
-moz-border-image: url("chrome://browser/skin/urlbar-arrow.png") 0 8 0 0 / 0 8px 0 0;
-moz-margin-end: -8px;
margin-top: -1px;
margin-bottom: -1px;
}
#notification-popup-box:not([hidden]) + #identity-box {
-moz-padding-start: 10px;
border-radius: 0;
}
#notification-popup-box:-moz-locale-dir(rtl),
.notification-anchor-icon:-moz-locale-dir(rtl) {
-moz-transform: scaleX(-1);
}
.notification-anchor-icon {
@ -1256,7 +1303,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
#urlbar > toolbarbutton {
-moz-appearance: none;
list-style-image: url("chrome://browser/skin/reload-stop-go.png");
margin: -2px;
margin: -1px;
-moz-margin-start: 0;
padding: 0 3px;
background-origin: border-box;

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

@ -37,7 +37,7 @@ browser.jar:
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-small.png
skin/classic/browser/urlbar-favicon-glow.png
skin/classic/browser/urlbar-arrow.png
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
skin/classic/browser/feeds/videoFeedIcon.png (feeds/videoFeedIcon.png)

Двоичные данные
browser/themes/gnomestripe/browser/urlbar-arrow.png Normal file

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

После

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

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

До

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

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

@ -779,7 +779,7 @@ toolbar[mode="icons"] #zoom-in-button {
width: 7em;
min-width: 7em;
-moz-appearance: none;
box-shadow: 0 1px rgba(255, 255, 255, 0.2), inset 0 1px #d6d6d6;
box-shadow: 0 1px rgba(255, 255, 255, 0.2), inset 0 1px hsla(0,0%,0%,.05);
margin: 0 4px;
padding: 0;
border: 1px solid;
@ -807,45 +807,65 @@ toolbar[mode="icons"] #zoom-in-button {
}
#identity-box {
margin: 1px;
border-radius: 2px;
padding: 1px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
text-shadow: 0 1px rgba(255, 255, 255, 0.2);
}
#identity-box:-moz-focusring {
box-shadow: 0 0 2px 1px -moz-mac-focusring inset,
0 0 2px 2px -moz-mac-focusring;
}
#identity-box {
color: white;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
background-image: -moz-linear-gradient(hsl(0,0%,98%), hsl(0,0%,92%));
box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset;
-moz-border-end: 1px solid hsla(0,0%,0%,.1);
-moz-margin-end: 3px;
padding: 1px 4px;
}
#identity-box {
background-image: -moz-linear-gradient(#FFF, #DDD);
#identity-box:-moz-locale-dir(ltr) {
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
#identity-box:-moz-locale-dir(rtl) {
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
#identity-box:active:hover,
#identity-box[open="true"] {
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35),
inset 0 0 0 20px rgba(0, 0, 0, 0.06);
background-image: -moz-linear-gradient(hsl(0,0%,93%), hsl(0,0%,80%));
box-shadow: 0 1px 1px hsla(0,0%,0%,.3) inset,
0 1px 3px hsla(0,0%,0%,.3) inset;
}
#identity-box.verifiedDomain {
background-image: -moz-linear-gradient(#588EC6, #3C68AE);
background-image: -moz-linear-gradient(hsl(215,60%,92%), hsl(215,58%,88%));
-moz-border-end-color: hsla(215,54%,33%,.2);
color: hsl(215,54%,33%);
}
#identity-box.verifiedDomain:active:hover,
#identity-box.verifiedDomain[open="true"] {
background-image: -moz-linear-gradient(hsl(215,85%,85%), hsl(215,70%,68%));
box-shadow: 0 1px 1px hsla(215,54%,33%,.7) inset,
0 1px 3px 1px hsla(215,54%,33%,.5) inset;
}
#identity-box.verifiedIdentity {
background-image: -moz-linear-gradient(#84BB40, #5BA020);
background-image: -moz-linear-gradient(hsl(91,70%,90%), hsl(93,60%,81%));
-moz-border-end-color: hsla(92,81%,16%,.2);
color: hsl(92,100%,20%);
}
#identity-box.verifiedIdentity:active:hover,
#identity-box.verifiedIdentity[open="true"] {
background-image: -moz-linear-gradient(hsl(92,69%,77%), hsl(92,44%,51%));
box-shadow: 0 1px 1px hsla(92,81%,16%,.6) inset,
0 1px 3px 1px hsla(92,81%,16%,.5) inset;
}
#identity-box:-moz-focusring {
box-shadow: 0 0 2px 1px -moz-mac-focusring inset,
0 0 2px 2px -moz-mac-focusring;
-moz-border-end-style: none;
-moz-padding-end: 5px;
}
#identity-icon-labels {
margin: 0 4px 1px;
-moz-margin-start: 6px;
}
.urlbar-input-box {
@ -875,20 +895,8 @@ toolbar[mode="icons"] #zoom-in-button {
}
#page-proxy-stack {
width: 18px;
width: 16px;
height: 16px;
padding: 0 1px;
}
#identity-box.verifiedIdentity > hbox > #page-proxy-stack,
#identity-box.verifiedDomain > hbox > #page-proxy-stack {
width: 24px;
padding: 0 4px;
}
#identity-box.verifiedIdentity > hbox > #page-proxy-stack,
#identity-box.verifiedDomain > hbox > #page-proxy-stack {
background: url(urlbar-favicon-glow.png) center center no-repeat;
}
#page-proxy-favicon:not([src]) {
@ -2082,7 +2090,23 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
}
#notification-popup-box {
margin: 0 3px;
position: relative;
background-color: #fff;
background-clip: padding-box;
padding-left: 3px;
border-radius: 2px 0 0 2px;
-moz-border-image: url("chrome://browser/skin/urlbar-arrow.png") 0 8 0 0 / 0 8px 0 0;
-moz-margin-end: -8px;
}
#notification-popup-box:not([hidden]) + #identity-box {
-moz-padding-start: 10px;
border-radius: 0;
}
#notification-popup-box:-moz-locale-dir(rtl),
.notification-anchor-icon:-moz-locale-dir(rtl) {
-moz-transform: scaleX(-1);
}
.notification-anchor-icon {

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

@ -45,7 +45,7 @@ browser.jar:
skin/classic/browser/Secure-background.gif
skin/classic/browser/Toolbar.png
skin/classic/browser/toolbarbutton-dropmarker.png
skin/classic/browser/urlbar-favicon-glow.png
skin/classic/browser/urlbar-arrow.png
skin/classic/browser/urlbar-popup-blocked.png
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css)

Двоичные данные
browser/themes/pinstripe/browser/urlbar-arrow.png Normal file

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

После

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

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

До

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

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

@ -1176,50 +1176,79 @@ html|*.urlbar-input:-moz-lwtheme:-moz-placeholder,
/* identity box */
#identity-box {
background-color: -moz-dialog;
background-image: -moz-linear-gradient(rgba(255,255,255,.25), rgba(0,0,0,.15));
color: -moz-dialogText;
border-radius: 2px;
background-image: -moz-linear-gradient(hsl(0,0%,98%), hsl(0,0%,92%));
box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset;
-moz-border-end: 1px solid hsla(0,0%,0%,.1);
padding: 2px;
margin: -2px;
-moz-margin-end: 0;
}
#identity-box:-moz-locale-dir(ltr) {
border-top-left-radius: 2.5px;
border-bottom-left-radius: 2.5px;
}
#identity-box:-moz-locale-dir(rtl) {
border-top-right-radius: 2.5px;
border-bottom-right-radius: 2.5px;
}
#identity-box:hover {
background-image: -moz-linear-gradient(rgba(255,255,255,.5), rgba(50%,50%,50%,.2), rgba(0,0,0,.15));
background-image: -moz-linear-gradient(hsl(0,0%,95%), hsl(0,0%,87%));
}
#identity-box[open="true"],
#identity-box:hover:active {
background-image: -moz-linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,.1));
}
#identity-box.verifiedDomain,
#identity-box.verifiedIdentity {
color: white;
text-shadow: 0 1px 0 rgba(0,0,0,.25);
box-shadow: 0 0 0 1px rgba(0,0,0,.2) inset;
background-image: -moz-linear-gradient(hsl(0,0%,92%), hsl(0,0%,82%));
box-shadow: 0 1px 1px hsla(0,0%,0%,.3) inset,
0 1px 3px hsla(0,0%,0%,.3) inset;
}
#identity-box.verifiedDomain {
background-color: hsl(219,45%,60%);
background-image: -moz-linear-gradient(hsl(215,60%,92%), hsl(215,58%,88%));
box-shadow: 0 1px 0 hsla(215,54%,33%,.05) inset;
-moz-border-end-color: hsla(215,54%,33%,.2);
color: hsl(215,54%,33%);
}
#identity-box.verifiedDomain:hover {
background-image: -moz-linear-gradient(hsl(215,85%,85%), hsl(215,70%,68%));
}
#identity-box.verifiedDomain[open="true"],
#identity-box.verifiedDomain:hover:active {
background-image: -moz-linear-gradient(hsl(215,80%,80%), hsl(215,67%,65%));
box-shadow: 0 1px 1px hsla(215,54%,33%,.7) inset,
0 1px 3px 1px hsla(215,54%,33%,.5) inset;
}
#identity-box.verifiedIdentity {
background-color: hsl(92,45%,52%);
background-image: -moz-linear-gradient(hsl(91,70%,90%), hsl(93,60%,81%));
box-shadow: 0 1px 0 hsla(92,81%,16%,.05) inset;
-moz-border-end-color: hsla(92,81%,16%,.2);
color: hsl(92,100%,20%);
}
#identity-box.verifiedIdentity:hover {
background-image: -moz-linear-gradient(hsl(92,69%,77%), hsl(92,44%,51%));
}
#identity-box.verifiedIdentity[open="true"],
#identity-box.verifiedIdentity:hover:active {
background-image: -moz-linear-gradient(hsl(92,65%,70%), hsl(92,40%,48%));
box-shadow: 0 1px 1px hsla(92,81%,16%,.6) inset,
0 1px 3px 1px hsla(92,81%,16%,.5) inset;
}
#identity-box:-moz-focusring {
outline: 1px dotted -moz-DialogText;
outline: 1px dotted #000;
outline-offset: -3px;
}
#identity-box.verifiedDomain:-moz-focusring,
#identity-box.verifiedIdentity:-moz-focusring {
outline-color: white;
}
#identity-icon-labels {
-moz-margin-start: 1px;
-moz-margin-end: 3px;
-moz-transform: translate(0, -1px);
}
/* Location bar dropmarker */
@ -1255,7 +1284,6 @@ html|*.urlbar-input:-moz-lwtheme:-moz-placeholder,
width: 24px;
height: 18px;
padding: 1px 4px;
background: url(urlbar-favicon-glow.png) center center no-repeat;
}
#page-proxy-favicon:not([src]) {
@ -2029,7 +2057,25 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
/* Notification icon box */
#notification-popup-box {
margin: 0 3px;
position: relative;
background-color: #fff;
background-clip: padding-box;
padding-left: 3px;
border-radius: 2.5px 0 0 2.5px;
-moz-border-image: url("chrome://browser/skin/urlbar-arrow.png") 0 8 0 0 / 0 8px 0 0;
-moz-margin-end: -8px;
margin-top: -2px;
margin-bottom: -2px;
}
#notification-popup-box:not([hidden]) + #identity-box {
-moz-padding-start: 10px;
border-radius: 0;
}
#notification-popup-box:-moz-locale-dir(rtl),
.notification-anchor-icon:-moz-locale-dir(rtl) {
-moz-transform: scaleX(-1);
}
.notification-anchor-icon {

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

@ -45,7 +45,7 @@ browser.jar:
skin/classic/browser/menu-forward.png (menu-forward.png)
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
skin/classic/browser/urlbar-favicon-glow.png
skin/classic/browser/urlbar-arrow.png
skin/classic/browser/urlbar-popup-blocked.png
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
@ -158,7 +158,7 @@ browser.jar:
skin/classic/aero/browser/menu-forward.png (menu-forward-aero.png)
skin/classic/aero/browser/monitor.png
skin/classic/aero/browser/monitor_16-10.png
skin/classic/aero/browser/urlbar-favicon-glow.png
skin/classic/aero/browser/urlbar-arrow.png
skin/classic/aero/browser/urlbar-popup-blocked.png
skin/classic/aero/browser/feeds/feedIcon.png (feeds/feedIcon-aero.png)
skin/classic/aero/browser/feeds/feedIcon16.png (feeds/feedIcon16-aero.png)

Двоичные данные
browser/themes/winstripe/browser/urlbar-arrow.png Normal file

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

После

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

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

До

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

71
build/mobile/devicemanager.py Normal file → Executable file
Просмотреть файл

@ -572,11 +572,15 @@ class DeviceManager:
def processExist(self, appname):
pid = None
#remove the environment variables in the cli if they exist
#filter out extra spaces
parts = filter(lambda x: x != '', appname.split(' '))
appname = ' '.join(parts)
if len(parts[0].strip('"').split('=')) > 1:
appname = ' '.join(parts[1:])
#filter out the quoted env string if it exists
#ex: '"name=value;name2=value2;etc=..." process args' -> 'process args'
parts = appname.split('"')
if (len(parts) > 2):
appname = ' '.join(parts[2:]).strip()
pieces = appname.split(' ')
parts = pieces[0].split('/')
@ -996,31 +1000,35 @@ class DeviceManager:
# returns:
# success: status from test agent
# failure: None
def reboot(self, wait = False):
cmd = 'rebt'
if (self.debug >= 3): print "INFO: sending rebt command"
try:
status = self.sendCMD([cmd])
except DMError:
return None
def reboot(self, ipAddr=None, port=30000):
cmd = 'rebt'
if (wait == True):
#this sleeps up to 5 minutes in 30 second intervals
count = 0
while (count < 10):
if (self.debug >= 4): print "DEBUG: sleeping 30 seconds while waiting for reboot"
time.sleep(30)
waitstatus = self.getDeviceRoot()
if (waitstatus is not None):
break
self.retries = 0
count += 1
if (self.debug > 3): print "INFO: sending rebt command"
callbacksvrstatus = None
if (count >= 10):
if (ipAddr is not None):
#create update.info file:
try:
destname = '/data/data/com.mozilla.SUTAgentAndroid/files/update.info'
data = "%s,%s\rrebooting\r" % (ipAddr, port)
self.verifySendCMD(['push ' + destname + ' ' + str(len(data)) + '\r\n', data], newline = False)
except(DMError):
return None
if (self.debug >= 3): print "INFO: rebt- got status back: " + str(status)
ip, port = self.getCallbackIpAndPort(ipAddr, port)
cmd += " %s %s" % (ip, port)
# Set up our callback server
callbacksvr = callbackServer(ip, port, self.debug)
try:
status = self.verifySendCMD([cmd])
except(DMError):
return None
if (ipAddr is not None):
status = callbacksvr.disconnect()
if (self.debug > 3): print "INFO: rebt- got status back: " + str(status)
return status
# validate localDir from host to remoteDir on the device
@ -1277,9 +1285,6 @@ class DeviceManager:
except(DMError):
return False
if (self.reboot(True) == None):
return False
return True
gCallbackData = ''
@ -1289,11 +1294,14 @@ class myServer(SocketServer.TCPServer):
class callbackServer():
def __init__(self, ip, port, debuglevel):
global gCallbackData
if (debuglevel >= 1): print "DEBUG: gCallbackData is: %s on port: %s" % (gCallbackData, port)
gCallbackData = ''
self.ip = ip
self.port = port
self.connected = False
self.debug = debuglevel
if (self.debug >= 3) : print "Creating server with " + str(ip) + ":" + str(port)
if (self.debug >= 3): print "Creating server with " + str(ip) + ":" + str(port)
self.server = myServer((ip, port), self.myhandler)
self.server_thread = Thread(target=self.server.serve_forever)
self.server_thread.setDaemon(True)
@ -1307,6 +1315,8 @@ class callbackServer():
# Got the data back
if (self.debug >= 3): print "Got data back from agent: " + str(gCallbackData)
break
else:
if (self.debug >= 0): print '.',
time.sleep(step)
t += step
@ -1314,7 +1324,10 @@ class callbackServer():
if (self.debug >= 3): print "Shutting down server now"
self.server.shutdown()
except:
print "Unable to shutdown callback server - check for a connection on port: " + str(self.port)
if (self.debug >= 1): print "Unable to shutdown callback server - check for a connection on port: " + str(self.port)
#sleep 1 additional step to ensure not only we are online, but all our services are online
time.sleep(step)
return gCallbackData
class myhandler(SocketServer.BaseRequestHandler):

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

@ -450,7 +450,7 @@ XPIDL_COMPILE = $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX)
else
XPIDL_COMPILE = $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX)
endif
XPIDL_LINK = $(PYTHON) $(SDK_BIN_DIR)/xpt.py link
XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
# Java macros
JAVA_GEN_DIR = _javagen

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

@ -89,7 +89,7 @@ nsIMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
nsCOMPtr<nsIWidget> widget = GetWidget(sPresContext);
if (widget) {
PRUint32 newState = GetNewIMEState(sPresContext, nsnull);
SetIMEState(newState, nsnull, widget);
SetIMEState(newState, nsnull, widget, IMEContext::FOCUS_REMOVED);
}
sContent = nsnull;
sPresContext = nsnull;
@ -114,7 +114,7 @@ nsIMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
if (NS_FAILED(rv))
widget->ResetInputState();
PRUint32 newState = GetNewIMEState(sPresContext, nsnull);
SetIMEState(newState, nsnull, widget);
SetIMEState(newState, nsnull, widget, IMEContext::FOCUS_REMOVED);
}
sContent = nsnull;
@ -125,7 +125,8 @@ nsIMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
nsresult
nsIMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
nsIContent* aContent)
nsIContent* aContent,
PRUint32 aReason)
{
NS_ENSURE_ARG_POINTER(aPresContext);
@ -191,7 +192,7 @@ nsIMEStateManager::OnChangeFocus(nsPresContext* aPresContext,
if (newState != nsIContent::IME_STATUS_NONE) {
// Update IME state for new focus widget
SetIMEState(newState, aContent, widget);
SetIMEState(newState, aContent, widget, aReason);
}
sPresContext = aPresContext;
@ -204,7 +205,10 @@ void
nsIMEStateManager::OnInstalledMenuKeyboardListener(PRBool aInstalling)
{
sInstalledMenuKeyboardListener = aInstalling;
OnChangeFocus(sPresContext, sContent);
PRUint32 reason = aInstalling ? IMEContext::FOCUS_MOVED_TO_MENU
: IMEContext::FOCUS_MOVED_FROM_MENU;
OnChangeFocus(sPresContext, sContent, reason);
}
void
@ -236,7 +240,7 @@ nsIMEStateManager::UpdateIMEState(PRUint32 aNewIMEState, nsIContent* aContent)
// commit current composition
widget->ResetInputState();
SetIMEState(aNewIMEState, aContent, widget);
SetIMEState(aNewIMEState, aContent, widget, IMEContext::EDITOR_STATE_MODIFIED);
}
PRUint32
@ -289,7 +293,8 @@ private:
void
nsIMEStateManager::SetIMEState(PRUint32 aState,
nsIContent* aContent,
nsIWidget* aWidget)
nsIWidget* aWidget,
PRUint32 aReason)
{
if (aState & nsIContent::IME_STATUS_MASK_ENABLED) {
if (!aWidget)
@ -327,6 +332,12 @@ nsIMEStateManager::SetIMEState(PRUint32 aState,
}
}
if (XRE_GetProcessType() == GeckoProcessType_Content) {
context.mReason = aReason | IMEContext::FOCUS_FROM_CONTENT_PROCESS;
} else {
context.mReason = aReason;
}
aWidget->SetInputMode(context);
nsContentUtils::AddScriptRunner(new IMEEnabledStateChangedEvent(state));

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

@ -59,7 +59,8 @@ public:
static nsresult OnRemoveContent(nsPresContext* aPresContext,
nsIContent* aContent);
static nsresult OnChangeFocus(nsPresContext* aPresContext,
nsIContent* aContent);
nsIContent* aContent,
PRUint32 aReason);
static void OnInstalledMenuKeyboardListener(PRBool aInstalling);
// These two methods manage focus and selection/text observers.
@ -90,7 +91,7 @@ public:
protected:
static void SetIMEState(PRUint32 aState, nsIContent* aContent,
nsIWidget* aWidget);
nsIWidget* aWidget, PRUint32 aReason);
static PRUint32 GetNewIMEState(nsPresContext* aPresContext,
nsIContent* aContent);

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

@ -136,7 +136,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
setOrRestoreTabFocus(0);
SimpleTest.finish();
} else {
setTimeout(tab, 50);
setTimeout(tab, 0);
}
}
@ -161,7 +161,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
function doTest() {
setOrRestoreTabFocus(7);
setTimeout(start, 100);
setTimeout(start, 0);
}
SimpleTest.waitForExplicitFinish();

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

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=534833
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTests()">
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=534833">Mozilla Bug 534833</a>
<p id="display"></p>
<div id="content" style="display: none">
@ -21,6 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=534833
/** Test for Bug 534833 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTests);
var input1GotClick = 0;
var input2GotClick = 0;
@ -59,8 +60,13 @@ function nextTest_() {
}
function nextTest() {
document.getElementById("initialfocus").focus();
setTimeout(nextTest_, 100);
var el = document.getElementById("initialfocus");
el.addEventListener("focus", function() {
el.removeEventListener("focus", arguments.callee, false);
setTimeout(nextTest_, 0);
}, false);
el.focus();
}
function runTests() {

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

@ -629,8 +629,6 @@ static PRBool HasPotentialResource(nsIContent *aElement)
void nsHTMLMediaElement::SelectResource()
{
NS_ASSERTION(!mDelayingLoadEvent,
"Load event should not be delayed at start of resource selection.");
if (!HasPotentialResource(this)) {
// The media element has neither a src attribute nor any source
// element children, abort the load.

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

@ -153,13 +153,13 @@ function run() {
// Because link coloring is asynchronous, we wait until it is updated (or we
// timeout and fail anyway).
while (getColor($('colorlink')) != visitedColor) {
setTimeout(continueTest, 10);
setTimeout(continueTest, 0);
yield;
}
is(getColor($('colorlink')), visitedColor,
"Wrong link color after base change.");
while (getFill($('ellipselink')) != visitedFill) {
setTimeout(continueTest, 10);
setTimeout(continueTest, 0);
yield;
}
is(getFill($('ellipselink')), visitedFill,

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

@ -59,7 +59,7 @@ function checkLinkColor(aElmId, aExpectedColor, aMessage) {
return utils.getVisitedDependentComputedStyle($(aElmId), "", "color");
}
while (getColor() != aExpectedColor) {
setTimeout(continueTest, 10);
setTimeout(continueTest, 0);
return false;
}
is(getColor(), aExpectedColor, aMessage);

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

@ -27,7 +27,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=613113
SimpleTest.waitForExplicitFinish();
var invalidEvent = false;
var submit = false;
var form = document.forms[0];
var button = document.getElementsByTagName('button')[0];
@ -39,25 +38,20 @@ output.addEventListener("invalid", function() {
} else {
invalidEvent = true;
ok(true, "invalid event has been caught");
setTimeout(function() {
SimpleTest.finish();
}, 0);
}
}, false);
form.addEventListener("submit", function() {
submit = true;
ok(false, "submit event should not have been send");
}, false);
output.setCustomValidity("foo");
button.click();
setTimeout(function() {
if (!invalidEvent) {
ok(false, "invalid event should have been caught");
}
ok(!submit, "submit event should not have been send");
SimpleTest.finish();
}, 1000);
</script>
</pre>
</body>

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

@ -395,6 +395,10 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
return NS_ERROR_FAILURE;
}
if (IsToAnimation() && aBaseValue.IsNull()) {
return NS_ERROR_FAILURE;
}
// Get the normalised progress through the simple duration.
//
// If we have an indefinite simple duration, just set the progress to be
@ -428,19 +432,15 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
// NS_ABORT_IF_FALSE that tests that intervalProgress is in range will fail.
double intervalProgress = -1.f;
if (IsToAnimation()) {
if (aBaseValue.IsNull()) {
rv = NS_ERROR_FAILURE;
from = &aBaseValue;
to = &aValues[0];
if (calcMode == CALC_PACED) {
// Note: key[Times/Splines/Points] are ignored for calcMode="paced"
intervalProgress = simpleProgress;
} else {
from = &aBaseValue;
to = &aValues[0];
if (calcMode == CALC_PACED) {
// Note: key[Times/Splines/Points] are ignored for calcMode="paced"
intervalProgress = simpleProgress;
} else {
double scaledSimpleProgress =
ScaleSimpleProgress(simpleProgress, calcMode);
intervalProgress = ScaleIntervalProgress(scaledSimpleProgress, 0);
}
double scaledSimpleProgress =
ScaleSimpleProgress(simpleProgress, calcMode);
intervalProgress = ScaleIntervalProgress(scaledSimpleProgress, 0);
}
} else if (calcMode == CALC_PACED) {
rv = ComputePacedPosition(aValues, simpleProgress,
@ -474,13 +474,16 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
// Note: If interpolation failed (isn't supported for this type), the SVG
// spec says to force discrete mode.
if (calcMode == CALC_DISCRETE || NS_FAILED(rv)) {
double scaledSimpleProgress =
ScaleSimpleProgress(simpleProgress, CALC_DISCRETE);
if (IsToAnimation()) {
// SMIL 3, 12.6.4: Since a to animation has only 1 value, a discrete to
// animation will simply set the to value for the simple duration.
aResult = aValues[0];
// We don't follow SMIL 3, 12.6.4, where discrete to animations
// are the same as <set> animations. Instead, we treat it as a
// discrete animation with two values (the underlying value and
// the to="" value), and honor keyTimes="" as well.
PRUint32 index = (PRUint32)floor(scaledSimpleProgress * 2);
aResult = index == 0 ? aBaseValue : aValues[0];
} else {
double scaledSimpleProgress =
ScaleSimpleProgress(simpleProgress, CALC_DISCRETE);
PRUint32 index = (PRUint32)floor(scaledSimpleProgress * aValues.Length());
aResult = aValues[index];
}
@ -865,11 +868,9 @@ nsSMILAnimationFunction::CheckKeyTimes(PRUint32 aNumValues)
}
// no. keyTimes == no. values
// For to-animation the number of values is considered to be 2 unless it's
// discrete to-animation in which case either 1 or 2 is acceptable.
PRBool matchingNumOfValues = IsToAnimation() ?
calcMode == CALC_DISCRETE ? numKeyTimes <= 2 : numKeyTimes == 2 :
numKeyTimes == aNumValues;
// For to-animation the number of values is considered to be 2.
PRBool matchingNumOfValues =
numKeyTimes == (IsToAnimation() ? 2 : aNumValues);
if (!matchingNumOfValues) {
SetKeyTimesErrorFlag(PR_TRUE);
return;

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

@ -152,26 +152,36 @@ function main()
'times': [ [ 2, -100 ] ]
});
// to calcMode=discrete two keyTimes
// (technically, for discrete to-animation there is only ONE animation value
// but we allow two keyTimes to be specified since they're not going to have
// any effect anyway and this part of the spec is somewhat counter-intuitive.
// See bug 544855)
// unfrozen to calcMode=discrete two keyTimes
testCases.push({
'attr' : { 'to': '100',
'calcMode': 'discrete',
'keyTimes': '0.0; 1.0',
'fill': 'remove' },
'times': [ [ 0, -100 ],
[ 7, -100 ],
[ 10, -100 ],
[ 12, -100 ]]
});
// frozen to calcMode=discrete two keyTimes
testCases.push({
'attr' : { 'to': '100',
'calcMode': 'discrete',
'keyTimes': '0.0; 1.0' },
'times': [ [ 0, 100 ],
[ 7, 100 ] ]
'times': [ [ 0, -100 ],
[ 7, -100 ],
[ 10, 100 ],
[ 12, 100 ] ]
});
// to calcMode=discrete one keyTime
// to calcMode=discrete -- bad number of keyTimes (one, expecting two)
testCases.push({
'attr' : { 'to': '100',
'calcMode': 'discrete',
'keyTimes': '0' },
'times': [ [ 0, 100 ],
[ 7, 100 ] ]
'times': [ [ 0, -100 ],
[ 7, -100 ] ]
});
// values calcMode=discrete

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

@ -337,6 +337,22 @@ nsFocusManager::GetRedirectedFocus(nsIContent* aContent)
return nsnull;
}
// static
PRUint32
nsFocusManager::GetFocusMoveReason(PRUint32 aFlags)
{
PRUint32 reason = IMEContext::FOCUS_MOVED_UNKNOWN;
if (aFlags & nsIFocusManager::FLAG_BYMOUSE) {
reason = IMEContext::FOCUS_MOVED_BY_MOUSE;
} else if (aFlags & nsIFocusManager::FLAG_BYKEY) {
reason = IMEContext::FOCUS_MOVED_BY_KEY;
} else if (aFlags & nsIFocusManager::FLAG_BYMOVEFOCUS) {
reason = IMEContext::FOCUS_MOVED_BY_MOVEFOCUS;
}
return reason;
}
NS_IMETHODIMP
nsFocusManager::GetActiveWindow(nsIDOMWindow** aWindow)
{
@ -943,7 +959,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
nsIMEStateManager::OnTextStateBlur(nsnull, nsnull);
if (presShell) {
nsIMEStateManager::OnChangeFocus(presShell->GetPresContext(), nsnull);
nsIMEStateManager::OnChangeFocus(presShell->GetPresContext(), nsnull, IMEContext::FOCUS_REMOVED);
SetCaretVisible(presShell, PR_FALSE, nsnull);
}
@ -1484,7 +1500,7 @@ nsFocusManager::Blur(nsPIDOMWindow* aWindowToClear,
// compositionend event won't get fired at the element being blurred.
nsIMEStateManager::OnTextStateBlur(nsnull, nsnull);
if (mActiveWindow)
nsIMEStateManager::OnChangeFocus(presShell->GetPresContext(), nsnull);
nsIMEStateManager::OnChangeFocus(presShell->GetPresContext(), nsnull, IMEContext::FOCUS_REMOVED);
// now adjust the actual focus, by clearing the fields in the focus manager
// and in the window.
@ -1727,7 +1743,8 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
objectFrameWidget->SetFocus(PR_FALSE);
}
nsIMEStateManager::OnChangeFocus(presContext, aContent);
PRUint32 reason = GetFocusMoveReason(aFlags);
nsIMEStateManager::OnChangeFocus(presContext, aContent, reason);
// as long as this focus wasn't because a window was raised, update the
// commands
@ -1743,7 +1760,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
nsIMEStateManager::OnTextStateFocus(presContext, aContent);
} else {
nsIMEStateManager::OnTextStateBlur(presContext, nsnull);
nsIMEStateManager::OnChangeFocus(presContext, nsnull);
nsIMEStateManager::OnChangeFocus(presContext, nsnull, IMEContext::FOCUS_REMOVED);
if (!aWindowRaised) {
aWindow->UpdateCommands(NS_LITERAL_STRING("focus"));
}
@ -1766,7 +1783,7 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow,
nsPresContext* presContext = presShell->GetPresContext();
nsIMEStateManager::OnTextStateBlur(presContext, nsnull);
nsIMEStateManager::OnChangeFocus(presContext, nsnull);
nsIMEStateManager::OnChangeFocus(presContext, nsnull, IMEContext::FOCUS_REMOVED);
if (!aWindowRaised)
aWindow->UpdateCommands(NS_LITERAL_STRING("focus"));

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

@ -123,6 +123,13 @@ public:
*/
static nsIContent* GetRedirectedFocus(nsIContent* aContent);
/**
* Returns a flag indicating the source and/or reason of the focus change.
* This is used to indicate to the IME code if the focus come from a user
* input or a script for example.
*/
static PRUint32 GetFocusMoveReason(PRUint32 aFlags);
static PRBool sMouseFocusesFormControl;
protected:

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

@ -169,7 +169,7 @@ parent:
sync GetIMEEnabled() returns (PRUint32 value);
SetInputMode(PRUint32 value, nsString type, nsString actionHint);
SetInputMode(PRUint32 value, nsString type, nsString actionHint, PRUint32 reason);
sync GetIMEOpenState() returns (PRBool value);

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

@ -525,7 +525,7 @@ TabParent::RecvGetIMEEnabled(PRUint32* aValue)
}
bool
TabParent::RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction)
TabParent::RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction, const PRUint32& aReason)
{
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget || !AllowContentIME())
@ -535,6 +535,7 @@ TabParent::RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const
context.mStatus = aValue;
context.mHTMLInputType.Assign(aType);
context.mActionHint.Assign(aAction);
context.mReason = aReason;
widget->SetInputMode(context);
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();

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

@ -104,7 +104,7 @@ public:
virtual bool RecvEndIMEComposition(const PRBool& aCancel,
nsString* aComposition);
virtual bool RecvGetIMEEnabled(PRUint32* aValue);
virtual bool RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction);
virtual bool RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction, const PRUint32& aReason);
virtual bool RecvGetIMEOpenState(PRBool* aValue);
virtual bool RecvSetIMEOpenState(const PRBool& aValue);
virtual bool RecvGetDPI(float* aValue);

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

@ -131,7 +131,7 @@ _SUBDIR_TEST_FILES = \
_CHROME_TEST_FILES = \
test_chromeWorker.xul \
test_chromeWorkerComponent.xul \
test_chromeWorkerJSM.xul \
$(warning test_chromeWorkerJSM.xul disabled because the respective code has major problems and is being rewritten, see bug 625222) \
chromeWorker_worker.js \
chromeWorker_subworker.js \
$(NULL)

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

@ -474,8 +474,9 @@ public class GeckoAppShell
if (!mEnable)
return;
if (GeckoApp.surfaceView.mIMEState !=
GeckoSurfaceView.IME_STATE_DISABLED)
int state = GeckoApp.surfaceView.mIMEState;
if (state != GeckoSurfaceView.IME_STATE_DISABLED &&
state != GeckoSurfaceView.IME_STATE_PLUGIN)
imm.showSoftInput(GeckoApp.surfaceView, 0);
else
imm.hideSoftInputFromWindow(

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

@ -619,6 +619,7 @@ class GeckoSurfaceView
public static final int IME_STATE_DISABLED = 0;
public static final int IME_STATE_ENABLED = 1;
public static final int IME_STATE_PASSWORD = 2;
public static final int IME_STATE_PLUGIN = 3;
GeckoInputConnection inputConnection;
KeyListener mKeyListener;

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

@ -377,7 +377,8 @@ NS_GFX_(void) ScaleYCbCrToRGB565(const PRUint8 *y_buf,
that would require the mis-alignment to be the same for the U and V
planes.*/
NS_ASSERTION((y_pitch&15) == 0 && (uv_pitch&15) == 0 &&
((y_buf-NULL)&15) == 0 && ((u_buf-NULL)&15) == 0 && ((v_buf-NULL)&15) == 0,
((y_buf-(PRUint8 *)NULL)&15) == 0 &&
((u_buf-(PRUint8 *)NULL)&15) == 0 && ((v_buf-(PRUint8 *)NULL)&15) == 0,
"ScaleYCbCrToRGB565 source image unaligned");
/*We take an area-based approach to pixel coverage to avoid shifting by small
amounts (or not so small, when up-scaling or down-scaling by a large

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

@ -450,7 +450,7 @@ XPIDL_COMPILE = $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX)
else
XPIDL_COMPILE = $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX)
endif
XPIDL_LINK = $(PYTHON) $(SDK_BIN_DIR)/xpt.py link
XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link
# Java macros
JAVA_GEN_DIR = _javagen

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

@ -2824,6 +2824,9 @@ case "$target" in
*-freebsd*|*-kfreebsd*)
AC_DEFINE(AVMPLUS_UNIX)
;;
*-openbsd*)
AC_DEFINE(AVMPLUS_UNIX)
;;
*-gnu*)
AC_DEFINE(AVMPLUS_UNIX)
;;

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

@ -3290,21 +3290,37 @@ static JSFunctionSpec string_methods[] = {
offsetof(JSString::Data, inlineStorage)) }, \
{ {(c), 0x00} } }
#ifdef __SUNPRO_CC
/*
* For all the pragma pack usage in this file, the following logic applies:
* To apply: To reset:
* Sun CC: pack(#) / pack(0)
* IBM xlC: pack(#) / pack(pop)
* HP aCC: pack # / pack
* Others: pack(push, #) / pack(pop)
* The -Dlint case is explicitly excluded because GCC will error out when
* pack pragmas are used on unsupported platforms. If GCC is being used
* simply for error checking, these errors will be avoided.
*/
#if defined(__SUNPRO_CC) || defined(__xlC__)
#pragma pack(8)
#else
#elif defined(__HP_aCC)
#pragma pack 8
#elif !defined(lint)
#pragma pack(push, 8)
#endif
const JSString::Data JSAtom::unitStaticTable[]
#ifdef __GNUC__
#if defined(__GNUC__) || defined(__xlC__)
__attribute__ ((aligned (8)))
#endif
= { R8(0) };
#ifdef __SUNPRO_CC
#if defined(__SUNPRO_CC)
#pragma pack(0)
#else
#elif defined(__HP_aCC)
#pragma pack
#elif !defined(lint)
#pragma pack(pop)
#endif
@ -3350,21 +3366,25 @@ const jschar JSAtom::fromSmallChar[] = { R6(0) };
offsetof(JSString::Data, inlineStorage)) }, \
{ {FROM_SMALL_CHAR((c) >> 6), FROM_SMALL_CHAR((c) & 0x3F), 0x00} } }
#ifdef __SUNPRO_CC
#if defined(__SUNPRO_CC) || defined(__xlC__)
#pragma pack(8)
#else
#elif defined(__HP_aCC)
#pragma pack 8
#elif !defined(lint)
#pragma pack(push, 8)
#endif
const JSString::Data JSAtom::length2StaticTable[]
#ifdef __GNUC__
#if defined(__GNUC__) || defined(__xlC__)
__attribute__ ((aligned (8)))
#endif
= { R12(0) };
#ifdef __SUNPRO_CC
#if defined(__SUNPRO_CC)
#pragma pack(0)
#else
#elif defined(__HP_aCC)
#pragma pack
#elif !defined(lint)
#pragma pack(pop)
#endif
@ -3386,14 +3406,16 @@ __attribute__ ((aligned (8)))
JS_STATIC_ASSERT(100 + (1 << 7) + (1 << 4) + (1 << 3) + (1 << 2) == 256);
#ifdef __SUNPRO_CC
#if defined(__SUNPRO_CC) || defined(__xlC__)
#pragma pack(8)
#else
#elif defined(__HP_aCC)
#pragma pack 8
#elif !defined(lint)
#pragma pack(push, 8)
#endif
const JSString::Data JSAtom::hundredStaticTable[]
#ifdef __GNUC__
#if defined(__GNUC__) || defined(__xlC__)
__attribute__ ((aligned (8)))
#endif
= { R7(100), /* 100 through 227 */
@ -3414,9 +3436,11 @@ const JSString::Data *const JSAtom::intStaticTable[] = { R8(0) };
#undef R
#ifdef __SUNPRO_CC
#if defined(__SUNPRO_CC)
#pragma pack(0)
#else
#elif defined(__HP_aCC)
#pragma pack
#elif !defined(lint)
#pragma pack(pop)
#endif

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

@ -1360,6 +1360,8 @@ DocumentViewerImpl::Open(nsISupports *aState, nsISHEntry *aSHEntry)
nsresult rv = InitInternal(mParentWidget, aState, mBounds, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
mHidden = PR_FALSE;
if (mPresShell)
mPresShell->SetForwardingContainer(nsnull);

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

@ -71,7 +71,6 @@ _TEST_FILES = \
test_bug66619.html \
test_bug114649.html \
$(warning test_bug369950.html disabled due to random orange; see bug 492575) \
test_bug370436.html \
test_bug386575.xhtml \
test_bug388019.html \
test_bug394057.html \
@ -79,7 +78,6 @@ _TEST_FILES = \
test_bug399951.html \
test_bug404209.xhtml \
test_bug416896.html \
test_bug420499.xul \
test_bug423523.html \
test_bug445810.html \
test_bug449781.html \

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

@ -44,8 +44,10 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_CHROME_FILES = \
test_bug370436.html \
test_bug396367-1.html \
test_bug396367-2.html \
test_bug420499.xul \
test_bug504311.xul \
test_bug514660.xul \
test_bug533845.xul \

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

@ -5,10 +5,10 @@
-->
<head>
<title>Test for Bug 370436</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body>

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

@ -1,14 +1,14 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=420499
-->
<window title="Mozilla Bug 420499" onload="setTimeout(focusInput, 500);"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="/MochiKit/packed.js" />
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js" />
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>

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

@ -17,21 +17,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=608030
/** Test for Bug 608030 **/
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefService = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefService);
var domBranch = prefService.getBranch("dom.");
function get_pref()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
return domBranch.getBoolPref("send_after_paint_to_content");
return SpecialPowers.getBoolPref("dom.send_after_paint_to_content");
}
function set_pref(val)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
domBranch.setBoolPref("send_after_paint_to_content", val);
SpecialPowers.setBoolPref("dom.send_after_paint_to_content", val);
}
SimpleTest.waitForExplicitFinish();

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

@ -4290,7 +4290,7 @@ NPDrawingModel nsPluginInstanceOwner::GetDrawingModel()
PRBool nsPluginInstanceOwner::IsRemoteDrawingCoreAnimation()
{
if (mInstance)
if (!mInstance)
return PR_FALSE;
PRBool coreAnimation;

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

@ -3,8 +3,8 @@
class="reftest-wait"
onload="setTimeAndSnapshot(0.0, true)">
<script xlink:href="smil-util.js" type="text/javascript"/>
<rect x="15" y="15" width="200" height="100" fill="blue">
<rect x="15" y="15" width="200" height="200" fill="blue">
<animate attributeName="height" calcMode="discrete"
to="200" dur="2s"/>
to="100" dur="2s"/>
</rect>
</svg>

До

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

После

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

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

@ -3,8 +3,8 @@
class="reftest-wait"
onload="setTimeAndSnapshot(0.99, true)">
<script xlink:href="smil-util.js" type="text/javascript"/>
<rect x="15" y="15" width="200" height="100" fill="blue">
<rect x="15" y="15" width="200" height="200" fill="blue">
<animate attributeName="height" calcMode="discrete"
to="200" dur="2s"/>
to="100" dur="2s"/>
</rect>
</svg>

До

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

После

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

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

@ -85,10 +85,10 @@
<feComponentTransfer>
<feFuncR type="table" tableValues="0 0 0 0">
<!-- The value should be "0 2 2 0" immediately. -->
<!-- The value should be "0 2 2 0" from 1s onwards. -->
<animate attributeName="tableValues"
calcMode="discrete"
begin="0s" dur="3s"
begin="0s" dur="2s"
to="0 2 2 0"
fill="freeze"/>

До

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

После

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

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

@ -1,14 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
class="reftest-wait" onload="setTimeAndSnapshot(2, true)">
<script xlink:href="smil-util.js" type="text/javascript"/>
<!-- In this test we will attempt to interpolate since fill is interpolatable
but fail since the base value can't be converted to an RGB color value
and hence should fall back to discrete calcMode which, in the case of
to-animation, sets the to value for the entire simple duration. -->
to-animation, sets the to value for the second half of the simple
duration. -->
<defs>
<linearGradient id="red">
<stop offset="0.0" stop-color="#f00"/>
</linearGradient>
</defs>
<rect width="100%" height="100%" fill="url(#red)">
<animate attributeName="fill" to="lime" dur="500s"/>
<animate attributeName="fill" to="lime" dur="3s"/>
</rect>
</svg>

До

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

После

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

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

@ -1,8 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg">
<!-- Test that an indefinite to-animation with discrete calcMode still applies
the to-value for the whole time. -->
<rect x="15" y="15" width="200" height="100" fill="blue">
<animate attributeName="height" to="200" dur="indefinite"
<!-- Test that an indefinite to-animation with discrete calcMode applies
the underlying value for the whole time. -->
<rect x="15" y="15" width="200" height="200" fill="blue">
<animate attributeName="height" to="100" dur="indefinite"
calcMode="discrete"/>
</rect>
</svg>

До

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

После

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

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

@ -1,8 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg">
<!-- Test that an indefinite to-animation that falls back to discrete calcMode
because the property is not interpolatable, still applies the to-value
because the property is not interpolatable, applies the underlying value
for the whole time. -->
<rect x="15" y="15" width="200" height="200" fill="blue" visibility="hidden">
<animate attributeName="visibility" to="visible" dur="indefinite"/>
<rect x="15" y="15" width="200" height="200" fill="blue" visibility="visible">
<animate attributeName="visibility" to="hidden" dur="indefinite"/>
</rect>
</svg>

До

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

После

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

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

@ -302,7 +302,7 @@
">
<animate attributeName="d"
calcMode="discrete"
begin="0s" dur="20s"
begin="0s" dur="2s"
to="M10,10
L40,10
l-30,60

До

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

После

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

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

@ -65,7 +65,7 @@
points="10,10 70,70 110,10 160,10 210,10">
<animate attributeName="points"
calcMode="discrete"
begin="0s" dur="20s"
begin="0s" dur="2s"
to="10,10 70,10 110,10 160,70 210,10"
fill="freeze"/>
</polygon>

До

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

После

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

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

@ -65,7 +65,7 @@
points="10,10 70,70 110,10 160,10 210,10">
<animate attributeName="points"
calcMode="discrete"
begin="0s" dur="20s"
begin="0s" dur="2s"
to="10,10 70,10 110,10 160,70 210,10"
fill="freeze"/>
</polyline>

До

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

После

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

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

@ -61,10 +61,10 @@
<text transform="translate(320, 20)" rotate="10 20 30">JKL
<!-- The value should be "310 320 330" immediately. -->
<!-- The value should be "310 320 330" at 3s. -->
<animate attributeName="rotate"
calcMode="discrete"
begin="0s" dur="30s"
begin="0s" dur="6s"
to="310 320 330"
fill="freeze"/>

До

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

После

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

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

@ -101,6 +101,16 @@ class RemoteOptions(ReftestOptions):
type = "string", dest = "remoteLogFile",
help = "Name of log file on the device relative to device root. PLEASE USE ONLY A FILENAME.")
defaults["remoteLogFile"] = None
self.add_option("--enable-privilege", action="store_true", dest = "enablePrivilege",
help = "add webserver and port to the user.js file for remote script access and universalXPConnect")
defaults["enablePrivilege"] = False
self.add_option("--pidfile", action = "store",
type = "string", dest = "pidFile",
help = "name of the pidfile to generate")
defaults["pidFile"] = ""
defaults["localLogName"] = None
self.set_defaults(**defaults)
@ -153,6 +163,11 @@ class RemoteOptions(ReftestOptions):
options.logFile = options.remoteLogFile
if (options.pidFile != ""):
f = open(options.pidFile, 'w')
f.write("%s" % os.getpid())
f.close()
# TODO: Copied from main, but I think these are no longer used in a post xulrunner world
#options.xrePath = options.remoteTestRoot + self._automation._product + '/xulrunner'
#options.utilityPath = options.testRoot + self._automation._product + '/bin'
@ -238,6 +253,7 @@ class RemoteReftest(RefTest):
self.remoteTestRoot = options.remoteTestRoot
self.remoteLogFile = options.remoteLogFile
self.localLogName = options.localLogName
self.pidFile = options.pidFile
if self.automation.IS_DEBUG_BUILD:
self.SERVER_STARTUP_TIMEOUT = 180
else:
@ -304,6 +320,15 @@ class RemoteReftest(RefTest):
def createReftestProfile(self, options, profileDir):
RefTest.createReftestProfile(self, options, profileDir, server=options.remoteWebServer)
#workaround for jsreftests.
if options.enablePrivilege:
fhandle = open(os.path.join(profileDir, "user.js"), 'a')
fhandle.write("""
user_pref("capability.principal.codebase.p2.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");
user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
""" % (options.remoteWebServer, options.httpPort))
fhandle.close()
if (self._devicemanager.pushDir(profileDir, options.remoteProfile) == None):
raise devicemanager.FileError("Failed to copy profiledir to device")
@ -336,6 +361,11 @@ class RemoteReftest(RefTest):
self._devicemanager.removeDir(self.remoteProfile)
self._devicemanager.removeDir(self.remoteTestRoot)
RefTest.cleanup(self, profileDir)
if (self.pidFile != ""):
try:
os.remove(self.pidFile)
except:
print "Warning: cleaning up pidfile '%s' was unsuccessful from the test harness" % self.pidFile
def main():
dm_none = DeviceManager(None, None)

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

@ -514,8 +514,9 @@ nsBox::GetFlex(nsBoxLayoutState& aState)
PRUint32
nsIFrame::GetOrdinal(nsBoxLayoutState& aState)
{
PRUint32 ordinal = DEFAULT_ORDINAL_GROUP;
PRUint32 ordinal = GetStyleXUL()->mBoxOrdinal;
// When present, attribute value overrides CSS.
nsIContent* content = GetContent();
if (content) {
PRInt32 error;
@ -525,14 +526,6 @@ nsIFrame::GetOrdinal(nsBoxLayoutState& aState)
if (!value.IsEmpty()) {
ordinal = value.ToInteger(&error);
}
else {
// No attribute value. Check CSS.
const nsStyleXUL* boxInfo = GetStyleXUL();
if (boxInfo->mBoxOrdinal > 1) {
// The ordinal group was defined in CSS.
ordinal = (nscoord)boxInfo->mBoxOrdinal;
}
}
}
return ordinal;

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

@ -48,10 +48,29 @@ function saveMockCache() {
info("mock path: " + mockCachePath);
let mockCacheURI = getResolvedURI(mockCachePath);
info("mock URI: " + mockCacheURI.spec);
let mockCacheFile = getChromeDir(mockCacheURI);
info("mock file: " + mockCacheFile.path);
mockCacheFile.append("mock_autocomplete.json");
mockCacheFile.copyToFollowingLinks(gProfileDir, "autocomplete.json");
if (mockCacheURI instanceof Ci.nsIJARURI) {
// Android tests are stored in a JAR file, so we need to extract the mock_autocomplete.json file
info("jar file: " + mockCacheURI.JARFile.spec);
let zReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
let fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].getService(Ci.nsIFileProtocolHandler);
let fileName = fileHandler.getFileFromURLSpec(mockCacheURI.JARFile.spec);
zReader.open(fileName);
let extract = mockCacheURI.spec.split("!")[1];
extract = extract.substring(1, extract.lastIndexOf("/") + 1);
extract += "mock_autocomplete.json";
info("extract path: " + extract);
let target = gProfileDir.clone();
target.append("autocomplete.json");
info("target path: " + target.path);
zReader.extract(extract, target);
} else {
// Tests are run from a folder, so we can just copy the mock_autocomplete.json file
let mockCacheFile = getChromeDir(mockCacheURI);
info("mock file: " + mockCacheFile.path);
mockCacheFile.append("mock_autocomplete.json");
mockCacheFile.copyToFollowingLinks(gProfileDir, "autocomplete.json");
}
// Listen for when the mock cache has been loaded
Services.obs.addObserver(function (aSubject, aTopic, aData) {

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

@ -1060,7 +1060,7 @@ nsHttpConnectionMgr::OnMsgReclaimConnection(PRInt32, void *param)
// The linear search is ok here because the number of idleconns
// in a single entry is generally limited to a small number (i.e. 6)
PRInt32 idx;
PRUint32 idx;
for (idx = 0; idx < ent->mIdleConns.Length(); idx++) {
nsHttpConnection *idleConn = ent->mIdleConns[idx];
if (idleConn->MaxBytesRead() < conn->MaxBytesRead())

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

@ -96,6 +96,11 @@ class RemoteOptions(MochitestOptions):
help = "ip address where the remote web server is hosted at")
defaults["sslPort"] = automation.DEFAULT_SSL_PORT
self.add_option("--pidfile", action = "store",
type = "string", dest = "pidFile",
help = "name of the pidfile to generate")
defaults["pidFile"] = ""
defaults["remoteTestRoot"] = None
defaults["logFile"] = "mochitest.log"
defaults["autorun"] = True
@ -149,6 +154,11 @@ class RemoteOptions(MochitestOptions):
else:
options.xrePath = options.utilityPath
if (options.pidFile != ""):
f = open(options.pidFile, 'w')
f.write("%s" % os.getpid())
f.close()
return options
def verifyOptions(self, options, mochitest):
@ -183,6 +193,11 @@ class MochiRemote(Mochitest):
self._dm.getFile(self.remoteLog, self.localLog)
self._dm.removeFile(self.remoteLog)
self._dm.removeDir(self.remoteProfile)
if (options.pidFile != ""):
try:
os.remove(options.pidFile)
except:
print "Warning: cleaning up pidfile '%s' was unsuccessful from the test harness" % options.pidFile
def findPath(self, paths, filename = None):
for path in paths:

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

@ -157,9 +157,10 @@ function testNext() {
pos++;
if (pos < TESTS.length) {
if (TESTS[pos].onload) {
let position = pos;
browser.addEventListener("load", function(aEvent) {
browser.removeEventListener(aEvent.type, arguments.callee, true);
TESTS[pos].onload(aEvent);
TESTS[position].onload(aEvent);
}, true);
}

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

@ -190,18 +190,7 @@ CommonDialog.prototype = {
button.setAttribute("default", "true");
// Set default focus / selection.
if (!this.hasInputField) {
let isOSX = ("nsILocalFileMac" in Components.interfaces);
if (isOSX)
this.ui.infoBody.focus();
else
button.focus();
} else {
if (this.args.promptType == "promptPassword")
this.ui.password1Textbox.select();
else
this.ui.loginTextbox.select();
}
this.setDefaultFocus(true);
if (this.args.enableDelay) {
this.setButtonsEnabledState(false);
@ -310,6 +299,33 @@ CommonDialog.prototype = {
this.setButtonsEnabledState(true);
},
setDefaultFocus : function(isInitialLoad) {
let b = (this.args.defaultButtonNum || 0);
let button = this.ui["button" + b];
if (!this.hasInputField) {
let isOSX = ("nsILocalFileMac" in Components.interfaces);
if (isOSX)
this.ui.infoBody.focus();
else
button.focus();
} else {
// When the prompt is initialized, focus and select the textbox
// contents. Afterwards, only focus the textbox.
if (this.args.promptType == "promptPassword") {
if (isInitialLoad)
this.ui.password1Textbox.select();
else
this.ui.password1Textbox.focus();
} else {
if (isInitialLoad)
this.ui.loginTextbox.select();
else
this.ui.loginTextbox.focus();
}
}
},
onCheckbox : function() {
this.args.checked = this.ui.checkbox.checked;
},

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

@ -438,12 +438,6 @@ function openTabPrompt(domWin, tabPrompt, args) {
winUtils.leaveModalStateWithWindow(callerWin);
PromptUtils.fireDialogEvent(domWin, "DOMModalDialogClosed");
// Restore focus to the previously focused element within tab.
let fm = Cc["@mozilla.org/focus-manager;1"].
getService(Ci.nsIFocusManager);
let e = fm.getFocusedElementForWindow(domWin.top, false, {});
fm.setFocus(e, fm.FLAG_NOSCROLL);
}
let newPrompt;

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

@ -54,10 +54,41 @@ Components.utils.import("resource://gre/modules/Services.jsm");
});
}, this);
function getIDHashForString(aStr) {
// return the two-digit hexadecimal code for a byte
function toHexString(charCode)
("0" + charCode.toString(16)).slice(-2);
let hasher = Cc["@mozilla.org/security/hash;1"].
createInstance(Ci.nsICryptoHash);
hasher.init(Ci.nsICryptoHash.MD5);
let stringStream = Cc["@mozilla.org/io/string-input-stream;1"].
createInstance(Ci.nsIStringInputStream);
stringStream.data = aStr ? aStr : "null";
hasher.updateFromStream(stringStream, -1);
// convert the binary hash data to a hex string.
let binary = hasher.finish(false);
let hash = [toHexString(binary.charCodeAt(i)) for (i in binary)].join("").toLowerCase();
return "{" + hash.substr(0, 8) + "-" +
hash.substr(8, 4) + "-" +
hash.substr(12, 4) + "-" +
hash.substr(16, 4) + "-" +
hash.substr(20) + "}";
}
var PluginProvider = {
// A dictionary mapping IDs to names and descriptions
plugins: null,
/**
* Called when the application is shutting down. Only necessary for tests
* to be able to simulate a shutdown.
*/
shutdown: function PL_shutdown() {
this.plugins = null;
},
/**
* Called to get an Addon with a particular ID.
*
@ -73,17 +104,9 @@ var PluginProvider = {
if (aId in this.plugins) {
let name = this.plugins[aId].name;
let description = this.plugins[aId].description;
let tags = this.plugins[aId].tags;
let tags = Cc["@mozilla.org/plugin/host;1"].
getService(Ci.nsIPluginHost).
getPluginTags({});
let selected = [];
tags.forEach(function(aTag) {
if (aTag.name == name && aTag.description == description)
selected.push(aTag);
}, this);
aCallback(new PluginWrapper(aId, name, description, selected));
aCallback(new PluginWrapper(aId, name, description, tags));
}
else {
aCallback(null);
@ -148,19 +171,24 @@ var PluginProvider = {
getPluginTags({});
this.plugins = {};
let seen = {};
let plugins = {};
tags.forEach(function(aTag) {
if (!(aTag.name in seen))
seen[aTag.name] = {};
if (!(aTag.description in seen[aTag.name])) {
let id = Cc["@mozilla.org/uuid-generator;1"].
getService(Ci.nsIUUIDGenerator).
generateUUID();
this.plugins[id] = {
if (!(aTag.name in plugins))
plugins[aTag.name] = {};
if (!(aTag.description in plugins[aTag.name])) {
let plugin = {
name: aTag.name,
description: aTag.description
description: aTag.description,
tags: [aTag]
};
seen[aTag.name][aTag.description] = true;
let id = getIDHashForString(aTag.name + aTag.description);
plugins[aTag.name][aTag.description] = plugin;
this.plugins[id] = plugin;
}
else {
plugins[aTag.name][aTag.description].tags.push(aTag);
}
}, this);
}

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

@ -0,0 +1,175 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// This verifies that duplicate plugins are coalesced and maintain their ID
// across restarts.
var PLUGINS = [{
name: "Duplicate Plugin 1",
description: "A duplicate plugin",
version: "1",
blocklisted: false,
disabled: false,
filename: "/home/mozilla/.plugins/dupplugin1.so"
}, {
name: "Duplicate Plugin 1",
description: "A duplicate plugin",
version: "1",
blocklisted: false,
disabled: false,
filename: "",
filename: "/usr/lib/plugins/dupplugin1.so"
}, {
name: "Duplicate Plugin 2",
description: "Another duplicate plugin",
version: "1",
blocklisted: false,
disabled: false,
filename: "/home/mozilla/.plugins/dupplugin2.so"
}, {
name: "Duplicate Plugin 2",
description: "Another duplicate plugin",
version: "1",
blocklisted: false,
disabled: false,
filename: "",
filename: "/usr/lib/plugins/dupplugin2.so"
}, {
name: "Non-duplicate Plugin", // 3
description: "Not a duplicate plugin",
version: "1",
blocklisted: false,
disabled: false,
filename: "/home/mozilla/.plugins/dupplugin3.so"
}, {
name: "Non-duplicate Plugin", // 4
description: "Not a duplicate because the descriptions are different",
version: "1",
blocklisted: false,
disabled: false,
filename: "",
filename: "/usr/lib/plugins/dupplugin4.so"
}, {
name: "Another Non-duplicate Plugin", // 5
description: "Not a duplicate plugin",
version: "1",
blocklisted: false,
disabled: false,
filename: "/home/mozilla/.plugins/dupplugin5.so"
}];
// A fake plugin host to return the plugins defined above
var PluginHost = {
getPluginTags: function(countRef) {
countRef.value = PLUGINS.length;
return PLUGINS;
},
QueryInterface: function(iid) {
if (iid.equals(Components.interfaces.nsIPluginHost)
|| iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
}
}
var PluginHostFactory = {
createInstance: function (outer, iid) {
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return PluginHost.QueryInterface(iid);
}
};
var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
registrar.registerFactory(Components.ID("{721c3e73-969e-474b-a6dc-059fd288c428}"),
"Fake Plugin Host",
"@mozilla.org/plugin/host;1", PluginHostFactory);
var gPluginIDs = [null, null, null, null, null];
function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
startupManager();
run_test_1();
}
function found_plugin(aNum, aId) {
if (gPluginIDs[aNum])
do_throw("Found duplicate of plugin " + aNum);
gPluginIDs[aNum] = aId;
}
// Test that the plugins were coalesced and all appear in the returned list
function run_test_1() {
AddonManager.getAddonsByTypes(["plugin"], function(aAddons) {
do_check_eq(aAddons.length, 5);
aAddons.forEach(function(aAddon) {
if (aAddon.name == "Duplicate Plugin 1") {
found_plugin(0, aAddon.id);
do_check_eq(aAddon.description, "A duplicate plugin");
}
else if (aAddon.name == "Duplicate Plugin 2") {
found_plugin(1, aAddon.id);
do_check_eq(aAddon.description, "Another duplicate plugin");
}
else if (aAddon.name == "Another Non-duplicate Plugin") {
found_plugin(5, aAddon.id);
do_check_eq(aAddon.description, "Not a duplicate plugin");
}
else if (aAddon.name == "Non-duplicate Plugin") {
if (aAddon.description == "Not a duplicate plugin")
found_plugin(3, aAddon.id);
else if (aAddon.description == "Not a duplicate because the descriptions are different")
found_plugin(4, aAddon.id);
else
do_throw("Found unexpected plugin with description " + aAddon.description);
}
else {
do_throw("Found unexpected plugin " + aAddon.name);
}
});
run_test_2();
});
}
// Test that disabling a coalesced plugin disables all its tags
function run_test_2() {
AddonManager.getAddonByID(gPluginIDs[0], function(p) {
do_check_false(p.userDisabled);
p.userDisabled = true;
do_check_true(PLUGINS[0].disabled);
do_check_true(PLUGINS[1].disabled);
run_test_3();
});
}
// Test that IDs persist across restart
function run_test_3() {
restartManager();
AddonManager.getAddonByID(gPluginIDs[0], function(p) {
do_check_neq(p, null);
do_check_eq(p.name, "Duplicate Plugin 1");
do_check_eq(p.description, "A duplicate plugin");
// Reorder the plugins and restart again
[PLUGINS[0], PLUGINS[1]] = [PLUGINS[1], PLUGINS[0]];
restartManager();
AddonManager.getAddonByID(gPluginIDs[0], function(p) {
do_check_neq(p, null);
do_check_eq(p.name, "Duplicate Plugin 1");
do_check_eq(p.description, "A duplicate plugin");
do_test_finished();
});
});
}

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

@ -166,6 +166,18 @@ function run_test_3(p) {
do_check_true(p.isActive);
do_check_eq(p.name, "Test Plug-in");
run_test_4();
});
}
// Verify that after a restart the test plugin has the same ID
function run_test_4() {
restartManager();
AddonManager.getAddonByID(gID, function(p) {
do_check_neq(p, null);
do_check_eq(p.name, "Test Plug-in");
do_test_finished();
});
}

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

@ -154,7 +154,7 @@ const TEST_ADDONS = [ "appdisabled_1", "appdisabled_2",
"userdisabled_1", "userdisabled_2" ];
const TEST_TIMEOUT = 20000; // 20 seconds
const TEST_TIMEOUT = 25000; // 25 seconds
var gTimeoutTimer;
// The number of SimpleTest.executeSoon calls to perform when waiting on an

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

@ -94,8 +94,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe
PREPARE REMOVEFILE a/b/7/71/7xtext0
PREPARE REMOVEFILE a/b/7/71/7xtext1
PREPARE REMOVEDIR a/b/7/71/
PREPARE REMOVEFILE a/b/7/7text0
PREPARE REMOVEFILE a/b/7/7text1
PREPARE REMOVEDIR a/b/7/
PREPARE REMOVEDIR a/b/6/
PREPARE REMOVEFILE a/b/5/5text1
@ -203,8 +201,6 @@ EXECUTE REMOVEFILE a/b/7/71/7xtest.exe
EXECUTE REMOVEFILE a/b/7/71/7xtext0
EXECUTE REMOVEFILE a/b/7/71/7xtext1
EXECUTE REMOVEDIR a/b/7/71/
EXECUTE REMOVEFILE a/b/7/7text0
EXECUTE REMOVEFILE a/b/7/7text1
EXECUTE REMOVEDIR a/b/7/
EXECUTE REMOVEDIR a/b/6/
EXECUTE REMOVEFILE a/b/5/5text1
@ -233,27 +229,27 @@ FINISH REMOVEFILE a/b/2/20/20png0.png
FINISH REMOVEFILE a/b/0/0exe0.exe
FINISH REMOVEFILE a/b/0/00/00text0
FINISH REMOVEDIR a/b/searchplugins/
a/b/searchplugins/, rv: 0
removing directory: a/b/searchplugins/, rv: 0
FINISH REMOVEDIR a/b/extensions/extensions1/
a/b/extensions/extensions1/, rv: 0
removing directory: a/b/extensions/extensions1/, rv: 0
FINISH REMOVEDIR a/b/extensions/extensions0/
a/b/extensions/extensions0/, rv: 0
removing directory: a/b/extensions/extensions0/, rv: 0
FINISH REMOVEDIR a/b/extensions/
a/b/extensions/, rv: 0
removing directory: a/b/extensions/, rv: 0
FINISH REMOVEDIR a/b/defaults/pref/
a/b/defaults/pref/, rv: 0
removing directory: a/b/defaults/pref/, rv: 0
FINISH REMOVEDIR a/b/defaults/
a/b/defaults/, rv: 0
removing directory: a/b/defaults/, rv: 0
FINISH REMOVEDIR a/b/2/20/
FINISH REMOVEDIR a/b/2/
FINISH REMOVEDIR a/b/0/00/
a/b/0/00/, rv: 0
removing directory: a/b/0/00/, rv: 0
FINISH REMOVEDIR a/b/0/
a/b/0/, rv: 0
removing directory: a/b/0/, rv: 0
FINISH REMOVEDIR a/b/
a/b/, rv: 0
removing directory: a/b/, rv: 0
FINISH REMOVEDIR a/
a/, rv: 0
removing directory: a/, rv: 0
FINISH ADD a/b/defaults/pref/channel-prefs.js
FINISH ADD precomplete
FINISH ADD a/b/searchplugins/searchpluginstext0
@ -294,9 +290,9 @@ FINISH REMOVEDIR a/b/9/94/
directory no longer exists; skipping
FINISH REMOVEDIR a/b/9/93/
FINISH REMOVEDIR a/b/9/92/
a/b/9/92/, rv: 0
removing directory: a/b/9/92/, rv: 0
FINISH REMOVEDIR a/b/9/91/
a/b/9/91/, rv: 0
removing directory: a/b/9/91/, rv: 0
FINISH REMOVEDIR a/b/9/90/
FINISH REMOVEDIR a/b/9/90/
directory no longer exists; skipping
@ -322,9 +318,9 @@ FINISH REMOVEDIR a/b/8/84/
directory no longer exists; skipping
FINISH REMOVEDIR a/b/8/83/
FINISH REMOVEDIR a/b/8/82/
a/b/8/82/, rv: 0
removing directory: a/b/8/82/, rv: 0
FINISH REMOVEDIR a/b/8/81/
a/b/8/81/, rv: 0
removing directory: a/b/8/81/, rv: 0
FINISH REMOVEDIR a/b/8/80/
FINISH REMOVEDIR a/b/8/80/
directory no longer exists; skipping
@ -336,8 +332,6 @@ FINISH REMOVEFILE a/b/7/71/7xtest.exe
FINISH REMOVEFILE a/b/7/71/7xtext0
FINISH REMOVEFILE a/b/7/71/7xtext1
FINISH REMOVEDIR a/b/7/71/
FINISH REMOVEFILE a/b/7/7text0
FINISH REMOVEFILE a/b/7/7text1
FINISH REMOVEDIR a/b/7/
FINISH REMOVEDIR a/b/6/
FINISH REMOVEFILE a/b/5/5text1

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

@ -91,8 +91,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe
PREPARE REMOVEFILE a/b/7/71/7xtext0
PREPARE REMOVEFILE a/b/7/71/7xtext1
PREPARE REMOVEDIR a/b/7/71/
PREPARE REMOVEFILE a/b/7/7text0
PREPARE REMOVEFILE a/b/7/7text1
PREPARE REMOVEDIR a/b/7/
PREPARE REMOVEDIR a/b/6/
PREPARE REMOVEFILE a/b/5/5text1
@ -198,8 +196,6 @@ EXECUTE REMOVEFILE a/b/7/71/7xtest.exe
EXECUTE REMOVEFILE a/b/7/71/7xtext0
EXECUTE REMOVEFILE a/b/7/71/7xtext1
EXECUTE REMOVEDIR a/b/7/71/
EXECUTE REMOVEFILE a/b/7/7text0
EXECUTE REMOVEFILE a/b/7/7text1
EXECUTE REMOVEDIR a/b/7/
EXECUTE REMOVEDIR a/b/6/
EXECUTE REMOVEFILE a/b/5/5text1
@ -227,27 +223,27 @@ FINISH REMOVEFILE a/b/2/20/20png0.png
FINISH REMOVEFILE a/b/0/0exe0.exe
FINISH REMOVEFILE a/b/0/00/00text0
FINISH REMOVEDIR a/b/searchplugins/
a/b/searchplugins/, rv: 0
removing directory: a/b/searchplugins/, rv: 0
FINISH REMOVEDIR a/b/extensions/extensions1/
a/b/extensions/extensions1/, rv: 0
removing directory: a/b/extensions/extensions1/, rv: 0
FINISH REMOVEDIR a/b/extensions/extensions0/
a/b/extensions/extensions0/, rv: 0
removing directory: a/b/extensions/extensions0/, rv: 0
FINISH REMOVEDIR a/b/extensions/
a/b/extensions/, rv: 0
removing directory: a/b/extensions/, rv: 0
FINISH REMOVEDIR a/b/defaults/pref/
a/b/defaults/pref/, rv: 0
removing directory: a/b/defaults/pref/, rv: 0
FINISH REMOVEDIR a/b/defaults/
a/b/defaults/, rv: 0
removing directory: a/b/defaults/, rv: 0
FINISH REMOVEDIR a/b/2/20/
FINISH REMOVEDIR a/b/2/
FINISH REMOVEDIR a/b/0/00/
a/b/0/00/, rv: 0
removing directory: a/b/0/00/, rv: 0
FINISH REMOVEDIR a/b/0/
a/b/0/, rv: 0
removing directory: a/b/0/, rv: 0
FINISH REMOVEDIR a/b/
a/b/, rv: 0
removing directory: a/b/, rv: 0
FINISH REMOVEDIR a/
a/, rv: 0
removing directory: a/, rv: 0
FINISH ADD precomplete
FINISH ADD a/b/searchplugins/searchpluginstext0
FINISH ADD a/b/searchplugins/searchpluginspng1.png
@ -287,9 +283,9 @@ FINISH REMOVEDIR a/b/9/94/
directory no longer exists; skipping
FINISH REMOVEDIR a/b/9/93/
FINISH REMOVEDIR a/b/9/92/
a/b/9/92/, rv: 0
removing directory: a/b/9/92/, rv: 0
FINISH REMOVEDIR a/b/9/91/
a/b/9/91/, rv: 0
removing directory: a/b/9/91/, rv: 0
FINISH REMOVEDIR a/b/9/90/
FINISH REMOVEDIR a/b/9/90/
directory no longer exists; skipping
@ -315,9 +311,9 @@ FINISH REMOVEDIR a/b/8/84/
directory no longer exists; skipping
FINISH REMOVEDIR a/b/8/83/
FINISH REMOVEDIR a/b/8/82/
a/b/8/82/, rv: 0
removing directory: a/b/8/82/, rv: 0
FINISH REMOVEDIR a/b/8/81/
a/b/8/81/, rv: 0
removing directory: a/b/8/81/, rv: 0
FINISH REMOVEDIR a/b/8/80/
FINISH REMOVEDIR a/b/8/80/
directory no longer exists; skipping
@ -329,8 +325,6 @@ FINISH REMOVEFILE a/b/7/71/7xtest.exe
FINISH REMOVEFILE a/b/7/71/7xtext0
FINISH REMOVEFILE a/b/7/71/7xtext1
FINISH REMOVEDIR a/b/7/71/
FINISH REMOVEFILE a/b/7/7text0
FINISH REMOVEFILE a/b/7/7text1
FINISH REMOVEDIR a/b/7/
FINISH REMOVEDIR a/b/6/
FINISH REMOVEFILE a/b/5/5text1

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

@ -72,8 +72,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe
PREPARE REMOVEFILE a/b/7/71/7xtext0
PREPARE REMOVEFILE a/b/7/71/7xtext1
PREPARE REMOVEDIR a/b/7/71/
PREPARE REMOVEFILE a/b/7/7text0
PREPARE REMOVEFILE a/b/7/7text1
PREPARE REMOVEDIR a/b/7/
PREPARE REMOVEDIR a/b/6/
PREPARE REMOVEFILE a/b/5/5text1
@ -168,10 +166,6 @@ FINISH REMOVEFILE a/b/7/71/7xtext0
backup_restore: backup file doesn't exist: a/b/7/71/7xtext0.moz-backup
FINISH REMOVEFILE a/b/7/71/7xtext1
backup_restore: backup file doesn't exist: a/b/7/71/7xtext1.moz-backup
FINISH REMOVEFILE a/b/7/7text0
backup_restore: backup file doesn't exist: a/b/7/7text0.moz-backup
FINISH REMOVEFILE a/b/7/7text1
backup_restore: backup file doesn't exist: a/b/7/7text1.moz-backup
FINISH REMOVEFILE a/b/5/5text1
backup_restore: backup file doesn't exist: a/b/5/5text1.moz-backup
FINISH REMOVEFILE a/b/5/5text0

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

@ -72,8 +72,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe
PREPARE REMOVEFILE a/b/7/71/7xtext0
PREPARE REMOVEFILE a/b/7/71/7xtext1
PREPARE REMOVEDIR a/b/7/71/
PREPARE REMOVEFILE a/b/7/7text0
PREPARE REMOVEFILE a/b/7/7text1
PREPARE REMOVEDIR a/b/7/
PREPARE REMOVEDIR a/b/6/
PREPARE REMOVEFILE a/b/5/5text1
@ -160,8 +158,6 @@ EXECUTE REMOVEFILE a/b/7/71/7xtest.exe
EXECUTE REMOVEFILE a/b/7/71/7xtext0
EXECUTE REMOVEFILE a/b/7/71/7xtext1
EXECUTE REMOVEDIR a/b/7/71/
EXECUTE REMOVEFILE a/b/7/7text0
EXECUTE REMOVEFILE a/b/7/7text1
EXECUTE REMOVEDIR a/b/7/
EXECUTE REMOVEDIR a/b/6/
EXECUTE REMOVEFILE a/b/5/5text1
@ -220,9 +216,9 @@ FINISH REMOVEDIR a/b/9/94/
directory no longer exists; skipping
FINISH REMOVEDIR a/b/9/93/
FINISH REMOVEDIR a/b/9/92/
a/b/9/92/, rv: 0
removing directory: a/b/9/92/, rv: 0
FINISH REMOVEDIR a/b/9/91/
a/b/9/91/, rv: 0
removing directory: a/b/9/91/, rv: 0
FINISH REMOVEDIR a/b/9/90/
FINISH REMOVEDIR a/b/9/90/
directory no longer exists; skipping
@ -248,9 +244,9 @@ FINISH REMOVEDIR a/b/8/84/
directory no longer exists; skipping
FINISH REMOVEDIR a/b/8/83/
FINISH REMOVEDIR a/b/8/82/
a/b/8/82/, rv: 0
removing directory: a/b/8/82/, rv: 0
FINISH REMOVEDIR a/b/8/81/
a/b/8/81/, rv: 0
removing directory: a/b/8/81/, rv: 0
FINISH REMOVEDIR a/b/8/80/
FINISH REMOVEDIR a/b/8/80/
directory no longer exists; skipping
@ -262,8 +258,6 @@ FINISH REMOVEFILE a/b/7/71/7xtest.exe
FINISH REMOVEFILE a/b/7/71/7xtext0
FINISH REMOVEFILE a/b/7/71/7xtext1
FINISH REMOVEDIR a/b/7/71/
FINISH REMOVEFILE a/b/7/7text0
FINISH REMOVEFILE a/b/7/7text1
FINISH REMOVEDIR a/b/7/
FINISH REMOVEDIR a/b/6/
FINISH REMOVEFILE a/b/5/5text1

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

@ -673,12 +673,16 @@ function checkUpdateLogContents(aCompareLogFile) {
// Replace error codes since they are different on each platform.
updateLogContents = updateLogContents.replace(/, err:.*\n/g, "\n");
// Replace to make the log parsing happy.
updateLogContents = updateLogContents.replace(/non-fatal error removing directory: /g, "");
updateLogContents = updateLogContents.replace(/non-fatal error /g, "");
// The FindFile results when enumerating the filesystem on Windows is not
// determistic so the results matching the following need to be ignored.
updateLogContents = updateLogContents.replace(/.* a\/b\/7\/7text.*\n/g, "");
let compareLog = do_get_file(aCompareLogFile);
let compareLogContents = readFileBytes(compareLog);
do_check_eq(updateLogContents, compareLogContents);
do_check_eq(compareLogContents, updateLogContents);
}
function checkUpdateLogContains(aCheckString) {

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

@ -62,8 +62,6 @@
#include "prlog.h"
#include "nsIAsyncVerifyRedirectCallback.h"
static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nsnull;
#if defined(PR_LOGGING)
//
// To enable logging (see prlog.h for full details):
@ -528,4 +526,4 @@ OfflineCacheUpdateChild::RecvFinish(const bool &succeeded,
}
}
}
}

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

@ -40,8 +40,6 @@
#include "nsOfflineCacheUpdate.h"
#include "nsIApplicationCache.h"
static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nsnull;
#if defined(PR_LOGGING)
//
// To enable logging (see prlog.h for full details):
@ -179,4 +177,4 @@ OfflineCacheUpdateParent::ApplicationCacheAvailable(nsIApplicationCache *aApplic
}
} // docshell
} // mozilla
} // mozilla

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

@ -233,6 +233,29 @@ struct nsIMEUpdatePreference {
struct IMEContext {
PRUint32 mStatus;
/* Does the change come from a trusted source */
enum {
FOCUS_REMOVED = 0x0001,
FOCUS_MOVED_UNKNOWN = 0x0002,
FOCUS_MOVED_BY_MOVEFOCUS = 0x0004,
FOCUS_MOVED_BY_MOUSE = 0x0008,
FOCUS_MOVED_BY_KEY = 0x0010,
FOCUS_MOVED_TO_MENU = 0x0020,
FOCUS_MOVED_FROM_MENU = 0x0040,
EDITOR_STATE_MODIFIED = 0x0080,
FOCUS_FROM_CONTENT_PROCESS = 0x0100
};
PRBool FocusMovedByUser() const {
return (mReason & FOCUS_MOVED_BY_MOUSE) || (mReason & FOCUS_MOVED_BY_KEY);
};
PRBool FocusMovedInContentProcess() const {
return (mReason & FOCUS_FROM_CONTENT_PROCESS);
};
PRUint32 mReason;
/* The type of the input if the input is a html input field */
nsString mHTMLInputType;

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

@ -52,6 +52,7 @@ using mozilla::unused;
#include "nsIdleService.h"
#include "nsWindow.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "nsRenderingContext.h"
#include "nsIDOMSimpleGestureEvent.h"
@ -1740,9 +1741,25 @@ nsWindow::ResetInputState()
NS_IMETHODIMP
nsWindow::SetInputMode(const IMEContext& aContext)
{
ALOGIME("IME: SetInputMode: s=%d", aContext.mStatus);
ALOGIME("IME: SetInputMode: s=%d trusted=%d", aContext.mStatus, aContext.mReason);
mIMEContext = aContext;
// Ensure that opening the virtual keyboard is allowed for this specific
// IMEContext depending on the content.ime.strict.policy pref
if (aContext.mStatus != nsIWidget::IME_STATUS_DISABLED &&
aContext.mStatus != nsIWidget::IME_STATUS_PLUGIN) {
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
PRBool useStrictPolicy = PR_FALSE;
if (NS_SUCCEEDED(prefs->GetBoolPref("content.ime.strict_policy", &useStrictPolicy))) {
if (useStrictPolicy && !aContext.FocusMovedByUser() &&
aContext.FocusMovedInContentProcess()) {
return NS_OK;
}
}
}
AndroidBridge::NotifyIMEEnabled(int(aContext.mStatus), aContext.mHTMLInputType, aContext.mActionHint);
return NS_OK;
}

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

@ -53,6 +53,7 @@
#ifdef MOZ_PLATFORM_MAEMO
#include "nsServiceManagerUtils.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "mozilla/Services.h"
#endif
@ -588,6 +589,22 @@ nsGtkIMModule::SetInputMode(nsWindow* aCaller, const IMEContext* aContext)
GtkIMContext *im = GetContext();
if (im) {
if (IsEnabled()) {
// Ensure that opening the virtual keyboard is allowed for this specific
// IMEContext depending on the content.ime.strict.policy pref
if (mIMEContext.mStatus != nsIWidget::IME_STATUS_DISABLED &&
mIMEContext.mStatus != nsIWidget::IME_STATUS_PLUGIN) {
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
PRBool useStrictPolicy = PR_FALSE;
if (NS_SUCCEEDED(prefs->GetBoolPref("content.ime.strict_policy", &useStrictPolicy))) {
if (useStrictPolicy && !mIMEContext.FocusMovedByUser() &&
mIMEContext.FocusMovedInContentProcess()) {
return NS_OK;
}
}
}
// It is not desired that the hildon's autocomplete mechanism displays
// user previous entered passwds, so lets make completions invisible
// in these cases.

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

@ -398,7 +398,8 @@ NS_IMETHODIMP
PuppetWidget::SetInputMode(const IMEContext& aContext)
{
if (mTabChild &&
mTabChild->SendSetInputMode(aContext.mStatus, aContext.mHTMLInputType, aContext.mActionHint))
mTabChild->SendSetInputMode(aContext.mStatus, aContext.mHTMLInputType,
aContext.mActionHint, aContext.mReason))
return NS_OK;
return NS_ERROR_FAILURE;
}

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

@ -427,7 +427,9 @@ nsresult
nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
{
// This method is only called when the global lock is held.
// XXX assert this
#ifdef DEBUG
nsProxyObjectManager::GetInstance()->GetLock().AssertCurrentThreadOwns();
#endif
nsProxyEventObject *peo;
@ -442,8 +444,8 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
nsProxyEventObject *newpeo;
// Both GetClass and QueryInterface call out to XPCOM, so we unlock for them
nsProxyObjectManager* pom = nsProxyObjectManager::GetInstance();
{
nsProxyObjectManager* pom = nsProxyObjectManager::GetInstance();
MutexAutoUnlock unlock(pom->GetLock());
nsProxyEventClass *pec;
@ -473,7 +475,13 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
// linked-list check.
for (peo = mFirst; peo; peo = peo->mNext) {
if (peo->GetClass()->GetProxiedIID().Equals(aIID)) {
delete newpeo;
{
// Deleting an nsProxyEventObject can call Release on an
// nsProxyObject, which can only happen when not holding
// the lock.
MutexAutoUnlock unlock(pom->GetLock());
delete newpeo;
}
*aResult = static_cast<nsISupports*>(peo->mXPTCStub);
peo->LockedAddRef();
return NS_OK;