Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-01-31 16:45:40 +00:00
Родитель 475a191ab6 286f7e4dba
Коммит 9218d6d77f
27 изменённых файлов: 493 добавлений и 154 удалений

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

@ -574,59 +574,6 @@ nsRootAccessible::Shutdown()
nsDocAccessibleWrap::Shutdown();
}
// nsRootAccessible protected member
already_AddRefed<nsIDocShellTreeItem>
nsRootAccessible::GetContentDocShell(nsIDocShellTreeItem *aStart)
{
if (!aStart) {
return nsnull;
}
PRInt32 itemType;
aStart->GetItemType(&itemType);
if (itemType == nsIDocShellTreeItem::typeContent) {
nsDocAccessible *accDoc = nsAccUtils::GetDocAccessibleFor(aStart);
// Hidden documents don't have accessibles (like SeaMonkey's sidebar),
// they are of no interest for a11y.
if (!accDoc)
return nsnull;
// If ancestor chain of accessibles is not completely visible,
// don't use this one. This happens for example if it's inside
// a background tab (tabbed browsing)
nsAccessible* parent = accDoc->Parent();
while (parent) {
if (parent->State() & states::INVISIBLE)
return nsnull;
if (parent == this)
break; // Don't check past original root accessible we started with
parent = parent->Parent();
}
NS_ADDREF(aStart);
return aStart;
}
nsCOMPtr<nsIDocShellTreeNode> treeNode(do_QueryInterface(aStart));
if (treeNode) {
PRInt32 subDocuments;
treeNode->GetChildCount(&subDocuments);
for (PRInt32 count = 0; count < subDocuments; count ++) {
nsCOMPtr<nsIDocShellTreeItem> treeItemChild, contentTreeItem;
treeNode->GetChildAt(count, getter_AddRefs(treeItemChild));
NS_ENSURE_TRUE(treeItemChild, nsnull);
contentTreeItem = GetContentDocShell(treeItemChild);
if (contentTreeItem) {
NS_ADDREF(aStart = contentTreeItem);
return aStart;
}
}
}
return nsnull;
}
// nsIAccessible method
Relation
nsRootAccessible::RelationByType(PRUint32 aType)
@ -634,14 +581,25 @@ nsRootAccessible::RelationByType(PRUint32 aType)
if (!mDocument || aType != nsIAccessibleRelation::RELATION_EMBEDS)
return nsDocAccessibleWrap::RelationByType(aType);
nsCOMPtr<nsIDocShellTreeItem> treeItem =
nsCoreUtils::GetDocShellTreeItemFor(mDocument);
nsCOMPtr<nsIDocShellTreeItem> contentTreeItem = GetContentDocShell(treeItem);
// there may be no content area, so we need a null check
if (!contentTreeItem)
return Relation();
nsIDOMWindow* rootWindow = mDocument->GetWindow();
if (rootWindow) {
nsCOMPtr<nsIDOMWindow> contentWindow;
rootWindow->GetContent(getter_AddRefs(contentWindow));
if (contentWindow) {
nsCOMPtr<nsIDOMDocument> contentDOMDocument;
contentWindow->GetDocument(getter_AddRefs(contentDOMDocument));
nsCOMPtr<nsIDocument> contentDocumentNode =
do_QueryInterface(contentDOMDocument);
if (contentDocumentNode) {
nsDocAccessible* contentDocument =
GetAccService()->GetDocAccessible(contentDocumentNode);
if (contentDocument)
return Relation(contentDocument);
}
}
}
return Relation(nsAccUtils::GetDocAccessibleFor(contentTreeItem));
return Relation();
}
////////////////////////////////////////////////////////////////////////////////

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

@ -127,8 +127,7 @@ protected:
PRUint32 GetChromeFlags();
#endif
already_AddRefed<nsIDocShellTreeItem>
GetContentDocShell(nsIDocShellTreeItem *aStart);
nsRefPtr<nsCaretAccessible> mCaretAccessible;
};

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

@ -48,6 +48,7 @@ include $(topsrcdir)/config/rules.mk
# test_tabbrowser.xul disabled for misusing <tabbrowser> (bug 715857)
_TEST_FILES =\
test_embeds.xul \
test_general.html \
test_general.xul \
test_tree.xul \

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

@ -0,0 +1,152 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Embeds relation tests">
<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>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../states.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript"
src="../relations.js"></script>
<script type="application/javascript">
<![CDATA[
////////////////////////////////////////////////////////////////////////////
// Helpers
function tabBrowser()
{
return gBrowserWnd.gBrowser;
}
function currentBrowser()
{
return tabBrowser().selectedBrowser;
}
function currentTabDocument()
{
return currentBrowser().contentDocument;
}
////////////////////////////////////////////////////////////////////////////
// Invokers
function loadURI(aURI)
{
this.invoke = function loadURI_invoke()
{
tabBrowser().loadURI(aURI);
}
this.eventSeq = [
new invokerChecker(EVENT_REORDER, currentBrowser)
];
this.finalCheck = function loadURI_finalCheck()
{
testRelation(gBrowserWnd.document, RELATION_EMBEDS,
getAccessible(currentTabDocument()));
}
this.getID = function loadURI_getID()
{
return "load uri " + aURI;
}
}
function loadOneTab(aURI)
{
this.invoke = function loadOneTab_invoke()
{
tabBrowser().loadOneTab(aURI, null, null, null, false);
}
this.eventSeq = [
new invokerChecker(EVENT_REORDER, currentBrowser)
];
this.finalCheck = function loadURI_finalCheck()
{
testRelation(gBrowserWnd.document, RELATION_EMBEDS,
getAccessible(currentTabDocument()));
}
this.getID = function loadOneTab_getID()
{
return "load uri '" + aURI + "' in new tab";
}
}
////////////////////////////////////////////////////////////////////////////
// Testing
var gBrowserWnd = null;
function loadBrowser()
{
gBrowserWnd = window.openDialog("chrome://browser/content/", "_blank",
"chrome,all,dialog=no", "about:");
addA11yLoadEvent(startTests, gBrowserWnd);
}
function startTests()
{
// Wait for tab load.
var browser = currentBrowser();
addA11yLoadEvent(doTests, browser.contentWindow);
}
//gA11yEventDumpToConsole = true; // debug
var gQueue = null;
function doTests()
{
testRelation(gBrowserWnd.document, RELATION_EMBEDS,
getAccessible(currentTabDocument()));
gQueue = new eventQueue();
gQueue.push(new loadURI("about:about"));
gQueue.push(new loadOneTab("about:mozilla"));
gQueue.onFinish = function()
{
gBrowserWnd.close();
}
gQueue.invoke();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(loadBrowser);
]]>
</script>
<vbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=707654"
title="Embeds relation on root accessible can return not content document">
Mozilla Bug 707654
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</vbox>
</window>

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

@ -126,19 +126,6 @@
testRelation("legend", RELATION_LABEL_FOR, "fieldset");
testRelation("fieldset", RELATION_LABELLED_BY, "legend");
// 'embeds' relation for root accessible
var docAcc = null;
var parentOfDocAcc = null;
var parentDocAcc = getAccessible(document);
do {
docAcc = parentDocAcc;
parentOfDocAcc = getAccessible(docAcc.parent, [nsIAccessNode]);
parentDocAcc = getAccessible(parentOfDocAcc.document,
[nsIAccessible]);
} while (getRole(parentDocAcc) != ROLE_CHROME_WINDOW)
testRelation(parentDocAcc, RELATION_EMBEDS, docAcc);
// finish test
SimpleTest.finish();
}

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

@ -103,19 +103,6 @@
// 'default button' relation
testRelation("textbox", RELATION_DEFAULT_BUTTON, "submit");
// 'embeds' relation for root accessible
var docAcc = null;
var parentOfDocAcc = null;
var parentDocAcc = getAccessible(document);
do {
docAcc = parentDocAcc;
parentOfDocAcc = getAccessible(docAcc.parent, [nsIAccessNode]);
parentDocAcc = getAccessible(parentOfDocAcc.document,
[nsIAccessible]);
} while (getRole(parentDocAcc) != ROLE_CHROME_WINDOW)
testRelation(parentDocAcc, RELATION_EMBEDS, docAcc);
// 'labelled by'/'label for' relation for xul:goupbox and xul:label of
// xul:caption
var groupboxAcc = getAccessible("groupbox");

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

@ -107,11 +107,6 @@ ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
endif
ifeq ($(OS_ARCH),WINNT)
RCINCLUDE = splash.rc
ifndef GNU_CC

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

@ -22,6 +22,22 @@ diff -ru a/csu/Makefile b/csu/Makefile
*) ;; \
esac; \
files="$(all-Banner-files)"; \
diff -ru a/Makerules b/Makerules
--- a/Makerules 2011-01-17 23:34:07.000000000 -0500
+++ b/Makerules 2012-01-30 08:47:56.565068903 -0500
@@ -992,9 +992,9 @@
echo ' Use the shared library, but some functions are only in';\
echo ' the static library, so try that secondarily. */';\
cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
+ echo 'GROUP ( libc.so$(libc.so-version)' \
+ '$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
+ ' AS_NEEDED (' $(rtld-installed-name) ') )' \
) > $@.new
mv -f $@.new $@
diff -ru a/nscd/nscd_stat.c b/nscd/nscd_stat.c
--- a/nscd/nscd_stat.c 2011-01-17 23:34:07.000000000 -0500
+++ b/nscd/nscd_stat.c 2012-01-23 15:54:45.231607606 -0500

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

@ -96,11 +96,6 @@ ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
endif
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),WINNT)

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html style="width: 1px">
<head>
<script>
function boom()
{
document.documentElement.offsetHeight;
var x = document.getElementById("x").firstChild;
x.data = "a" + x.data;
}
</script>
</head>
<body onload="boom();"><span id="x">
&#x202a;&#x10871;</span></body>
</html>

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

@ -347,3 +347,4 @@ load 691118-1.html
load 695861.html
load 698335.html
load 707098.html
load 722137.html

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

@ -819,12 +819,10 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
RemoveBidiContinuation(aBpd, frame,
frameIndex, newIndex, lineOffset);
}
} else if (runLength == fragmentLength &&
frame->GetNextSibling()) {
} else if (runLength == fragmentLength) {
/*
* If the directional run ends at the end of the frame, and this is
* not the containing frame's last child, make sure that the next
* frame is a non-fluid continuation
* If the directional run ends at the end of the frame, make sure
* that any continuation is non-fluid
*/
nsIFrame* next = frame->GetNextInFlow();
if (next) {

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

@ -61,6 +61,10 @@ public class FloatSize {
@Override
public String toString() { return "(" + width + "," + height + ")"; }
public boolean isPositive() {
return (width > 0 && height > 0);
}
public boolean fuzzyEquals(FloatSize size) {
return (FloatUtils.fuzzyEquals(size.width, width) &&
FloatUtils.fuzzyEquals(size.height, height));

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

@ -429,8 +429,14 @@ public class GeckoSoftwareLayerClient extends LayerClient implements GeckoEventL
DisplayMetrics metrics = new DisplayMetrics();
GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
if (!force && metrics.widthPixels == mScreenSize.width &&
metrics.heightPixels == mScreenSize.height) {
// Return immediately if the screen size hasn't changed or the viewport
// size is zero (which indicates that the rendering surface hasn't been
// allocated yet).
boolean screenSizeChanged = (metrics.widthPixels != mScreenSize.width ||
metrics.heightPixels != mScreenSize.height);
boolean viewportSizeValid = (getLayerController() != null &&
getLayerController().getViewportSize().isPositive());
if (!(force || (screenSizeChanged && viewportSizeValid))) {
return;
}

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

@ -71,6 +71,11 @@ public class MultiTileLayer extends Layer {
private final LinkedList<SubTile> mTiles;
private final HashMap<Long, SubTile> mPositionHash;
// Copies of the last set origin/resolution, to decide when to invalidate
// the buffer
private Point mOrigin;
private float mResolution;
public MultiTileLayer(CairoImage image, IntSize tileSize) {
super();
@ -102,7 +107,7 @@ public class MultiTileLayer extends Layer {
* Invalidates the backing buffer. Data will not be uploaded from an invalid
* backing buffer. This method is only valid inside a transaction.
*/
public void invalidateBuffer() {
protected void invalidateBuffer() {
if (!inTransaction()) {
throw new RuntimeException("invalidateBuffer() is only valid inside a transaction");
}
@ -181,17 +186,16 @@ public class MultiTileLayer extends Layer {
// entire width, regardless of the dirty-rect's width, and so
// can override existing data.
Point origin = getOffsetOrigin();
Rect validRect = tile.getValidTextureArea();
validRect.offset(tileOrigin.x - origin.x, tileOrigin.y - origin.y);
Region validRegion = new Region(validRect);
Region validRegion = new Region(tile.getValidTextureArea());
validRegion.translate(tileOrigin.x - origin.x, tileOrigin.y - origin.y);
validRegion.op(mValidRegion, Region.Op.INTERSECT);
// SingleTileLayer can't draw complex regions, so in that case,
// just invalidate the entire area.
tile.invalidateTexture();
if (!validRegion.isComplex()) {
validRect.set(validRegion.getBounds());
validRect.offset(origin.x - tileOrigin.x, origin.y - tileOrigin.y);
if (!validRegion.isEmpty() && !validRegion.isComplex()) {
validRegion.translate(origin.x - tileOrigin.x, origin.y - tileOrigin.y);
tile.getValidTextureArea().set(validRegion.getBounds());
}
} else {
// Update tile metrics
@ -286,7 +290,6 @@ public class MultiTileLayer extends Layer {
// valid by monitoring reflows on the browser element, or
// something along these lines.
LinkedList<SubTile> invalidTiles = new LinkedList<SubTile>();
Rect bounds = mValidRegion.getBounds();
for (ListIterator<SubTile> i = mTiles.listIterator(); i.hasNext();) {
SubTile tile = i.next();
@ -301,7 +304,7 @@ public class MultiTileLayer extends Layer {
// First bracketed clause: Invalidate off-screen, off-buffer tiles
// Second: Invalidate visible tiles at the wrong resolution that have updates
if ((!Rect.intersects(bounds, tilespaceTileBounds) &&
if ((!opRegion.op(tilespaceTileBounds, mValidRegion, Region.Op.INTERSECT) &&
!Rect.intersects(tilespaceViewport, tilespaceTileBounds)) ||
(!FloatUtils.fuzzyEquals(tile.getResolution(), getResolution()) &&
opRegion.op(tilespaceTileBounds, updateRegion, Region.Op.INTERSECT))) {
@ -415,9 +418,8 @@ public class MultiTileLayer extends Layer {
@Override
public void setOrigin(Point origin) {
Point oldOrigin = getOrigin();
if (!origin.equals(oldOrigin)) {
if (mOrigin == null || !origin.equals(mOrigin)) {
mOrigin = origin;
super.setOrigin(origin);
invalidateBuffer();
}
@ -425,9 +427,8 @@ public class MultiTileLayer extends Layer {
@Override
public void setResolution(float resolution) {
float oldResolution = getResolution();
if (!FloatUtils.fuzzyEquals(resolution, oldResolution)) {
if (!FloatUtils.fuzzyEquals(resolution, mResolution)) {
mResolution = resolution;
super.setResolution(resolution);
invalidateBuffer();
}
@ -441,7 +442,7 @@ public class MultiTileLayer extends Layer {
* Invalidates all sub-tiles. This should be called if the source backing
* this layer has changed. This method is only valid inside a transaction.
*/
public void invalidateTiles() {
protected void invalidateTiles() {
if (!inTransaction()) {
throw new RuntimeException("invalidateTiles() is only valid inside a transaction");
}

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

@ -2733,7 +2733,9 @@ pref("font.name.monospace.he", "Droid Sans Mono");
pref("font.name.serif.ja", "Droid Serif");
pref("font.name.sans-serif.ja", "Droid Sans Japanese");
pref("font.name.monospace.ja", "Droid Sans Mono");
pref("font.name.monospace.ja", "MotoyaLMaru");
pref("font.name-list.sans-serif.ja", "MotoyaLMaru, MotoyaLCedar, Droid Sans Japanese");
pref("font.name-list.monospace.ja", "MotoyaLMaru, MotoyaLCedar");
pref("font.name.serif.ko", "Droid Serif");
pref("font.name.sans-serif.ko", "Droid Sans");
@ -2750,38 +2752,44 @@ pref("font.name.monospace.tr", "Droid Sans Mono");
pref("font.name.serif.x-baltic", "Droid Serif");
pref("font.name.sans-serif.x-baltic", "Droid Sans");
pref("font.name.monospace.x-baltic", "Droid Sans Mono");
pref("font.name-list.sans-serif.x-baltic", "Roboto, Droid Sans");
pref("font.name.serif.x-central-euro", "Droid Serif");
pref("font.name.sans-serif.x-central-euro", "Droid Sans");
pref("font.name.monospace.x-central-euro", "Droid Sans Mono");
pref("font.name-list.sans-serif.x-central-euro", "Roboto, Droid Sans");
pref("font.name.serif.x-cyrillic", "Droid Serif");
pref("font.name.sans-serif.x-cyrillic", "Droid Sans");
pref("font.name.monospace.x-cyrillic", "Droid Sans Mono");
pref("font.name-list.sans-serif.x-cyrillic", "Roboto, Droid Sans");
pref("font.name.serif.x-unicode", "Droid Serif");
pref("font.name.sans-serif.x-unicode", "Droid Sans");
pref("font.name.monospace.x-unicode", "Droid Sans Mono");
pref("font.name-list.sans-serif.x-unicode", "Roboto, Droid Sans");
pref("font.name.serif.x-user-def", "Droid Serif");
pref("font.name.sans-serif.x-user-def", "Droid Sans");
pref("font.name.monospace.x-user-def", "Droid Sans Mono");
pref("font.name-list.sans-serif.x-user-def", "Roboto, Droid Sans");
pref("font.name.serif.x-western", "Droid Serif");
pref("font.name.sans-serif.x-western", "Droid Sans");
pref("font.name.monospace.x-western", "Droid Sans Mono");
pref("font.name-list.sans-serif.x-western", "Roboto, Droid Sans");
pref("font.name.serif.zh-CN", "Droid Serif");
pref("font.name.sans-serif.zh-CN", "Droid Sans");
pref("font.name.monospace.zh-CN", "Droid Sans Mono");
// ming_uni.ttf (HKSCS-2001)
// http://www.info.gov.hk/digital21/eng/hkscs/download/uime.exe
pref("font.name.serif.zh-HK", "Droid Serif");
pref("font.name.sans-serif.zh-HK", "Droid Sans");
pref("font.name.monospace.zh-HK", "Droid Sans Mono");
// zh-TW
pref("font.name.serif.zh-TW", "Droid Serif");
pref("font.name.sans-serif.zh-TW", "Droid Sans");
pref("font.name.monospace.zh-TW", "Droid Sans Mono");
pref("font.default.ar", "sans-serif");
pref("font.size.variable.ar", 16);

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

@ -154,6 +154,8 @@ nsNSSSocketInfo::nsNSSSocketInfo()
: mMutex("nsNSSSocketInfo::nsNSSSocketInfo"),
mFd(nsnull),
mCertVerificationState(before_cert_verification),
mCertVerificationStarted(0),
mCertVerificationEnded(0),
mSecurityState(nsIWebProgressListener::STATE_IS_INSECURE),
mSubRequestsHighSecurity(0),
mSubRequestsLowSecurity(0),
@ -960,6 +962,7 @@ nsNSSSocketInfo::SetCertVerificationWaiting()
NS_ASSERTION(mCertVerificationState != waiting_for_cert_verification,
"Invalid state transition to waiting_for_cert_verification");
mCertVerificationState = waiting_for_cert_verification;
mCertVerificationStarted = PR_IntervalNow();
}
void
@ -969,6 +972,8 @@ nsNSSSocketInfo::SetCertVerificationResult(PRErrorCode errorCode,
NS_ASSERTION(mCertVerificationState == waiting_for_cert_verification,
"Invalid state transition to cert_verification_finished");
mCertVerificationEnded = PR_IntervalNow();
if (errorCode != 0) {
SetCanceled(errorCode, errorMessageType);
} else if (mFd) {
@ -1025,11 +1030,36 @@ void nsNSSSocketInfo::SetAllowTLSIntoleranceTimeout(bool aAllow)
bool nsNSSSocketInfo::HandshakeTimeout()
{
if (mCertVerificationState == waiting_for_cert_verification) {
// Do not do a TLS interlerance timeout during cert verification because:
//
// * If we would have timed out, but cert verification is still ongoing,
// then the handshake probably already completed, and it is probably the
// certificate validation (OCSP responder or similar) that is timing
// out.
// * If certificate validation AND the handshake is slow, then that is a
// good indication that the network is bad, and so the problem probably
// isn't the server being TLS intolerant.
// * When we timeout, we return non-zero flags from PR_Poll, which will
// cause the application to try to read from and/or write to the socket,
// possibly in a loop. But, it is likely that the socket is blocked on
// cert authentication, so those read and/or write calls would result in
// PR_WOULD_BLOCK_ERROR, causing the application to spin.
return false;
}
if (!mHandshakeInProgress || !mAllowTLSIntoleranceTimeout)
return false;
return ((PRIntervalTime)(PR_IntervalNow() - mHandshakeStartTime)
> PR_SecondsToInterval(HANDSHAKE_TIMEOUT_SECONDS));
PRIntervalTime now = PR_IntervalNow();
PRIntervalTime certVerificationTime =
mCertVerificationEnded - mCertVerificationStarted;
PRIntervalTime totalTime = now - mHandshakeStartTime;
PRIntervalTime totalTimeExceptCertVerificationTime =
totalTime - certVerificationTime;
return totalTimeExceptCertVerificationTime >
PR_SecondsToInterval(HANDSHAKE_TIMEOUT_SECONDS);
}
void nsSSLIOLayerHelpers::Cleanup()
@ -2082,6 +2112,7 @@ nsSSLIOLayerPoll(PRFileDesc * fd, PRInt16 in_flags, PRInt16 *out_flags)
: "[%p] poll SSL socket using lower %d\n",
fd, (int) in_flags));
// See comments in HandshakeTimeout before moving and/or changing this block
if (socketInfo->HandshakeTimeout()) {
NS_ASSERTION(in_flags & PR_POLL_EXCEPT,
"caller did not poll for EXCEPT (handshake timeout)");

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

@ -184,6 +184,8 @@ protected:
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
PRFileDesc* mFd;
CertVerificationState mCertVerificationState;
PRIntervalTime mCertVerificationStarted;
PRIntervalTime mCertVerificationEnded;
PRUint32 mSecurityState;
PRInt32 mSubRequestsHighSecurity;
PRInt32 mSubRequestsLowSecurity;

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

@ -1955,7 +1955,21 @@ ssl_Poll(PRFileDesc *fd, PRInt16 how_flags, PRInt16 *p_out_flags)
} else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) &&
(ss->pendingBuf.len != 0)) { /* write data waiting to be sent */
new_flags |= PR_POLL_WRITE; /* also select on write. */
}
}
if (ss->version >= SSL_LIBRARY_VERSION_3_0 &&
ss->ssl3.hs.restartTarget != NULL) {
/* Read and write will block until the asynchronous callback completes
* (e.g. until SSL_AuthCertificateComplete is called), so don't tell
* the caller to poll the socket unless there is pending write data.
*/
if (ss->lastWriteBlocked && ss->pendingBuf.len != 0) {
new_flags &= (PR_POLL_WRITE | PR_POLL_EXCEPT);
} else {
new_flags = 0;
}
}
if (new_flags && (fd->lower->methods->poll != NULL)) {
PRInt16 lower_out_flags = 0;
PRInt16 lower_new_flags;

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

@ -4,5 +4,6 @@ on top of the NSS release.
bug-542832-ssl-restart-4.patch and bug-542832-ssl-restart-tstclnt-4.patch were
added so that we could test the new PSM SSL threading code (bug 674147) and
SPDY (bug 528288). bug-717906-lowhash was added to fix an issue with recent
Mozilla builds on fedora. These patches will be removed when the NSS 3.13.2
Mozilla builds on fedora. bug-710176-ssl-restart-7-poll-v5.patch were added
to fix a bug 710176. These patches will be removed when the NSS 3.13.2
release that includes them is imported into mozilla-central.

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

@ -0,0 +1,40 @@
# HG changeset patch
# Parent 4560e2c22b83f85f9238b9094de7a190042676df
# User Brian Smith <bsmith@mozilla.com>
diff --git a/security/nss/lib/ssl/sslsock.c b/security/nss/lib/ssl/sslsock.c
--- a/security/nss/lib/ssl/sslsock.c
+++ b/security/nss/lib/ssl/sslsock.c
@@ -1950,17 +1950,31 @@ ssl_Poll(PRFileDesc *fd, PRInt16 how_fla
}
}
} else if ((new_flags & PR_POLL_READ) && (SSL_DataPending(fd) > 0)) {
*p_out_flags = PR_POLL_READ; /* it's ready already. */
return new_flags;
} else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) &&
(ss->pendingBuf.len != 0)) { /* write data waiting to be sent */
new_flags |= PR_POLL_WRITE; /* also select on write. */
- }
+ }
+
+ if (ss->version >= SSL_LIBRARY_VERSION_3_0 &&
+ ss->ssl3.hs.restartTarget != NULL) {
+ /* Read and write will block until the asynchronous callback completes
+ * (e.g. until SSL_AuthCertificateComplete is called), so don't tell
+ * the caller to poll the socket unless there is pending write data.
+ */
+ if (ss->lastWriteBlocked && ss->pendingBuf.len != 0) {
+ new_flags &= (PR_POLL_WRITE | PR_POLL_EXCEPT);
+ } else {
+ new_flags = 0;
+ }
+ }
+
if (new_flags && (fd->lower->methods->poll != NULL)) {
PRInt16 lower_out_flags = 0;
PRInt16 lower_new_flags;
lower_new_flags = fd->lower->methods->poll(fd->lower, new_flags,
&lower_out_flags);
if ((lower_new_flags & lower_out_flags) && (how_flags != new_flags)) {
PRInt16 out_flags = lower_out_flags & ~PR_POLL_RW;
if (lower_out_flags & PR_POLL_READ)

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

@ -1062,17 +1062,14 @@ NS_METHOD nsCocoaWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
return NS_OK;
}
// Note bug 278777, we need to update state when the window is unminimized
// from the dock by users.
NS_METHOD nsCocoaWindow::SetSizeMode(PRInt32 aMode)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
PRInt32 previousMode;
nsBaseWidget::GetSizeMode(&previousMode);
nsresult rv = nsBaseWidget::SetSizeMode(aMode);
NS_ENSURE_SUCCESS(rv, rv);
// mSizeMode will be updated in DispatchSizeModeEvent, which will be called
// from a delegate method that handles the state change during one of the
// calls below.
nsSizeMode previousMode = mSizeMode;
if (aMode == nsSizeMode_Normal) {
if ([mWindow isMiniaturized])
@ -1419,8 +1416,13 @@ nsCocoaWindow::ReportMoveEvent()
void
nsCocoaWindow::DispatchSizeModeEvent()
{
nsSizeMode newMode = GetWindowSizeMode(mWindow);
if (mSizeMode == newMode)
return;
mSizeMode = newMode;
nsSizeModeEvent event(true, NS_SIZEMODE, this);
event.mSizeMode = GetWindowSizeMode(mWindow);
event.mSizeMode = mSizeMode;
event.time = PR_IntervalNow();
nsEventStatus status = nsEventStatus_eIgnore;

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

@ -87,6 +87,8 @@ _CHROME_FILES = test_bug343416.xul \
window_composition_text_querycontent.xul \
test_input_events_on_deactive_window.xul \
test_position_on_resize.xul \
empty_window.xul \
test_sizemode_events.xul \
$(NULL)
# test_bug413277.html mac-only based on 604789, 605178
@ -109,7 +111,6 @@ _CHROME_FILES += native_menus_window.xul \
bug586713_window.xul \
test_key_event_counts.xul \
test_bug596600.xul \
window_bug596600.xul \
test_bug673301.xul \
$(NULL)
endif

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

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window title="Window for Test for Mozilla Bug 596600"
<window title="Empty window"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>

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

@ -36,9 +36,9 @@ function moveMouseTo(x, y, andThen) {
}
function openWindows() {
gLeftWindow = open('window_bug596600.xul', '_blank', 'chrome,screenX=50,screenY=50,width=200,height=200');
gLeftWindow = open('empty_window.xul', '_blank', 'chrome,screenX=50,screenY=50,width=200,height=200');
SimpleTest.waitForFocus(function () {
gRightWindow = open('window_bug596600.xul', '', 'chrome,screenX=300,screenY=50,width=200,height=200');
gRightWindow = open('empty_window.xul', '', 'chrome,screenX=300,screenY=50,width=200,height=200');
SimpleTest.waitForFocus(attachIFrameToRightWindow, gRightWindow);
}, gLeftWindow);
}

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

@ -0,0 +1,107 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window title="Test for bug 715867"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<title>Test for bug 715867</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<body xmlns="http://www.w3.org/1999/xhtml">
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
gWindow = null;
gSizeModeDidChange = false;
gSizeModeDidChangeTo = 0;
function sizemodeChanged(e) {
gSizeModeDidChange = true;
gSizeModeDidChangeTo = gWindow.windowState;
}
function expectSizeModeChange(newMode, duringActionCallback) {
gSizeModeDidChange = false;
duringActionCallback();
if (newMode == 0) {
// No change should have taken place, no event should have fired.
ok(!gSizeModeDidChange, "No sizemodechange event should have fired.");
} else {
// Size mode change event was expected to fire.
ok(gSizeModeDidChange, "A sizemodechanged event should have fired.");
is(gSizeModeDidChangeTo, newMode, "The new sizemode should have the expected value.");
}
}
function startTest() {
if (navigator.platform.indexOf("Lin") != -1) {
ok(true, "This test is disabled on Linux because it expects window sizemode changes to be synchronous (which is not the case on Linux).");
SimpleTest.finish();
return;
};
openWindow();
}
function openWindow() {
gWindow = open('empty_window.xul', '_blank', 'chrome,screenX=50,screenY=50,width=200,height=200,resizable');
SimpleTest.waitForFocus(runTest, gWindow);
}
function runTest() {
// Install event handler.
gWindow.addEventListener("sizemodechange", sizemodeChanged, false);
// Run tests.
expectSizeModeChange(gWindow.STATE_MINIMIZED, function () {
gWindow.minimize();
});
expectSizeModeChange(gWindow.STATE_NORMAL, function () {
gWindow.restore();
});
expectSizeModeChange(gWindow.STATE_MAXIMIZED, function () {
gWindow.maximize();
});
expectSizeModeChange(gWindow.STATE_NORMAL, function () {
gWindow.restore();
});
// Normal window resizing shouldn't fire a sizemodechanged event, bug 715867.
expectSizeModeChange(0, function () {
gWindow.resizeTo(gWindow.outerWidth + 10, gWindow.outerHeight);
});
expectSizeModeChange(0, function () {
gWindow.resizeTo(gWindow.outerWidth, gWindow.outerHeight + 10);
});
gWindow.removeEventListener("sizemodechange", sizemodeChanged, false);
gWindow.close();
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(startTest);
]]>
</script>
</window>

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

@ -145,21 +145,38 @@ static PRInt64 GetResident()
static void XMappingIter(PRInt64& Vsize, PRInt64& Resident)
{
Vsize = -1;
Resident = -1;
int mapfd = open("/proc/self/xmap", O_RDONLY);
struct stat st;
prxmap_t *prmapp;
prxmap_t *prmapp = NULL;
if (mapfd >= 0) {
if (!fstat(mapfd, &st)) {
int nmap = st.st_size / sizeof(prxmap_t);
prmapp = (prxmap_t*)malloc((nmap + 1) * sizeof(prxmap_t));
int n = read(mapfd, prmapp, (nmap + 1) * sizeof(prxmap_t));
if (n > 0) {
Vsize = 0;
Resident = 0;
for (int i = 0; i < n / sizeof(prxmap_t); i++) {
Vsize += prmapp[i].pr_size;
Resident += prmapp[i].pr_rss * prmapp[i].pr_pagesize;
while (1) {
// stat(2) on /proc/<pid>/xmap returns an incorrect value,
// prior to the release of Solaris 11.
// Here is a workaround for it.
nmap *= 2;
prmapp = (prxmap_t*)malloc((nmap + 1) * sizeof(prxmap_t));
if (!prmapp) {
// out of memory
break;
}
int n = pread(mapfd, prmapp, (nmap + 1) * sizeof(prxmap_t), 0);
if (n < 0) {
break;
}
if (nmap >= n / sizeof (prxmap_t)) {
Vsize = 0;
Resident = 0;
for (int i = 0; i < n / sizeof (prxmap_t); i++) {
Vsize += prmapp[i].pr_size;
Resident += prmapp[i].pr_rss * prmapp[i].pr_pagesize;
}
break;
}
free(prmapp);
}
free(prmapp);
}
@ -169,16 +186,14 @@ static void XMappingIter(PRInt64& Vsize, PRInt64& Resident)
static PRInt64 GetVsize()
{
PRInt64 Vsize = -1;
PRInt64 Resident = -1;
PRInt64 Vsize, Resident;
XMappingIter(Vsize, Resident);
return Vsize;
}
static PRInt64 GetResident()
{
PRInt64 Vsize = -1;
PRInt64 Resident = -1;
PRInt64 Vsize, Resident;
XMappingIter(Vsize, Resident);
return Resident;
}