Merge mozilla-central to mozilla-inbound

This commit is contained in:
Ed Morley
2013-02-14 11:09:15 +00:00
62 changed files with 486 additions and 496 deletions

View File

@@ -9,16 +9,11 @@ VPATH = @srcdir@
LIBRARY_NAME = AccessibleMarshal
MODULE = accessibility
XPIDL_MODULE = accessibility-msaa
GRE_MODULE = 1
DEFFILE = $(win_srcdir)/AccessibleMarshal.def
include $(DEPTH)/config/autoconf.mk
XPIDLSRCS = \
nsIWinAccessNode.idl \
$(NULL)
DEFINES += -DREGISTER_PROXY_DLL
GARBAGE += $(MIDL_GENERATED_FILES) done_gen dlldata.c

View File

@@ -1,20 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
%{C++
#include "guiddef.h"
%}
[ref] native MSCOMIIDRef(IID);
[uuid(63efe9c5-2610-4d2f-861b-e4ddfe1b70d9)]
interface nsIWinAccessNode : nsISupports
{
voidPtr queryNativeInterface([const] in MSCOMIIDRef aIID);
};

View File

@@ -272,6 +272,16 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
return true;
}
case eARIAReadonlyOrEditableIfDefined:
{
static const TokenTypeData data(
nsGkAtoms::aria_readonly, eBoolType,
0, states::READONLY, states::EDITABLE);
MapTokenType(aElement, aState, data);
return true;
}
case eARIARequired:
{
static const TokenTypeData data(

View File

@@ -39,6 +39,7 @@ enum EStateRule
eARIAPressed,
eARIAReadonly,
eARIAReadonlyOrEditable,
eARIAReadonlyOrEditableIfDefined,
eARIARequired,
eARIASelectable,
eReadonlyUntilEditable,

View File

@@ -178,7 +178,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eSelect | eTable,
states::FOCUSABLE,
eARIAMultiSelectable,
eARIAReadonly
eARIAReadonlyOrEditable
},
{ // gridcell
&nsGkAtoms::gridcell,
@@ -190,7 +190,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eTableCell,
kNoReqStates,
eARIASelectable,
eARIAReadonly
eARIAReadonlyOrEditableIfDefined
},
{ // group
&nsGkAtoms::group,

View File

@@ -22,6 +22,8 @@
#include "RootAccessible.h"
#include "States.h"
#include "StyleInfo.h"
#include "TableAccessible.h"
#include "TableCellAccessible.h"
#include "TreeWalker.h"
#include "nsContentUtils.h"
@@ -1597,6 +1599,22 @@ Accessible::ApplyARIAState(uint64_t* aState) const
if (aria::MapToState(mRoleMapEntry->attributeMap1, element, aState) &&
aria::MapToState(mRoleMapEntry->attributeMap2, element, aState))
aria::MapToState(mRoleMapEntry->attributeMap3, element, aState);
// ARIA gridcell inherits editable/readonly states from the grid until it's
// overridden.
if (mRoleMapEntry->Is(nsGkAtoms::gridcell) &&
!(*aState & (states::READONLY | states::EDITABLE))) {
const TableCellAccessible* cell = AsTableCell();
if (cell) {
TableAccessible* table = cell->Table();
if (table) {
Accessible* grid = table->AsAccessible();
uint64_t gridState = 0;
grid->ApplyARIAState(&gridState);
*aState |= (gridState & (states::READONLY | states::EDITABLE));
}
}
}
}
NS_IMETHODIMP

View File

@@ -514,6 +514,8 @@ public:
virtual TableAccessible* AsTable() { return nullptr; }
virtual TableCellAccessible* AsTableCell() { return nullptr; }
const TableCellAccessible* AsTableCell() const
{ return const_cast<Accessible*>(this)->AsTableCell(); }
bool IsTableRow() const { return HasGenericType(eTableRow); }

View File

@@ -45,18 +45,7 @@ nsAccessNodeWrap::~nsAccessNodeWrap()
// nsISupports methods
//-----------------------------------------------------
NS_IMPL_ISUPPORTS_INHERITED1(nsAccessNodeWrap, nsAccessNode, nsIWinAccessNode)
//-----------------------------------------------------
// nsIWinAccessNode methods
//-----------------------------------------------------
NS_IMETHODIMP
nsAccessNodeWrap::QueryNativeInterface(REFIID aIID, void** aInstancePtr)
{
// XXX Wrong for E_NOINTERFACE
return static_cast<nsresult>(QueryInterface(aIID, aInstancePtr));
}
NS_IMPL_ISUPPORTS_INHERITED0(nsAccessNodeWrap, nsAccessNode)
STDMETHODIMP nsAccessNodeWrap::QueryInterface(REFIID iid, void** ppv)
{
@@ -122,12 +111,12 @@ nsAccessNodeWrap::QueryService(REFGUID guidService, REFIID iid, void** ppv)
// Can get to IAccessibleApplication from any node via QS
if (guidService == IID_IAccessibleApplication ||
(Compatibility::IsJAWS() && iid == IID_IAccessibleApplication)) {
ApplicationAccessible* applicationAcc = ApplicationAcc();
ApplicationAccessibleWrap* applicationAcc =
static_cast<ApplicationAccessibleWrap*>(ApplicationAcc());
if (!applicationAcc)
return E_NOINTERFACE;
nsresult rv = applicationAcc->QueryNativeInterface(iid, ppv);
return NS_SUCCEEDED(rv) ? S_OK : E_NOINTERFACE;
return applicationAcc->QueryInterface(iid, ppv);
}
/**

View File

@@ -22,7 +22,6 @@
#include "nsCOMPtr.h"
#include "nsIAccessible.h"
#include "nsIAccessibleEvent.h"
#include "nsIWinAccessNode.h"
#include "nsIDOMElement.h"
#include "nsIContent.h"
#include "nsAccessNode.h"
@@ -55,12 +54,10 @@ namespace a11y {
#endif
class nsAccessNodeWrap : public nsAccessNode,
public nsIWinAccessNode,
public IServiceProvider
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIWINACCESSNODE
public: // construction, destruction
nsAccessNodeWrap(nsIContent* aContent, DocAccessible* aDoc);

View File

@@ -43,59 +43,6 @@ nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent)
return cssDecl.forget();
}
HRESULT
nsWinUtils::ConvertToIA2Array(nsIArray *aGeckoArray, IUnknown ***aIA2Array,
long *aIA2ArrayLen)
{
*aIA2Array = NULL;
*aIA2ArrayLen = 0;
if (!aGeckoArray)
return S_FALSE;
uint32_t length = 0;
nsresult rv = aGeckoArray->GetLength(&length);
if (NS_FAILED(rv))
return GetHRESULT(rv);
if (length == 0)
return S_FALSE;
*aIA2Array =
static_cast<IUnknown**>(::CoTaskMemAlloc((length) * sizeof(IUnknown*)));
if (!*aIA2Array)
return E_OUTOFMEMORY;
uint32_t idx = 0;
for (; idx < length; ++idx) {
nsCOMPtr<nsIWinAccessNode> winAccessNode =
do_QueryElementAt(aGeckoArray, idx, &rv);
if (NS_FAILED(rv))
break;
void *instancePtr = NULL;
nsresult rv = winAccessNode->QueryNativeInterface(IID_IUnknown,
&instancePtr);
if (NS_FAILED(rv))
break;
(*aIA2Array)[idx] = static_cast<IUnknown*>(instancePtr);
}
if (NS_FAILED(rv)) {
for (uint32_t idx2 = 0; idx2 < idx; idx2++) {
(*aIA2Array)[idx2]->Release();
(*aIA2Array)[idx2] = NULL;
}
::CoTaskMemFree(*aIA2Array);
return GetHRESULT(rv);
}
*aIA2ArrayLen = length;
return S_OK;
}
bool
nsWinUtils::MaybeStartWindowEmulation()
{

View File

@@ -30,13 +30,6 @@ public:
static already_AddRefed<nsIDOMCSSStyleDeclaration>
GetComputedStyleDeclaration(nsIContent* aContent);
/**
* Convert nsIArray array of accessible objects to an array of IUnknown*
* objects used in IA2 methods.
*/
static HRESULT ConvertToIA2Array(nsIArray *aCollection,
IUnknown ***aAccessibles, long *aCount);
/**
* Start window emulation if presence of specific AT is detected.
*/

View File

@@ -10,7 +10,6 @@
#include "AccessibleHyperlink_i.c"
#include "AccessibleWrap.h"
#include "nsIWinAccessNode.h"
using namespace mozilla::a11y;

View File

@@ -45,17 +45,12 @@ ia2AccessibleHypertext::get_hyperlink(long aLinkIndex,
return CO_E_OBJNOTCONNECTED;
Accessible* hyperLink = hyperText->GetLinkAt(aLinkIndex);
nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryObject(hyperLink));
if (!winAccessNode)
if (!hyperText)
return E_FAIL;
void *instancePtr = NULL;
nsresult rv = winAccessNode->QueryNativeInterface(IID_IAccessibleHyperlink,
&instancePtr);
if (NS_FAILED(rv))
return E_FAIL;
*aHyperlink = static_cast<IAccessibleHyperlink*>(instancePtr);
*aHyperlink =
static_cast<IAccessibleHyperlink*>(static_cast<AccessibleWrap*>(hyperLink));
(*aHyperlink)->AddRef();
return S_OK;
A11Y_TRYBLOCK_END

View File

@@ -163,7 +163,11 @@ ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget)
if (aTargetIndex < 0 || (uint32_t)aTargetIndex >= mTargets.Length() || !aTarget)
return E_INVALIDARG;
mTargets[aTargetIndex]->QueryNativeInterface(IID_IUnknown, (void**) aTarget);
AccessibleWrap* target =
static_cast<AccessibleWrap*>(mTargets[aTargetIndex].get());
*aTarget = static_cast<IAccessible*>(target);
(*aTarget)->AddRef();
return S_OK;
A11Y_TRYBLOCK_END

View File

@@ -110,6 +110,20 @@
// aria-readonly
testStates("aria_readonly_textbox", STATE_READONLY);
// readonly/editable on grid and gridcell
testStates("aria_grid_default", 0, EXT_STATE_EDITABLE,
STATE_READONLY, 0);
testStates("aria_grid_default_cell_readonly", STATE_READONLY, 0,
0, EXT_STATE_EDITABLE);
testStates("aria_grid_default_cell_inherited", 0, EXT_STATE_EDITABLE,
STATE_READONLY, 0);
testStates("aria_grid_readonly", STATE_READONLY, 0,
0, EXT_STATE_EDITABLE);
testStates("aria_grid_readonly_cell_editable", 0, EXT_STATE_EDITABLE,
STATE_READONLY, 0);
testStates("aria_grid_readonly_cell_inherited", STATE_READONLY, 0,
0, EXT_STATE_EDITABLE);
// aria-selectable
testStates("aria_selectable_listitem", STATE_SELECTABLE | STATE_SELECTED);
@@ -230,6 +244,11 @@
title="fix default horizontal / vertical state of role=scrollbar and ensure only one of horizontal / vertical states is exposed">
Mozilla Bug 762876
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=835121
title="ARIA grid should be editable by default">
Mozilla Bug 835121
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@@ -265,7 +284,26 @@
<div id="aria_multiline_textbox" role="textbox" aria-multiline="true"></div>
<div id="aria_multiselectable_listbox" role="listbox" aria-multiselectable="true"></div>
<div id="aria_pressed_button" role="button" aria-pressed="true">Button</div>
<div id="aria_readonly_textbox" role="textbox" aria-readonly="true">This text should be readonly</div>
<div id="aria_readonly_textbox"
role="textbox" aria-readonly="true">This text should be readonly</div>
<div id="aria_grid_default" role="grid">
<div role="row">
<div id="aria_grid_default_cell_readonly"
role="gridcell" aria-readonly="true">gridcell1</div>
<div id="aria_grid_default_cell_inherited"
role="gridcell">gridcell2</div>
</div>
<div id="aria_grid_readonly" role="grid" aria-readonly="true">
<div role="row">
<div id="aria_grid_readonly_cell_editable"
role="gridcell" aria-readonly="false">gridcell1</div>
<div id="aria_grid_readonly_cell_inherited"
role="gridcell">gridcell2</div>
</div>
<div role="listbox">
<div id="aria_selectable_listitem" role="option" aria-selected="true">Item1</div>
</div>
@@ -313,7 +351,7 @@
<a id="aria_application_link" role="application" href="foo">app</a>
<a id="aria_main_link" role="main" href="foo">main</a>
<a id="aria_navigation_link" role="navigation" href="foo">nav</a>
<!-- landmarks: anchors -->
<a id="aria_application_anchor" role="application" name="app_anchor">app</a>
<a id="aria_main_anchor" role="main" name="main_anchor">main</a>

View File

@@ -129,7 +129,6 @@
#ifdef ACCESSIBILITY
#ifdef XP_WIN32
@BINPATH@/AccessibleMarshal.dll
@BINPATH@/components/accessibility-msaa.xpt
#endif
@BINPATH@/components/accessibility.xpt
#endif

View File

@@ -119,10 +119,6 @@ ifeq ($(OS_ARCH),WINNT) #{
#
ifndef GNU_CC #{
LDFLAGS += /HEAP:0x40000
ifeq ($(OS_TEST),x86_64) #{
# set stack to 2MB on x64 build. See bug 582910
LDFLAGS += -STACK:2097152
endif #}
endif #}
endif #}

View File

@@ -265,7 +265,6 @@
class="social-panel"
type="arrow"
hidden="true"
consumeoutsideclicks="false"
noautofocus="true"/>
<panel id="social-flyout-panel"
class="social-panel"

View File

@@ -139,7 +139,6 @@
#ifdef ACCESSIBILITY
#ifdef XP_WIN32
@BINPATH@/AccessibleMarshal.dll
@BINPATH@/components/accessibility-msaa.xpt
#endif
@BINPATH@/components/accessibility.xpt
#endif

View File

@@ -589,6 +589,13 @@ endif
endif
endif
ifdef _MSC_VER
ifeq ($(CPU_ARCH),x86_64)
# set stack to 2MB on x64 build. See bug 582910
WIN32_EXE_LDFLAGS += -STACK:2097152
endif
endif
# If we're building a component on MSVC, we don't want to generate an
# import lib, because that import lib will collide with the name of a
# static version of the same library.

View File

@@ -267,6 +267,14 @@ class SectionFinder(object):
syms.append((tmp[-1], tmp[0]))
return syms
def print_command(out, args):
print >>out, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>out, tmp + ":"
with open(tmp) as file:
print >>out, "".join([" " + l for l in file.readlines()])
out.flush()
def main():
parser = OptionParser()
parser.add_option("--depend", dest="depend", metavar="FILE",
@@ -302,15 +310,15 @@ def main():
args.makelist()
if options.verbose:
print >>sys.stderr, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>sys.stderr, tmp + ":"
with open(tmp) as file:
print >>sys.stderr, "".join([" " + l for l in file.readlines()])
sys.stderr.flush()
ret = subprocess.call(args)
if ret:
exit(ret)
print_command(sys.stderr, args)
proc = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
(stdout, stderr) = proc.communicate()
if proc.returncode and not options.verbose:
print_command(sys.stderr, args)
sys.stderr.write(stdout)
sys.stderr.flush()
if proc.returncode:
exit(proc.returncode)
if not options.depend:
return
ensureParentDir(options.depend)

View File

@@ -32,8 +32,3 @@ ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) # {
else # } {
$(RM) -f $(DIST)/sdk/lib/$(LIB_PREFIX)nspr4.$(LIB_SUFFIX) $(DIST)/sdk/lib/$(LIB_PREFIX)plc4.$(LIB_SUFFIX) $(DIST)/sdk/lib/$(LIB_PREFIX)plds4.$(LIB_SUFFIX)
endif # }
install::
$(MAKE) -C $(DEPTH)/nsprpub install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr
$(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4))
$(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties)

View File

@@ -1,10 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TIERS += nspr
ifndef MOZ_NATIVE_NSPR
tier_nspr_staticdirs += nsprpub
tier_nspr_dirs += config/nspr
endif

View File

@@ -18,7 +18,7 @@ interface nsINode;
* @version 1.0
*/
[scriptable, uuid(12cf5a4d-fffb-4f2f-9cec-c65195661d76)]
[scriptable, builtinclass, uuid(12cf5a4d-fffb-4f2f-9cec-c65195661d76)]
interface nsISelection : nsISupports
{
/**

View File

@@ -31,7 +31,7 @@ struct ScrollAxis;
native nsDirection(nsDirection);
native ScrollAxis(nsIPresShell::ScrollAxis);
[scriptable, uuid(2e44b10f-7d6d-4bf4-92e2-f9551d22f422)]
[scriptable, builtinclass, uuid(2e44b10f-7d6d-4bf4-92e2-f9551d22f422)]
interface nsISelectionPrivate : nsISelection
{
const short ENDOFPRECEDINGLINE=0;

View File

@@ -34,12 +34,11 @@
#include "nsICharsetConverterManager.h"
#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsIEnumerator.h"
#include "nsIParserService.h"
#include "nsIScriptContext.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptSecurityManager.h"
#include "nsISelection.h"
#include "mozilla/Selection.h"
#include "nsISelectionPrivate.h"
#include "nsITransferable.h" // for kUnicodeMime
#include "nsContentUtils.h"
@@ -1348,19 +1347,17 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
nsCOMPtr<nsIDOMRange> range;
nsCOMPtr<nsIDOMNode> commonParent;
int32_t count = 0;
nsresult rv = aSelection->GetRangeCount(&count);
NS_ENSURE_SUCCESS(rv, rv);
Selection* selection = static_cast<Selection*>(aSelection);
uint32_t rangeCount = selection->GetRangeCount();
// if selection is uninitialized return
if (!count)
if (!rangeCount)
return NS_ERROR_FAILURE;
// we'll just use the common parent of the first range. Implicit assumption
// here that multi-range selections are table cell selections, in which case
// the common parent is somewhere in the table and we don't really care where.
rv = aSelection->GetRangeAt(0, getter_AddRefs(range));
nsresult rv = aSelection->GetRangeAt(0, getter_AddRefs(range));
NS_ENSURE_SUCCESS(rv, rv);
if (!range)
return NS_ERROR_NULL_POINTER;
@@ -1412,25 +1409,10 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
//NS_ENSURE_SUCCESS(rv, rv);
NS_NewDomSelection(getter_AddRefs(mSelection));
NS_ENSURE_TRUE(mSelection, NS_ERROR_FAILURE);
nsCOMPtr<nsISelectionPrivate> privSelection( do_QueryInterface(aSelection) );
NS_ENSURE_TRUE(privSelection, NS_ERROR_FAILURE);
// get selection range enumerator
nsCOMPtr<nsIEnumerator> enumerator;
rv = privSelection->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);
// loop thru the ranges in the selection
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
while (static_cast<nsresult>(NS_ENUMERATOR_FALSE) == enumerator->IsDone())
{
rv = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(currentItem, NS_ERROR_FAILURE);
range = do_QueryInterface(currentItem);
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
range = selection->GetRangeAt(rangeIdx);
NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRange> myRange;
range->CloneRange(getter_AddRefs(myRange));
@@ -1442,8 +1424,6 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
rv = mSelection->AddRange(myRange);
NS_ENSURE_SUCCESS(rv, rv);
enumerator->Next();
}
return NS_OK;

View File

@@ -393,6 +393,7 @@ WebappsApplication.prototype = {
this.initHelper(aWindow, ["Webapps:OfflineCache",
"Webapps:CheckForUpdate:Return:OK",
"Webapps:CheckForUpdate:Return:KO",
"Webapps:Launch:Return:KO",
"Webapps:PackageEvent"]);
cpmm.sendAsyncMessage("Webapps:RegisterForMessages",

View File

@@ -39,7 +39,7 @@ function test() {
let sandbox = new Cu.Sandbox(workerWindow);
// inject some functions from the window into the sandbox.
// postMessage so the async code in the sandbox can report a result.
sandbox.importFunction(workerWindow.postMessage, "postMessage");
sandbox.importFunction(workerWindow.postMessage.bind(workerWindow), "postMessage");
sandbox.importFunction(workerWindow.XMLHttpRequest, "XMLHttpRequest");
Cu.evalInSandbox(sandboxCode, sandbox, "1.8");
}, true);

View File

@@ -72,7 +72,6 @@
#include "nsIEditActionListener.h" // for nsIEditActionListener
#include "nsIEditorObserver.h" // for nsIEditorObserver
#include "nsIEditorSpellCheck.h" // for nsIEditorSpellCheck
#include "nsIEnumerator.h" // for nsIEnumerator, etc
#include "nsIFrame.h" // for nsIFrame
#include "nsIInlineSpellChecker.h" // for nsIInlineSpellChecker, etc
#include "nsIMEStateManager.h" // for nsIMEStateManager
@@ -3892,21 +3891,13 @@ nsEditor::GetStartNodeAndOffset(nsISelection *aSelection,
*outStartNode = nullptr;
*outStartOffset = 0;
nsCOMPtr<nsISelectionPrivate>selPrivate(do_QueryInterface(aSelection));
nsCOMPtr<nsIEnumerator> enumerator;
nsresult result = selPrivate->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(result, result);
NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);
Selection* selection = static_cast<Selection*>(aSelection);
NS_ENSURE_TRUE(selection->GetRangeCount(), NS_ERROR_FAILURE);
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
result = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(result, result);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
nsRange* range = selection->GetRangeAt(0);
NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
result = range->GetStartContainer(outStartNode);
nsresult result = range->GetStartContainer(outStartNode);
NS_ENSURE_SUCCESS(result, result);
result = range->GetStartOffset(outStartOffset);
@@ -3928,18 +3919,11 @@ nsEditor::GetEndNodeAndOffset(nsISelection *aSelection,
*outEndNode = nullptr;
nsCOMPtr<nsISelectionPrivate>selPrivate(do_QueryInterface(aSelection));
nsCOMPtr<nsIEnumerator> enumerator;
nsresult result = selPrivate->GetEnumerator(getter_AddRefs(enumerator));
if (NS_FAILED(result) || !enumerator)
return NS_ERROR_FAILURE;
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
if (NS_FAILED(enumerator->CurrentItem(getter_AddRefs(currentItem))))
return NS_ERROR_FAILURE;
Selection* selection = static_cast<Selection*>(aSelection);
NS_ENSURE_TRUE(selection, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(selection->GetRangeCount(), NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
nsRange* range = selection->GetRangeAt(0);
NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
if (NS_FAILED(range->GetEndContainer(outEndNode)))

View File

@@ -38,7 +38,6 @@
#include "nsIDOMNode.h"
#include "nsIDOMRange.h"
#include "nsIDOMText.h"
#include "nsIEnumerator.h"
#include "nsIHTMLAbsPosEditor.h"
#include "nsIHTMLDocument.h"
#include "nsINode.h"
@@ -2306,22 +2305,13 @@ nsHTMLEditRules::WillDeleteSelection(Selection* aSelection,
// else blocks not same type, or not siblings. Delete everything except
// table elements.
nsCOMPtr<nsIEnumerator> enumerator;
res = aSelection->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_UNEXPECTED);
join = true;
for (enumerator->First(); NS_OK!=enumerator->IsDone(); enumerator->Next())
{
nsCOMPtr<nsISupports> currentItem;
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_UNEXPECTED);
uint32_t rangeCount = aSelection->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = aSelection->GetRangeAt(rangeIdx);
// build a list of nodes in the range
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
nsCOMArray<nsIDOMNode> arrayOfNodes;
nsTrivialFunctor functor;
nsDOMSubtreeIterator iter;
@@ -5776,25 +5766,15 @@ nsHTMLEditRules::GetListActionNodes(nsCOMArray<nsIDOMNode> &outArrayOfNodes,
nsCOMPtr<nsISelection>selection;
res = mHTMLEditor->GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
NS_ENSURE_TRUE(selPriv, NS_ERROR_FAILURE);
Selection* sel = static_cast<Selection*>(selection.get());
NS_ENSURE_TRUE(sel, NS_ERROR_FAILURE);
// added this in so that ui code can ask to change an entire list, even if selection
// is only in part of it. used by list item dialog.
if (aEntireList)
{
nsCOMPtr<nsIEnumerator> enumerator;
res = selPriv->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_UNEXPECTED);
for (enumerator->First(); NS_OK!=enumerator->IsDone(); enumerator->Next())
{
nsCOMPtr<nsISupports> currentItem;
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
uint32_t rangeCount = sel->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = sel->GetRangeAt(rangeIdx);
nsCOMPtr<nsIDOMNode> commonParent, parent, tmp;
range->GetCommonAncestorContainer(getter_AddRefs(commonParent));
if (commonParent)
@@ -7797,21 +7777,11 @@ nsHTMLEditRules::SelectionEndpointInNode(nsINode* aNode, bool* aResult)
nsCOMPtr<nsISelection>selection;
nsresult res = mHTMLEditor->GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsISelectionPrivate>selPriv(do_QueryInterface(selection));
nsCOMPtr<nsIEnumerator> enumerator;
res = selPriv->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_UNEXPECTED);
for (enumerator->First(); NS_OK!=enumerator->IsDone(); enumerator->Next())
{
nsCOMPtr<nsISupports> currentItem;
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
Selection* sel = static_cast<Selection*>(selection.get());
uint32_t rangeCount = sel->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = sel->GetRangeAt(rangeIdx);
nsCOMPtr<nsIDOMNode> startParent, endParent;
range->GetStartContainer(getter_AddRefs(startParent));
if (startParent)

View File

@@ -37,7 +37,6 @@
#include "nsCSSStyleSheet.h"
#include "nsIDOMStyleSheet.h"
#include "nsIEnumerator.h"
#include "nsIContent.h"
#include "nsIContentIterator.h"
#include "nsIDOMRange.h"
@@ -2388,7 +2387,7 @@ nsHTMLEditor::GetSelectedElement(const nsAString& aTagName, nsIDOMElement** aRet
nsresult res = GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
Selection* sel = static_cast<Selection*>(selection.get());
bool bNodeFound = false;
bool isCollapsed = selection->Collapsed();
@@ -2453,7 +2452,7 @@ nsHTMLEditor::GetSelectedElement(const nsAString& aTagName, nsIDOMElement** aRet
int32_t anchorOffset = -1;
if (anchorNode)
selection->GetAnchorOffset(&anchorOffset);
nsCOMPtr<nsIDOMNode> focusNode;
res = selection->GetFocusNode(getter_AddRefs(focusNode));
NS_ENSURE_SUCCESS(res, res);
@@ -2464,19 +2463,6 @@ nsHTMLEditor::GetSelectedElement(const nsAString& aTagName, nsIDOMElement** aRet
// Link node must be the same for both ends of selection
if (NS_SUCCEEDED(res) && anchorNode)
{
#ifdef DEBUG_cmanske
{
nsAutoString name;
anchorNode->GetNodeName(name);
printf("GetSelectedElement: Anchor node of selection: ");
wprintf(name.get());
printf(" Offset: %d\n", anchorOffset);
focusNode->GetNodeName(name);
printf("Focus node of selection: ");
wprintf(name.get());
printf(" Offset: %d\n", focusOffset);
}
#endif
nsCOMPtr<nsIDOMElement> parentLinkOfAnchor;
res = GetElementOrParentByTagName(NS_LITERAL_STRING("href"), anchorNode, getter_AddRefs(parentLinkOfAnchor));
// XXX: ERROR_HANDLING can parentLinkOfAnchor be null?
@@ -2493,7 +2479,7 @@ nsHTMLEditor::GetSelectedElement(const nsAString& aTagName, nsIDOMElement** aRet
if (NS_SUCCEEDED(res) && parentLinkOfFocus == parentLinkOfAnchor)
bNodeFound = true;
}
// We found a link node parent
if (bNodeFound) {
// GetElementOrParentByTagName addref'd this, so we don't need to do it here
@@ -2518,77 +2504,63 @@ nsHTMLEditor::GetSelectedElement(const nsAString& aTagName, nsIDOMElement** aRet
if (!isCollapsed) // Don't bother to examine selection if it is collapsed
{
nsCOMPtr<nsIEnumerator> enumerator;
res = selPriv->GetEnumerator(getter_AddRefs(enumerator));
if (NS_SUCCEEDED(res))
{
if(!enumerator)
return NS_ERROR_NULL_POINTER;
nsRefPtr<nsRange> currange = sel->GetRangeAt(0);
if (currange) {
nsCOMPtr<nsIContentIterator> iter =
do_CreateInstance("@mozilla.org/content/post-content-iterator;1", &res);
NS_ENSURE_SUCCESS(res, res);
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
if ((NS_SUCCEEDED(res)) && currentItem)
iter->Init(currange);
// loop through the content iterator for each content node
while (!iter->IsDone())
{
nsCOMPtr<nsIDOMRange> currange( do_QueryInterface(currentItem) );
nsCOMPtr<nsIContentIterator> iter =
do_CreateInstance("@mozilla.org/content/post-content-iterator;1", &res);
NS_ENSURE_SUCCESS(res, res);
iter->Init(currange);
// loop through the content iterator for each content node
while (!iter->IsDone())
// Query interface to cast nsIContent to nsIDOMNode
// then get tagType to compare to aTagName
// Clone node of each desired type and append it to the aDomFrag
selectedElement = do_QueryInterface(iter->GetCurrentNode());
if (selectedElement)
{
// Query interface to cast nsIContent to nsIDOMNode
// then get tagType to compare to aTagName
// Clone node of each desired type and append it to the aDomFrag
selectedElement = do_QueryInterface(iter->GetCurrentNode());
if (selectedElement)
// If we already found a node, then we have another element,
// thus there's not just one element selected
if (bNodeFound)
{
// If we already found a node, then we have another element,
// thus there's not just one element selected
if (bNodeFound)
{
bNodeFound = false;
break;
}
selectedElement->GetNodeName(domTagName);
ToLowerCase(domTagName);
if (anyTag)
{
// Get name of first selected element
selectedElement->GetTagName(TagName);
ToLowerCase(TagName);
anyTag = false;
}
// The "A" tag is a pain,
// used for both link(href is set) and "Named Anchor"
nsCOMPtr<nsIDOMNode> selectedNode = do_QueryInterface(selectedElement);
if ( (isLinkTag && nsHTMLEditUtils::IsLink(selectedNode)) ||
(isNamedAnchorTag && nsHTMLEditUtils::IsNamedAnchor(selectedNode)) )
{
bNodeFound = true;
} else if (TagName == domTagName) { // All other tag names are handled here
bNodeFound = true;
}
if (!bNodeFound)
{
// Check if node we have is really part of the selection???
break;
}
bNodeFound = false;
break;
}
selectedElement->GetNodeName(domTagName);
ToLowerCase(domTagName);
if (anyTag)
{
// Get name of first selected element
selectedElement->GetTagName(TagName);
ToLowerCase(TagName);
anyTag = false;
}
// The "A" tag is a pain,
// used for both link(href is set) and "Named Anchor"
nsCOMPtr<nsIDOMNode> selectedNode = do_QueryInterface(selectedElement);
if ( (isLinkTag && nsHTMLEditUtils::IsLink(selectedNode)) ||
(isNamedAnchorTag && nsHTMLEditUtils::IsNamedAnchor(selectedNode)) )
{
bNodeFound = true;
} else if (TagName == domTagName) { // All other tag names are handled here
bNodeFound = true;
}
if (!bNodeFound)
{
// Check if node we have is really part of the selection???
break;
}
iter->Next();
}
} else {
// Should never get here?
isCollapsed = true;
printf("isCollapsed was FALSE, but no elements found in selection\n");
iter->Next();
}
} else {
printf("Could not create enumerator for GetSelectionProperties\n");
// Should never get here?
isCollapsed = true;
NS_WARNING("isCollapsed was FALSE, but no elements found in selection\n");
}
}
}
@@ -4678,23 +4650,13 @@ nsHTMLEditor::SetCSSBackgroundColor(const nsAString& aColor)
NS_ENSURE_SUCCESS(res, res);
if (!cancel && !handled)
{
// get selection range enumerator
nsCOMPtr<nsIEnumerator> enumerator;
res = selection->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);
// loop thru the ranges in the selection
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
nsAutoString bgcolor; bgcolor.AssignLiteral("bgcolor");
nsCOMPtr<nsIDOMNode> cachedBlockParent = nullptr;
while (static_cast<nsresult>(NS_ENUMERATOR_FALSE) == enumerator->IsDone()) {
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
uint32_t rangeCount = selection->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsCOMPtr<nsIDOMNode> cachedBlockParent = nullptr;
nsRefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
// check for easy case: both range endpoints in same text node
nsCOMPtr<nsIDOMNode> startNode, endNode;
@@ -4854,7 +4816,6 @@ nsHTMLEditor::SetCSSBackgroundColor(const nsAString& aColor)
}
}
}
enumerator->Next();
}
}
if (!cancel)

View File

@@ -33,7 +33,6 @@
#include "nsIDOMRange.h"
#include "nsIEditor.h"
#include "nsIEditorIMESupport.h"
#include "nsIEnumerator.h"
#include "nsINameSpaceManager.h"
#include "nsINode.h"
#include "nsISelection.h"
@@ -144,22 +143,10 @@ nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty,
nsresult res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);
NS_ENSURE_SUCCESS(res, res);
if (!cancel && !handled) {
// get selection range enumerator
nsCOMPtr<nsIEnumerator> enumerator;
res = selection->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);
// loop thru the ranges in the selection
nsCOMPtr<nsISupports> currentItem;
for (enumerator->First();
static_cast<nsresult>(NS_ENUMERATOR_FALSE) == enumerator->IsDone();
enumerator->Next()) {
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRange> range(do_QueryInterface(currentItem));
uint32_t rangeCount = selection->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
// adjust range to include any ancestors whose children are entirely
// selected
@@ -1115,23 +1102,15 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
result = GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(result, result);
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
Selection* sel = static_cast<Selection*>(selection.get());
bool isCollapsed = selection->Collapsed();
nsCOMPtr<nsIDOMNode> collapsedNode;
nsCOMPtr<nsIEnumerator> enumerator;
result = selPriv->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(result, result);
NS_ENSURE_TRUE(enumerator, NS_ERROR_NULL_POINTER);
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
result = enumerator->CurrentItem(getter_AddRefs(currentItem));
nsRefPtr<nsRange> range = sel->GetRangeAt(0);
// XXX: should be a while loop, to get each separate range
// XXX: ERROR_HANDLING can currentItem be null?
if (NS_SUCCEEDED(result) && currentItem) {
if (range) {
bool firstNodeInRange = true; // for each range, set a flag
nsCOMPtr<nsIDOMRange> range(do_QueryInterface(currentItem));
if (isCollapsed) {
range->GetStartContainer(getter_AddRefs(collapsedNode));
@@ -1379,22 +1358,10 @@ nsresult nsHTMLEditor::RemoveInlinePropertyImpl(nsIAtom *aProperty, const nsAStr
NS_ENSURE_SUCCESS(res, res);
if (!cancel && !handled)
{
// get selection range enumerator
nsCOMPtr<nsIEnumerator> enumerator;
res = selection->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);
// loop thru the ranges in the selection
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
while (static_cast<nsresult>(NS_ENUMERATOR_FALSE) == enumerator->IsDone()) {
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
uint32_t rangeCount = selection->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
if (aProperty == nsEditProperty::name)
{
// promote range if it starts or end in a named anchor and we
@@ -1500,7 +1467,6 @@ nsresult nsHTMLEditor::RemoveInlinePropertyImpl(nsIAtom *aProperty, const nsAStr
}
arrayOfNodes.Clear();
}
enumerator->Next();
}
}
if (!cancel)
@@ -1566,24 +1532,13 @@ nsHTMLEditor::RelativeFontChange( int32_t aSizeChange)
nsAutoSelectionReset selectionResetter(selection, this);
nsAutoTxnsConserveSelection dontSpazMySelection(this);
// get selection range enumerator
nsCOMPtr<nsIEnumerator> enumerator;
nsresult res = selection->GetEnumerator(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(enumerator, NS_ERROR_FAILURE);
// loop thru the ranges in the selection
enumerator->First();
nsCOMPtr<nsISupports> currentItem;
while (static_cast<nsresult>(NS_ENUMERATOR_FALSE) == enumerator->IsDone()) {
res = enumerator->CurrentItem(getter_AddRefs(currentItem));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(currentItem, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMRange> range( do_QueryInterface(currentItem) );
uint32_t rangeCount = selection->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
// adjust range to include any ancestors who's children are entirely selected
res = PromoteInlineRange(range);
nsresult res = PromoteInlineRange(range);
NS_ENSURE_SUCCESS(res, res);
// check for easy case: both range endpoints in same text node
@@ -1665,10 +1620,9 @@ nsHTMLEditor::RelativeFontChange( int32_t aSizeChange)
NS_ENSURE_SUCCESS(res, res);
}
}
enumerator->Next();
}
return res;
return NS_OK;
}
nsresult

View File

@@ -76,10 +76,6 @@ include $(topsrcdir)/config/rules.mk
#
ifndef GNU_CC
LDFLAGS += /HEAP:0x40000
ifeq ($(OS_TEST),x86_64)
# set stack to 2MB on x64 build. See bug 582910
LDFLAGS += -STACK:2097152
endif
endif
# Get rid of console window

View File

@@ -77,10 +77,6 @@ ifeq ($(OS_ARCH),WINNT) #{
#
ifndef GNU_CC #{
LDFLAGS += /HEAP:0x40000
ifeq ($(OS_TEST),x86_64) #{
# set stack to 2MB on x64 build. See bug 582910
LDFLAGS += -STACK:2097152
endif #}
endif #}
endif #}

View File

@@ -589,6 +589,13 @@ endif
endif
endif
ifdef _MSC_VER
ifeq ($(CPU_ARCH),x86_64)
# set stack to 2MB on x64 build. See bug 582910
WIN32_EXE_LDFLAGS += -STACK:2097152
endif
endif
# If we're building a component on MSVC, we don't want to generate an
# import lib, because that import lib will collide with the name of a
# static version of the same library.

View File

@@ -267,6 +267,14 @@ class SectionFinder(object):
syms.append((tmp[-1], tmp[0]))
return syms
def print_command(out, args):
print >>out, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>out, tmp + ":"
with open(tmp) as file:
print >>out, "".join([" " + l for l in file.readlines()])
out.flush()
def main():
parser = OptionParser()
parser.add_option("--depend", dest="depend", metavar="FILE",
@@ -302,15 +310,15 @@ def main():
args.makelist()
if options.verbose:
print >>sys.stderr, "Executing: " + " ".join(args)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>sys.stderr, tmp + ":"
with open(tmp) as file:
print >>sys.stderr, "".join([" " + l for l in file.readlines()])
sys.stderr.flush()
ret = subprocess.call(args)
if ret:
exit(ret)
print_command(sys.stderr, args)
proc = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
(stdout, stderr) = proc.communicate()
if proc.returncode and not options.verbose:
print_command(sys.stderr, args)
sys.stderr.write(stdout)
sys.stderr.flush()
if proc.returncode:
exit(proc.returncode)
if not options.depend:
return
ensureParentDir(options.depend)

View File

@@ -73,40 +73,84 @@ template void MacroAssembler::guardTypeSet(const ValueOperand &value, const type
void
MacroAssembler::PushRegsInMask(RegisterSet set)
{
size_t diff = set.gprs().size() * STACK_SLOT_SIZE +
set.fpus().size() * sizeof(double);
int32_t diffF = set.fpus().size() * sizeof(double);
int32_t diffG = set.gprs().size() * STACK_SLOT_SIZE;
reserveStack(diff);
for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
diff -= STACK_SLOT_SIZE;
storePtr(*iter, Address(StackPointer, diff));
reserveStack(diffG);
#ifdef JS_CPU_ARM
if (set.gprs().size() > 1) {
startDataTransferM(IsStore, StackPointer, IA, NoWriteBack);
for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
diffG -= STACK_SLOT_SIZE;
transferReg(*iter);
}
finishDataTransfer();
} else
#endif
{
for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
diffG -= STACK_SLOT_SIZE;
storePtr(*iter, Address(StackPointer, diffG));
}
}
JS_ASSERT(diffG == 0);
reserveStack(diffF);
#ifdef JS_CPU_ARM
diffF -= transferMultipleByRuns(set.fpus(), IsStore, StackPointer, IA);
#else
for (FloatRegisterIterator iter(set.fpus()); iter.more(); iter++) {
diff -= sizeof(double);
storeDouble(*iter, Address(StackPointer, diff));
diffF -= sizeof(double);
storeDouble(*iter, Address(StackPointer, diffF));
}
#endif
JS_ASSERT(diffF == 0);
}
void
MacroAssembler::PopRegsInMaskIgnore(RegisterSet set, RegisterSet ignore)
{
size_t diff = set.gprs().size() * STACK_SLOT_SIZE +
set.fpus().size() * sizeof(double);
size_t reserved = diff;
int32_t diffG = set.gprs().size() * STACK_SLOT_SIZE;
int32_t diffF = set.fpus().size() * sizeof(double);
const int32_t reservedG = diffG;
const int32_t reservedF = diffF;
for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
diff -= STACK_SLOT_SIZE;
if (!ignore.has(*iter))
loadPtr(Address(StackPointer, diff), *iter);
}
for (FloatRegisterIterator iter(set.fpus()); iter.more(); iter++) {
diff -= sizeof(double);
if (!ignore.has(*iter))
loadDouble(Address(StackPointer, diff), *iter);
#ifdef JS_CPU_ARM
// ARM can load multiple registers at once, but only if we want back all
// the registers we previously saved to the stack.
if (ignore.empty(true)) {
diffF -= transferMultipleByRuns(set.fpus(), IsLoad, StackPointer, IA);
} else
#endif
{
for (FloatRegisterIterator iter(set.fpus()); iter.more(); iter++) {
diffF -= sizeof(double);
if (!ignore.has(*iter))
loadDouble(Address(StackPointer, diffF), *iter);
}
}
freeStack(reservedF);
JS_ASSERT(diffF == 0);
freeStack(reserved);
#ifdef JS_CPU_ARM
if (set.gprs().size() > 1 && ignore.empty(false)) {
startDataTransferM(IsLoad, StackPointer, IA, NoWriteBack);
for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
diffG -= STACK_SLOT_SIZE;
transferReg(*iter);
}
finishDataTransfer();
} else
#endif
{
for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
diffG -= STACK_SLOT_SIZE;
if (!ignore.has(*iter))
loadPtr(Address(StackPointer, diffG), *iter);
}
}
freeStack(reservedG);
JS_ASSERT(diffG == 0);
}
template<typename T>

View File

@@ -318,6 +318,11 @@ class TypedRegisterSet
bool has(T reg) const {
return !!(bits_ & (1 << reg.code()));
}
bool hasNextRegister(T reg) const {
if (reg.code() == sizeof(bits_)*8)
return false;
return !!(bits_ & (1 << (reg.code()+1)));
}
void addUnchecked(T reg) {
bits_ |= (1 << reg.code());
}
@@ -344,12 +349,23 @@ class TypedRegisterSet
JS_FLOOR_LOG2(ireg, bits_);
return T::FromCode(ireg);
}
T getFirst() const {
JS_ASSERT(!empty());
int ireg = js_bitscan_ctz32(bits_);
return T::FromCode(ireg);
}
T takeAny() {
JS_ASSERT(!empty());
T reg = getAny();
take(reg);
return reg;
}
T takeFirst() {
JS_ASSERT(!empty());
T reg = getFirst();
take(reg);
return reg;
}
void clear() {
bits_ = 0;
}
@@ -533,6 +549,7 @@ class RegisterSet {
}
};
// iterates backwards, that is, rn to r0
template <typename T>
class TypedRegisterIterator
{
@@ -552,13 +569,48 @@ class TypedRegisterIterator
regset_.takeAny();
return old;
}
TypedRegisterIterator<T>& operator ++() {
regset_.takeAny();
return *this;
}
T operator *() const {
return regset_.getAny();
}
};
// iterates forwards, that is r0 to rn
template <typename T>
class TypedRegisterForwardIterator
{
TypedRegisterSet<T> regset_;
public:
TypedRegisterForwardIterator(TypedRegisterSet<T> regset) : regset_(regset)
{ }
TypedRegisterForwardIterator(const TypedRegisterForwardIterator &other) : regset_(other.regset_)
{ }
bool more() const {
return !regset_.empty();
}
TypedRegisterForwardIterator<T> operator ++(int) {
TypedRegisterIterator<T> old(*this);
regset_.takeFirst();
return old;
}
TypedRegisterForwardIterator<T>& operator ++() {
regset_.takeFirst();
return *this;
}
T operator *() const {
return regset_.getFirst();
}
};
typedef TypedRegisterIterator<Register> GeneralRegisterIterator;
typedef TypedRegisterIterator<FloatRegister> FloatRegisterIterator;
typedef TypedRegisterForwardIterator<Register> GeneralRegisterForwardIterator;
typedef TypedRegisterForwardIterator<FloatRegister> FloatRegisterForwardIterator;
class AnyRegisterIterator
{

View File

@@ -1383,6 +1383,37 @@ MacroAssemblerARM::ma_vstr(VFPRegister src, Register base, Register index, int32
ma_vstr(src, Operand(ScratchRegister, 0), cc);
}
int32_t
MacroAssemblerARM::transferMultipleByRuns(FloatRegisterSet set, LoadStore ls,
Register rm, DTMMode mode)
{
int32_t delta;
if (mode == IA) {
delta = sizeof(double);
} else if (mode == DB) {
delta = -sizeof(double);
} else {
JS_NOT_REACHED("Invalid data transfer addressing mode");
}
int32_t offset = 0;
FloatRegisterForwardIterator iter(set);
while (iter.more()) {
startFloatTransferM(ls, rm, mode, WriteBack);
int32_t reg = (*iter).code_;
do {
offset += delta;
transferFloatReg(*iter);
} while ((++iter).more() && (*iter).code_ == ++reg);
finishFloatTransfer();
}
JS_ASSERT(offset == set.size() * sizeof(double) * (mode == DB ? -1 : 1));
ma_sub(Imm32(offset), rm);
return offset;
}
bool
MacroAssemblerARMCompat::buildFakeExitFrame(const Register &scratch, uint32_t *offset)
{

View File

@@ -330,6 +330,14 @@ class MacroAssemblerARM : public Assembler
void ma_callIonHalfPush(const Register reg);
void ma_call(void *dest);
// Float registers can only be loaded/stored in continuous runs
// when using vstm/vldm.
// This function breaks set into continuous runs and loads/stores
// them at [rm]. rm will be modified, but returned to its initial value.
// Returns the offset from [dm] for the logical next load/store.
int32_t transferMultipleByRuns(FloatRegisterSet set, LoadStore ls,
Register rm, DTMMode mode);
};
class MacroAssemblerARMCompat : public MacroAssemblerARM

View File

@@ -52,13 +52,6 @@ LIBS += $(NSPR_LIBS)
NSDISTMODE = copy
ifdef _MSC_VER
ifeq ($(OS_TEST),x86_64)
# set stack to 2MB on x64 build. See bug 582910
WIN32_EXE_LDFLAGS += -STACK:2097152
endif
endif
ifeq ($(OS_TEST),ia64)
LIBS += $(JEMALLOC_LIBS)
endif

View File

@@ -5305,10 +5305,10 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
// Don't create frames for non-SVG element children of SVG elements.
if (aNameSpaceID != kNameSpaceID_SVG &&
aParentFrame &&
IsFrameForSVG(aParentFrame) &&
!aParentFrame->IsFrameOfType(nsIFrame::eSVGForeignObject)
) {
((aParentFrame &&
IsFrameForSVG(aParentFrame) &&
!aParentFrame->IsFrameOfType(nsIFrame::eSVGForeignObject)) ||
(aFlags & ITEM_IS_WITHIN_SVG_TEXT))) {
SetAsUndisplayedContent(aItems, element, styleContext,
isGeneratedContent);
return;

View File

@@ -1605,11 +1605,14 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
drawBackgroundImage, drawBackgroundColor);
}
// Even if we don't actually have a background color to paint, we still need
// to create the item because it's used for hit testing.
aList->AppendNewToTop(
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bg,
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0)));
// Even if we don't actually have a background color to paint, we may still need
// to create an item for hit testing.
if ((drawBackgroundColor && color != NS_RGBA(0,0,0,0)) ||
aBuilder->IsForEventDelivery()) {
aList->AppendNewToTop(
new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bg,
drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0)));
}
if (isThemed) {
nsDisplayBackgroundImage* bgItem =

View File

@@ -124,7 +124,7 @@ fuzzy-if(!contentSameGfxBackendAsCanvas,2,20000) fails-if(Android) == aja-linear
fuzzy-if(!contentSameGfxBackendAsCanvas,2,16477) fails-if(Android) == aja-linear-6a.html aja-linear-6-ref.html # bug 526708
fails == aja-linear-6b.html aja-linear-6-ref.html # bug 522607
skip-if(B2G) == height-dependence-1.html height-dependence-1-ref.html
skip-if(B2G) == height-dependence-2.html height-dependence-2-ref.html
skip-if(B2G) fuzzy-if(cocoaWidget,1,40000) == height-dependence-2.html height-dependence-2-ref.html
skip-if(B2G) == height-dependence-3.html height-dependence-3-ref.html
fails-if(d2d) == linear-onestopposition-1.html linear-onestopposition-1-ref.html # bug 638664

View File

@@ -0,0 +1,9 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200" viewBox="0 0 700 200"
style="font: 16px sans-serif">
<text x="100" y="100">hello</text>
<text x="100" y="200"><textPath display="none">f</textPath></text>
</svg>

After

Width:  |  Height:  |  Size: 354 B

View File

@@ -0,0 +1,12 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200">
<text x="100" y="100" style="font: 16px sans-serif">
<tspan>
ab
ef
</tspan>
</text>
</svg>

After

Width:  |  Height:  |  Size: 299 B

View File

@@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200">
<text x="100" y="100" style="font: 16px sans-serif">
<tspan>
ab
<progress xmlns="http://www.w3.org/1999/xhtml">cd</progress>
ef
</tspan>
</text>
</svg>

After

Width:  |  Height:  |  Size: 366 B

View File

@@ -0,0 +1,7 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200">
<text x="100" y="100" style="font: 16px sans-serif">&#x0301;t</text>
</svg>

After

Width:  |  Height:  |  Size: 262 B

View File

@@ -0,0 +1,10 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="200">
<style>
text::first-letter { font-size: 32px }
</style>
<text x="100" y="100" style="font: 16px sans-serif">&#x0301;t</text>
</svg>

After

Width:  |  Height:  |  Size: 326 B

View File

@@ -99,6 +99,7 @@ HTTP(../..) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
== display-none-1.svg simple.svg
== display-none-2.svg simple.svg
== display-none-3.svg simple.svg
== display-none-4.svg simple.svg
== simple-multiline.svg simple-multiline-ref.svg
== simple-multiline-number.svg simple-multiline-number-ref.svg
@@ -133,10 +134,12 @@ HTTP(../..) == simple-transform-rotate.svg simple-transform-rotate-ref.svg
== pseudo-first-line.svg pseudo-first-line-ref.svg
== pseudo-first-line-2.svg pseudo-first-line-2-ref.svg
== pseudo-first-letter.svg pseudo-first-letter-ref.svg
== pseudo-first-letter-2.svg pseudo-first-letter-2-ref.svg
== ignore-before-after.svg ignore-prop-ref.svg
# invalid child nodes
== ignore-invalid-child.svg ignore-invalid-child-ref.svg
== ignore-invalid-child-2.svg ignore-invalid-child-2-ref.svg
# text inside a link
== link-surrounding.svg simple.svg

View File

@@ -273,11 +273,7 @@ IsNonEmptyTextFrame(nsIFrame* aFrame)
return false;
}
nsIContent* content = textFrame->GetContent();
NS_ASSERTION(content && content->IsNodeOfType(nsINode::eTEXT),
"unexpected content type for nsTextFrame");
return static_cast<nsTextNode*>(content)->TextLength() != 0;
return textFrame->GetContentLength() != 0;
}
/**
@@ -1440,6 +1436,9 @@ TextNodeCorrespondenceRecorder::TraverseAndRecord(nsIFrame* aFrame)
* * what nsInlineFrame corresponding to a <textPath> element it is a
* descendant of
* * what computed dominant-baseline value applies to it
*
* Note that any text frames that are empty -- whose ContentLength() is 0 --
* will be skipped over.
*/
class TextFrameIterator
{
@@ -4424,9 +4423,9 @@ nsSVGTextFrame2::DoGlyphPositioning()
// Get the x, y, dx, dy, rotate values for the subtree.
nsTArray<gfxPoint> deltas;
if (!ResolvePositions(deltas)) {
// We shouldn't reach here because DetermineCharPositions should have been
// empty if we fail to resolve any positions.
NS_NOTREACHED("unexpected result from ResolvePositions");
// If ResolvePositions returned false, it means that there were some
// characters in the DOM but none of them are displayed. Clear out
// mPositions so that we don't attempt to do any painting later.
mPositions.Clear();
return;
}

View File

@@ -128,7 +128,6 @@
#ifdef ACCESSIBILITY
#ifdef XP_WIN32
@BINPATH@/AccessibleMarshal.dll
@BINPATH@/components/accessibility-msaa.xpt
#endif
@BINPATH@/components/accessibility.xpt
#endif

View File

@@ -43,12 +43,6 @@ EXPORTS = \
include $(topsrcdir)/config/rules.mk
ifdef CROSS_COMPILE
ifdef HOST_NSPR_MDCPUCFG
HOST_CFLAGS += -DMDCPUCFG=$(HOST_NSPR_MDCPUCFG)
endif
endif
# The intermediate (.ii/.s) files for host and target can have the same name...
# disable parallel builds
.NOTPARALLEL:

View File

@@ -39,12 +39,6 @@ EXPORTS = \
include $(topsrcdir)/config/rules.mk
ifdef CROSS_COMPILE
ifdef HOST_NSPR_MDCPUCFG
HOST_CFLAGS += -DMDCPUCFG=$(HOST_NSPR_MDCPUCFG)
endif
endif
# The intermediate (.ii/.s) files for host and target can have the same name...
# disable parallel builds
.NOTPARALLEL:

View File

@@ -710,7 +710,7 @@ pref("dom.min_background_timeout_value", 1000);
pref("dom.experimental_bindings", true);
// Run content XBL in a separate scope.
pref("dom.xbl_scopes", false);
pref("dom.xbl_scopes", true);
// Don't use new input types
pref("dom.experimental_forms", false);

View File

@@ -298,12 +298,11 @@ function resetValues() {
* Returns a content sandbox that can be used by the execute_foo functions.
*/
function createExecuteContentSandbox(aWindow, timeout) {
let sandbox = new Cu.Sandbox(aWindow);
let sandbox = new Cu.Sandbox(aWindow, {sandboxPrototype: aWindow});
sandbox.global = sandbox;
sandbox.window = aWindow;
sandbox.document = sandbox.window.document;
sandbox.navigator = sandbox.window.navigator;
sandbox.__proto__ = sandbox.window;
sandbox.testUtils = utils;
let marionette = new Marionette(this, aWindow, "content",

View File

@@ -130,12 +130,18 @@ FrameWorker.prototype = {
'setInterval', 'setTimeout', 'XMLHttpRequest',
'MozBlobBuilder', 'FileReader', 'Blob',
'location'];
// Bug 798660 - XHR and WebSocket have issues in a sandbox and need
// to be unwrapped to work
let needsWaive = ['XMLHttpRequest', 'WebSocket'];
// Methods need to be bound with the proper |this|.
let needsBind = ['atob', 'btoa', 'dump', 'setInterval', 'clearInterval',
'setTimeout', 'clearTimeout'];
workerAPI.forEach(function(fn) {
try {
// Bug 798660 - XHR and WebSocket have issues in a sandbox and need
// to be unwrapped to work
if (fn == "XMLHttpRequest" || fn == "WebSocket")
if (needsWaive.indexOf(fn) != -1)
sandbox[fn] = XPCNativeWrapper.unwrap(workerWindow)[fn];
else if (needsBind.indexOf(fn) != -1)
sandbox[fn] = workerWindow[fn].bind(workerWindow);
else
sandbox[fn] = workerWindow[fn];
}

View File

@@ -108,7 +108,7 @@ this.validateCert =
}
if (error) {
errors.forEach(Cu.reportError);
errors.forEach(Cu.reportError.bind(Cu));
const certCheckErr = "Certificate checks failed. See previous errors " +
"for details.";
Cu.reportError(certCheckErr);

View File

@@ -6,7 +6,13 @@ ifdef LIBXUL_SDK
$(error toolkit-tiers.mk is not compatible with --enable-libxul-sdk=)
endif
include $(topsrcdir)/config/nspr/build.mk
TIERS += nspr
ifndef MOZ_NATIVE_NSPR
tier_nspr_staticdirs += nsprpub
tier_nspr_dirs += config/nspr
endif
include $(topsrcdir)/config/js/build.mk
TIERS += platform

View File

@@ -2,8 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(topsrcdir)/config/nspr/build.mk
TIERS += app
tier_app_dirs += \

View File

@@ -113,8 +113,4 @@ webapprt.$(OBJ_SUFFIX): $(DEPTH)/config/buildid
#
ifndef GNU_CC
LDFLAGS += /HEAP:0x40000
ifeq ($(OS_TEST),x86_64)
# set stack to 2MB on x64 build. See bug 582910
LDFLAGS += -STACK:2097152
endif
endif

View File

@@ -105,10 +105,6 @@ ifeq ($(OS_ARCH),WINNT)
#
ifndef GNU_CC
LDFLAGS += /HEAP:0x40000
ifeq ($(OS_TEST),x86_64)
# set stack to 2MB on x64 build. See bug 582910
LDFLAGS += -STACK:2097152
endif
endif
endif