Merge the last green changeset on mozilla-inbound to mozilla-central

This commit is contained in:
Ehsan Akhgari 2011-07-19 14:24:01 -04:00
Родитель d3104e01e1 50949ebeb2
Коммит f9d6ed3aa4
16 изменённых файлов: 93 добавлений и 124 удалений

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

@ -1691,7 +1691,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer_MOZILLA_2_0_BRANCH)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentTouch)

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

@ -490,7 +490,7 @@ class nsDocument : public nsIDocument,
public nsIDOMDocumentXBL,
public nsSupportsWeakReference,
public nsIScriptObjectPrincipal,
public nsIRadioGroupContainer_MOZILLA_2_0_BRANCH,
public nsIRadioGroupContainer,
public nsIApplicationCacheContainer,
public nsStubMutationObserver,
public nsIDOMDocumentTouch

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

@ -45,8 +45,8 @@ class nsIRadioVisitor;
class nsIFormControl;
#define NS_IRADIOGROUPCONTAINER_IID \
{ 0x06de7839, 0xd0db, 0x47d3, \
{ 0x82, 0x90, 0x3c, 0xb8, 0x62, 0x2e, 0xd9, 0x66 } }
{ 0x22924a01, 0x4360, 0x401b, \
{ 0xb1, 0xd1, 0x56, 0x8d, 0xf5, 0xa3, 0xda, 0x71 } }
/**
* A container that has multiple radio groups in it, defined by name.
@ -132,19 +132,6 @@ public:
NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
PRInt32 *aPositionIndex,
PRInt32 *aItemsInGroup) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer,
NS_IRADIOGROUPCONTAINER_IID)
#define NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_BRANCH_IID \
{ 0xaa9ec446, 0xcdc7, 0x4030, \
{ 0xab, 0x02, 0xda, 0x44, 0xee, 0xb1, 0x80, 0x0a } }
class nsIRadioGroupContainer_MOZILLA_2_0_BRANCH : public nsIRadioGroupContainer
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_IID)
virtual PRUint32 GetRequiredRadioCount(const nsAString& aName) const = 0;
virtual void RadioRequiredChanged(const nsAString& aName,
@ -153,7 +140,7 @@ public:
virtual void SetValueMissingState(const nsAString& aName, bool aValue) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer_MOZILLA_2_0_BRANCH,
NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_BRANCH_IID)
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer,
NS_IRADIOGROUPCONTAINER_IID)
#endif /* nsIRadioGroupContainer_h__ */

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

@ -328,12 +328,11 @@ DOMCI_NODE_DATA(HTMLFormElement, nsHTMLFormElement)
// QueryInterface implementation for nsHTMLFormElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLFormElement)
NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLFormElement,
NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLFormElement,
nsIDOMHTMLFormElement,
nsIForm,
nsIWebProgressListener,
nsIRadioGroupContainer,
nsIRadioGroupContainer_MOZILLA_2_0_BRANCH)
nsIRadioGroupContainer)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLFormElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLFormElement)

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

@ -94,7 +94,7 @@ class nsHTMLFormElement : public nsGenericHTMLElement,
public nsIDOMHTMLFormElement,
public nsIWebProgressListener,
public nsIForm,
public nsIRadioGroupContainer_MOZILLA_2_0_BRANCH
public nsIRadioGroupContainer
{
public:
nsHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);

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

@ -883,9 +883,7 @@ nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
if (mType == NS_FORM_INPUT_RADIO && aName == nsGkAtoms::required) {
nsIRadioGroupContainer* c = GetRadioGroupContainer();
nsCOMPtr<nsIRadioGroupContainer_MOZILLA_2_0_BRANCH> container =
do_QueryInterface(c);
nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();
if (container) {
nsAutoString name;
@ -3343,10 +3341,8 @@ nsHTMLInputElement::AddedToRadioGroup()
// We initialize the validity of the element to the validity of the group
// because we assume UpdateValueMissingState() will be called after.
nsCOMPtr<nsIRadioGroupContainer_MOZILLA_2_0_BRANCH> container2 =
do_QueryInterface(container);
SetValidityState(VALIDITY_STATE_VALUE_MISSING,
container2->GetValueMissingState(name));
container->GetValueMissingState(name));
}
}
@ -3733,9 +3729,7 @@ nsHTMLInputElement::UpdateValueMissingValidityStateForRadio(bool aIgnoreSelf)
: HasAttr(kNameSpaceID_None, nsGkAtoms::required);
bool valueMissing = false;
nsIRadioGroupContainer* c = GetRadioGroupContainer();
nsCOMPtr<nsIRadioGroupContainer_MOZILLA_2_0_BRANCH> container =
do_QueryInterface(c);
nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();
if (!container) {
SetValidityState(VALIDITY_STATE_VALUE_MISSING, required && !selected);

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

@ -38,32 +38,7 @@
#include "nsSMILInstanceTime.h"
#include "nsSMILInterval.h"
#include "nsSMILTimeValueSpec.h"
//----------------------------------------------------------------------
// Helper classes
namespace
{
// Utility class to set a PRPackedBool value to PR_TRUE whilst it is in scope.
// Saves us having to remember to clear the flag at every possible return.
class AutoBoolSetter
{
public:
AutoBoolSetter(PRPackedBool& aValue)
: mValue(aValue)
{
mValue = PR_TRUE;
}
~AutoBoolSetter()
{
mValue = PR_FALSE;
}
private:
PRPackedBool& mValue;
};
}
#include "mozilla/AutoRestore.h"
//----------------------------------------------------------------------
// Implementation
@ -146,7 +121,8 @@ nsSMILInstanceTime::HandleChangedInterval(
PRBool objectChanged = mCreator->DependsOnBegin() ? aBeginObjectChanged :
aEndObjectChanged;
AutoBoolSetter setVisited(mVisited);
mozilla::AutoRestore<PRPackedBool> setVisited(mVisited);
mVisited = PR_TRUE;
nsRefPtr<nsSMILInstanceTime> deathGrip(this);
mCreator->HandleChangedInstanceTime(*GetBaseTime(), aSrcContainer, *this,
@ -224,7 +200,8 @@ nsSMILInstanceTime::IsDependentOn(const nsSMILInstanceTime& aOther) const
return PR_TRUE;
// mVisited is mutable
AutoBoolSetter setVisited(const_cast<nsSMILInstanceTime*>(this)->mVisited);
mozilla::AutoRestore<PRPackedBool> setVisited(const_cast<nsSMILInstanceTime*>(this)->mVisited);
const_cast<nsSMILInstanceTime*>(this)->mVisited = PR_TRUE;
return myBaseTime->IsDependentOn(aOther);
}

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

@ -110,6 +110,7 @@
#include "mozilla/Services.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/AutoRestore.h"
// we want to explore making the document own the load group
// so we can associate the document URI with the load group.
@ -10877,25 +10878,6 @@ nsDocShell::GetRootScrollFrame()
return shell->GetRootScrollFrameAsScrollableExternal();
}
#ifdef DEBUG
class nsDebugAutoBoolTrueSetter
{
public:
nsDebugAutoBoolTrueSetter(PRPackedBool *aBool)
: mBool(aBool)
{
*mBool = PR_TRUE;
}
~nsDebugAutoBoolTrueSetter()
{
*mBool = PR_FALSE;
}
protected:
PRPackedBool *mBool;
};
#endif
NS_IMETHODIMP
nsDocShell::EnsureScriptEnvironment()
{
@ -10915,7 +10897,8 @@ nsDocShell::EnsureScriptEnvironment()
// Yeah, this isn't re-entrant safe, but that's ok since if we
// re-enter this method, we'll infinitely loop...
nsDebugAutoBoolTrueSetter boolSetter(&mInEnsureScriptEnv);
AutoRestore<PRPackedBool> boolSetter(mInEnsureScriptEnv);
mInEnsureScriptEnv = PR_TRUE;
#endif
nsCOMPtr<nsIDOMScriptObjectFactory> factory =

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

@ -634,10 +634,14 @@ nsDeviceContext::BeginPage(void)
if (NS_FAILED(rv)) return rv;
/* We need to get a new surface for each page on the Mac */
#ifdef XP_MACOSX
// We need to get a new surface for each page on the Mac, as the
// CGContextRefs are only good for one page.
// And we don't null it out in EndPage because mPrintingSurface needs
// to be available also in-between EndPage/BeginPage (bug 665218).
mDeviceContextSpec->GetSurfaceForPrinter(getter_AddRefs(mPrintingSurface));
#endif
rv = mPrintingSurface->BeginPage();
return rv;
@ -648,13 +652,6 @@ nsDeviceContext::EndPage(void)
{
nsresult rv = mPrintingSurface->EndPage();
/* We need to release the CGContextRef in the surface here, plus it's
not something you would want anyway, as these CGContextRefs are only good
for one page. */
#ifdef XP_MACOSX
mPrintingSurface = nsnull;
#endif
if (mDeviceContextSpec)
mDeviceContextSpec->EndPage();

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

@ -85,7 +85,8 @@ GetSelfOrNearestBlock(nsIFrame* aFrame)
static bool
IsAtomicElement(nsIFrame* aFrame, const nsIAtom* aFrameType)
{
NS_PRECONDITION(!aFrame->GetStyleDisplay()->IsBlockOutside(),
NS_PRECONDITION(!nsLayoutUtils::GetAsBlock(aFrame) ||
!aFrame->GetStyleDisplay()->IsBlockOutside(),
"unexpected block frame");
NS_PRECONDITION(aFrameType != nsGkAtoms::placeholderFrame,
"unexpected placeholder frame");

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

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html class="reftest-wait"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Testcase for bug 578977</title>
</head>
<body>
<iframe src="578977.xul" onload="this.style.width='500px'; setTimeout(function(){document.documentElement.removeAttribute('class')},0)"></iframe>
</body>
</html>

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

@ -0,0 +1,10 @@
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<td xmlns="http://www.w3.org/1999/xhtml" style="position: fixed; unicode-bidi: bidi-override; max-width: 10px; line-height: 999999999px; word-wrap: break-word;letter-spacing: 10em;">m m mm&#1593;</td>
<style xmlns="http://www.w3.org/1999/xhtml">
td::first-letter {position: fixed; }
</style>
</window>

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

@ -334,6 +334,7 @@ load 570289-1.html
load 571618-1.svg
asserts(1) load 571975-1.html # bug 574889
load 574958.xhtml
asserts(0-4) load 578977.html # bug 610331
load 580504-1.xhtml
load 585598-1.xhtml
asserts(0-11) load 586806-1.html # Bug 439258
@ -365,4 +366,5 @@ load text-overflow-iframe.html
load text-overflow-bug666751-1.html
load text-overflow-bug666751-2.html
asserts(2) load text-overflow-bug670564.xhtml # asserts(2) for bug 436470
load text-overflow-bug671796.xhtml
load 667025.html

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

@ -0,0 +1,5 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body style="width: 1px; text-overflow: ellipsis; overflow-y: scroll;">
<math xmlns="http://www.w3.org/1998/Math/MathML"><msup style="display:block"/></math>
</body>
</html>

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

@ -256,41 +256,43 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
aMetrics.UnionOverflowAreasWithDesiredBounds();
ConsiderChildOverflow(aMetrics.mOverflowAreas, kid);
// Create a continuation or remove existing continuations based on
// the reflow completion status.
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
if (aReflowState.mLineLayout) {
aReflowState.mLineLayout->SetFirstLetterStyleOK(PR_FALSE);
}
nsIFrame* kidNextInFlow = kid->GetNextInFlow();
if (kidNextInFlow) {
// Remove all of the childs next-in-flows
static_cast<nsContainerFrame*>(kidNextInFlow->GetParent())
->DeleteNextInFlowChild(aPresContext, kidNextInFlow, PR_TRUE);
}
}
else {
// Create a continuation for the child frame if it doesn't already
// have one.
if (!GetStyleDisplay()->IsFloating()) {
nsIFrame* nextInFlow;
rv = CreateNextInFlow(aPresContext, kid, nextInFlow);
if (NS_FAILED(rv)) {
return rv;
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
// Create a continuation or remove existing continuations based on
// the reflow completion status.
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
if (aReflowState.mLineLayout) {
aReflowState.mLineLayout->SetFirstLetterStyleOK(PR_FALSE);
}
// And then push it to our overflow list
const nsFrameList& overflow = mFrames.RemoveFramesAfter(kid);
if (overflow.NotEmpty()) {
SetOverflowFrames(aPresContext, overflow);
nsIFrame* kidNextInFlow = kid->GetNextInFlow();
if (kidNextInFlow) {
// Remove all of the childs next-in-flows
static_cast<nsContainerFrame*>(kidNextInFlow->GetParent())
->DeleteNextInFlowChild(aPresContext, kidNextInFlow, PR_TRUE);
}
}
else {
// Create a continuation for the child frame if it doesn't already
// have one.
if (!GetStyleDisplay()->IsFloating()) {
nsIFrame* nextInFlow;
rv = CreateNextInFlow(aPresContext, kid, nextInFlow);
if (NS_FAILED(rv)) {
return rv;
}
// And then push it to our overflow list
const nsFrameList& overflow = mFrames.RemoveFramesAfter(kid);
if (overflow.NotEmpty()) {
SetOverflowFrames(aPresContext, overflow);
}
} else if (!kid->GetNextInFlow()) {
// For floating first letter frames (if a continuation wasn't already
// created for us) we need to put the continuation with the rest of the
// text that the first letter frame was made out of.
nsIFrame* continuation;
rv = CreateContinuationForFloatingParent(aPresContext, kid,
&continuation, PR_TRUE);
}
} else if (!kid->GetNextInFlow()) {
// For floating first letter frames (if a continuation wasn't already
// created for us) we need to put the continuation with the rest of the
// text that the first letter frame was made out of.
nsIFrame* continuation;
rv = CreateContinuationForFloatingParent(aPresContext, kid,
&continuation, PR_TRUE);
}
}

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

@ -105,6 +105,8 @@
#include "mozilla/ipc/TestShellParent.h"
#include "mozilla/ipc/XPCShellEnvironment.h"
#include "mozilla/Util.h" // for DebugOnly
#ifdef MOZ_IPDL_TESTS
#include "mozilla/_ipdltest/IPDLUnitTests.h"
#include "mozilla/_ipdltest/IPDLUnitTestProcessChild.h"
@ -417,7 +419,7 @@ XRE_InitChildProcess(int aArgc,
NS_ABORT_IF_FALSE(!*end, "invalid parent PID");
base::ProcessHandle parentHandle;
bool ok = base::OpenProcessHandle(parentPID, &parentHandle);
mozilla::DebugOnly<bool> ok = base::OpenProcessHandle(parentPID, &parentHandle);
NS_ABORT_IF_FALSE(ok, "can't open handle to parent");
#if defined(XP_WIN)
@ -683,7 +685,7 @@ XRE_ShutdownChildProcess()
{
NS_ABORT_IF_FALSE(MessageLoopForUI::current(), "Wrong thread!");
MessageLoop* ioLoop = XRE_GetIOMessageLoop();
mozilla::DebugOnly<MessageLoop*> ioLoop = XRE_GetIOMessageLoop();
NS_ABORT_IF_FALSE(!!ioLoop, "Bad shutdown order");
// Quit() sets off the following chain of events