Merge last green changeset from inbound to mozilla-central

This commit is contained in:
Matt Brubeck 2012-03-26 11:18:15 -07:00
Родитель b911986f79 82545744b8
Коммит e3b2ee78ae
85 изменённых файлов: 979 добавлений и 871 удалений

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

@ -1352,17 +1352,13 @@ nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
nsresult
nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
{
// If the accessible isn't primary for its node (such as list item bullet or
// xul tree item then don't calculate content based attributes.
if (!IsPrimaryForNode())
return NS_OK;
// Attributes set by this method will not be used to override attributes on a sub-document accessible
// when there is a <frame>/<iframe> element that spawned the sub-document
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mContent));
nsAutoString tagName;
element->GetTagName(tagName);
if (!tagName.IsEmpty()) {
nsAutoString oldValueUnused;
aAttributes->SetStringProperty(NS_LITERAL_CSTRING("tag"), tagName,
oldValueUnused);
}
nsEventShell::GetEventAttributes(GetNode(), aAttributes);
@ -1378,12 +1374,13 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
// The inner nodes can be used to override live region behavior on more general outer nodes
// However, nodes in outer documents override nodes in inner documents:
// Outer doc author may want to override properties on a widget they used in an iframe
nsIContent *startContent = mContent;
while (true) {
NS_ENSURE_STATE(startContent);
nsIDocument *doc = startContent->GetDocument();
nsIContent* startContent = mContent;
while (startContent) {
nsIDocument* doc = startContent->GetDocument();
nsIContent* rootContent = nsCoreUtils::GetRoleContent(doc);
NS_ENSURE_STATE(rootContent);
if (!rootContent)
return NS_OK;
nsAccUtils::SetLiveContainerAttributes(aAttributes, startContent,
rootContent);
@ -1409,6 +1406,11 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
if (!mContent->IsElement())
return NS_OK;
// Expose tag.
nsAutoString tagName;
mContent->NodeInfo()->GetName(tagName);
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tag, tagName);
// Expose draggable object attribute?
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(mContent);
if (htmlElement) {
@ -1421,9 +1423,8 @@ nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes)
}
// Don't calculate CSS-based object attributes when no frame (i.e.
// the accessible is not unattached form three) or when the accessible is not
// primary for node (like list bullet or XUL tree items).
if (!mContent->GetPrimaryFrame() || !IsPrimaryForNode())
// the accessible is unattached from the tree).
if (!mContent->GetPrimaryFrame())
return NS_OK;
// CSS style based object attributes.

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

@ -229,10 +229,10 @@ nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIFrame *rootFrame = presShell->GetRootFrame();
NS_ENSURE_TRUE(rootFrame, nsnull);
nsIntRect rootRect = rootFrame->GetScreenRectExternal();
nsIntRect rootRect = rootFrame->GetScreenRect();
PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX - rootRect.x);
PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY - rootRect.y);
PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.x;
PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.y;
PRInt32 row = -1;
nsCOMPtr<nsITreeColumn> column;

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

@ -706,10 +706,10 @@ nsXULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIFrame *rootFrame = presShell->GetRootFrame();
NS_ENSURE_TRUE(rootFrame, nsnull);
nsIntRect rootRect = rootFrame->GetScreenRectExternal();
nsIntRect rootRect = rootFrame->GetScreenRect();
PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX - rootRect.x);
PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY - rootRect.y);
PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.x;
PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.y;
PRInt32 row = -1;
nsCOMPtr<nsITreeColumn> column;

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

@ -105,6 +105,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
}
testAttrs(getApplicationAccessible(), attrs, false);
}
// no object attributes
testAbsentAttrs(getAccessible("listitem").firstChild, { "tag": "" });
SimpleTest.finish();
}
@ -193,5 +197,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
<th id="th2" abbr="SS#" axis="social">Social Security Number</th>
</tr>
</table>
<ul>
<li id="listitem">item
</ul>
</body>
</html>

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

@ -1,9 +1,4 @@
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=439566
https://bugzilla.mozilla.org/show_bug.cgi?id=460932
https://bugzilla.mozilla.org/show_bug.cgi?id=689540
-->
<head>
<title>CSS-like attributes tests</title>
<link rel="stylesheet" type="text/css"
@ -16,8 +11,37 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=689540
src="../common.js"></script>
<script type="application/javascript"
src="../attributes.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
var gQueue = null;
function removeElm(aID)
{
this.node = getNode(aID);
this.accessible = getAccessible(aID);
this.eventSeq = [
new invokerChecker(EVENT_HIDE, this.accessible)
];
this.invoke = function removeElm_invoke()
{
this.node.parentNode.removeChild(this.node);
}
this.check = function removeElm_check()
{
testAbsentCSSAttrs(this.accessible);
}
this.getID = function removeElm_getID()
{
return "test CSS-based attributes on removed accessible";
}
}
function doTest()
{
// CSS display
@ -85,7 +109,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=689540
// no CSS-based object attributes
testAbsentCSSAttrs(getAccessible("listitem").firstChild);
SimpleTest.finish();
gQueue = new eventQueue();
gQueue.push(new removeElm("div"));
gQueue.invoke(); // SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();

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

@ -98,21 +98,6 @@ function reloadButton()
return browserWindow().document.getElementById("urlbar-reload-button");
}
/**
* Zoom the given document.
*/
function zoomDocument(aDocument, aZoom)
{
var docShell = aDocument.defaultView.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIWebNavigation).
QueryInterface(Components.interfaces.nsIDocShell);
var docViewer = docShell.contentViewer.
QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
docViewer.fullZoom = aZoom;
}
////////////////////////////////////////////////////////////////////////////////
// private section

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

@ -115,6 +115,21 @@ function addA11yLoadEvent(aFunc, aWindow)
SimpleTest.waitForFocus(waitForDocLoad, aWindow);
}
/**
* Analogy of SimpleTest.is function used to compare objects.
*/
function isObject(aObj, aExpectedObj, aMsg)
{
if (aObj == aExpectedObj) {
ok(true, aMsg);
return;
}
ok(false,
aMsg + " - got '" + prettyName(aObj) +
"', expected '" + prettyName(aExpectedObj) + "'");
}
////////////////////////////////////////////////////////////////////////////////
// Helpers for getting DOM node/accessible

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

@ -34,12 +34,12 @@
testAttrs("main", {"xml-roles" : "main"}, true); // ARIA override
// And some AT may look for this
testAttrs("nav", {"tag" : "NAV"}, true);
testAttrs("header", {"tag" : "HEADER"}, true);
testAttrs("footer", {"tag" : "FOOTER"}, true);
testAttrs("article", {"tag" : "ARTICLE"}, true);
testAttrs("aside", {"tag" : "ASIDE"}, true);
testAttrs("main", {"tag" : "ARTICLE"}, true); // no override expected
testAttrs("nav", {"tag" : "nav"}, true);
testAttrs("header", {"tag" : "header"}, true);
testAttrs("footer", {"tag" : "footer"}, true);
testAttrs("article", {"tag" : "article"}, true);
testAttrs("aside", {"tag" : "aside"}, true);
testAttrs("main", {"tag" : "article"}, true); // no override expected
SimpleTest.finish();
}

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

@ -48,8 +48,9 @@ include $(topsrcdir)/config/rules.mk
_TEST_FILES = \
test_browser.html \
test_general.html \
test_general.xul \
test_zoom_tree.xul \
test_zoom.html \
zoom_tree.xul \
$(NULL)
libs:: $(_TEST_FILES)

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

@ -19,33 +19,27 @@
var list = getAccessible("list");
var listitem = getAccessible("listitem");
var image = getAccessible("image");
testChildAtPoint(list, 1, 1, false, listitem);
testChildAtPoint(list, 1, 1, true, image.firstChild);
testChildAtPoint(list, 1, 1, listitem, image.firstChild);
// ::MustPrune case (in this case childAtPoint doesn't look inside a
// textbox), point is inside of textbox.
var txt = getAccessible("txt");
testChildAtPoint(txt, 1, 1, false, txt);
testChildAtPoint(txt, 1, 1, true, txt);
testChildAtPoint(txt, 1, 1, txt, txt);
// ::MustPrune case, point is outside of textbox accessible but is in
// document.
testChildAtPoint(txt, -1, 1, false, null);
testChildAtPoint(txt, -1, 1, true, null);
testChildAtPoint(txt, -1, 1, null, null);
// ::MustPrune case, point is outside of root accessible.
testChildAtPoint(txt, -10000, 10000, false, null);
testChildAtPoint(txt, -10000, 10000, true, null);
testChildAtPoint(txt, -10000, 10000, null, null);
// Not specific case, point is inside of btn accessible.
var btn = getAccessible("btn");
var btnText = btn.firstChild;
testChildAtPoint(btn, 1, 1, false, btnText);
testChildAtPoint(btn, 1, 1, true, btnText);
testChildAtPoint(btn, 1, 1, btnText, btnText);
// Not specific case, point is outside of btn accessible.
testChildAtPoint(btn, -1, 1, false, null);
testChildAtPoint(btn, -1, 1, true, null);
testChildAtPoint(btn, -1, 1, null, null);
// Out of flow accessible testing, do not return out of flow accessible
// because it's not a child of the accessible even visually it is.
@ -54,8 +48,7 @@
outOfFlow.style.left = rectArea.left + "px";
outOfFlow.style.top = rectArea.top + "px";
testChildAtPoint("area", 1, 1, false, "area");
testChildAtPoint("area", 1, 1, true, "area");
testChildAtPoint("area", 1, 1, "area", "area");
SimpleTest.finish();
}

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

@ -1,60 +0,0 @@
<?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="nsIAccessible::getChildAtPoint and getDeepestChildAtPoint">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="../treeview.js" />
<script type="application/javascript"
src="../common.js" />
<script type="application/javascript"
src="../events.js" />
<script type="application/javascript"
src="../layout.js" />
<script type="application/javascript">
<![CDATA[
function doTest()
{
hitTest("tree", "treecols", "col1");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yXULTreeLoadEvent(doTest, "tree", new nsTableTreeView(5));
]]>
</script>
<hbox 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=471493"
title=" crash [@ nsPropertyTable::GetPropertyInternal]">
Mozilla Bug 471493
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<tree id="tree" flex="1">
<treecols id="treecols">
<treecol id="col1" flex="1" primary="true" label="column"/>
<treecol id="col2" flex="1" label="column 2"/>
</treecols>
<treechildren id="treechildren"/>
</tree>
</hbox>
</window>

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

@ -0,0 +1,101 @@
<?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="nsIAccessible::getChildAtPoint and getDeepestChildAtPoint">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="../treeview.js" />
<script type="application/javascript"
src="../common.js" />
<script type="application/javascript"
src="../events.js" />
<script type="application/javascript"
src="../layout.js" />
<script type="application/javascript"
src="../browser.js" />
<script type="application/javascript">
<![CDATA[
function doTest()
{
var tabDocument = currentTabDocument();
var tabWindow = currentTabWindow();
var tree = tabDocument.getElementById("tree");
var treecols = tabDocument.getElementById("treecols");
var treecol1 = tabDocument.getElementById("treecol1");
// tree columns
hitTest(tree, treecols, treecol1);
// tree rows and cells
var treeBoxObject = tree.treeBoxObject;
var treeBodyBoxObj = tree.treeBoxObject.treeBody.boxObject;
var xObj = {}, yObj = {}, widthObj = {}, heightObj = {};
treeBoxObject.getCoordsForCellItem(1, tree.columns[0], "cell",
xObj, yObj, widthObj, heightObj);
var treeAcc = getAccessible(tree, [nsIAccessibleTable]);
var cellAcc = treeAcc.getCellAt(1, 0);
var rowAcc = cellAcc.parent;
var cssX = xObj.value + treeBodyBoxObj.x;
var cssY = yObj.value + treeBodyBoxObj.y;
var [x, y] = CSSToDevicePixels(tabWindow, cssX, cssY);
testChildAtPoint(treeAcc, x, y, rowAcc, cellAcc);
testChildAtPoint(rowAcc, x, y, cellAcc, cellAcc);
// do zoom
zoomDocument(tabDocument, 1.5);
// tree columns
hitTest(tree, treecols, treecol1);
// tree rows and cells
var [x, y] = CSSToDevicePixels(tabWindow, cssX, cssY);
testChildAtPoint(treeAcc, x, y, rowAcc, cellAcc);
testChildAtPoint(rowAcc, x, y, cellAcc, cellAcc);
closeBrowserWindow();
SimpleTest.finish();
}
function prepareTest()
{
var tabDocument = currentTabDocument();
var tree = tabDocument.getElementById("tree");
loadXULTreeAndDoTest(doTest, tree, new nsTableTreeView(5));
}
SimpleTest.waitForExplicitFinish();
openBrowserWindow(prepareTest,
"chrome://mochitests/content/a11y/accessible/hittest/zoom_tree.xul",
{ left: 100, top: 100 });
]]>
</script>
<hbox 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=471493"
title=" crash [@ nsPropertyTable::GetPropertyInternal]">
Mozilla Bug 471493
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</hbox>
</window>

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

@ -0,0 +1,18 @@
<?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="nsIAccessible::getChildAtPoint and getDeepestChildAtPoint for XUL trees">
<tree id="tree" flex="1">
<treecols id="treecols">
<treecol id="treecol1" flex="1" primary="true" label="column"/>
<treecol id="treecol2" flex="1" label="column 2"/>
</treecols>
<treechildren id="treechildren"/>
</tree>
</window>

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

@ -1,25 +1,28 @@
/**
* Tests if the given accessible at the given point is expected.
* Tests if the given child and grand child accessibles at the given point are
* expected.
*
* @param aIdentifier [in] accessible identifier
* @param aX [in] x coordinate of the point relative accessible
* @param aY [in] y coordinate of the point relative accessible
* @param aFindDeepestChild [in] points whether deepest or nearest child should
* be returned
* @param aChildIdentifier [in] expected child accessible
* @param aID [in] accessible identifier
* @param aX [in] x coordinate of the point relative accessible
* @param aY [in] y coordinate of the point relative accessible
* @param aChildID [in] expected child accessible
* @param aGrandChildID [in] expected child accessible
*/
function testChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild,
aChildIdentifier)
function testChildAtPoint(aID, aX, aY, aChildID, aGrandChildID)
{
var childAcc = getAccessible(aChildIdentifier);
var actualChildAcc = getChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild);
var child = getChildAtPoint(aID, aX, aY, false);
var expectedChild = getAccessible(aChildID);
var msg = "Wrong " + (aFindDeepestChild ? "deepest" : "direct");
msg += " child accessible [" + prettyName(actualChildAcc);
msg += "] at the point (" + aX + ", " + aY + ") of accessible [";
msg += prettyName(aIdentifier) + "]";
var msg = "Wrong direct child accessible at the point (" + aX + ", " + aY +
") of " + prettyName(aID);
isObject(child, expectedChild, msg);
is(childAcc, actualChildAcc, msg);
var grandChild = getChildAtPoint(aID, aX, aY, true);
var expectedGrandChild = getAccessible(aGrandChildID);
msg = "Wrong deepest child accessible at the point (" + aX + ", " + aY +
") of " + prettyName(aID);
isObject(grandChild, expectedGrandChild, msg);
}
/**
@ -35,14 +38,27 @@ function hitTest(aContainerID, aChildID, aGrandChildID)
var [x, y] = getBoundsForDOMElm(child);
var actualChild = container.getChildAtPoint(x + 1, y + 1);
is(actualChild, child,
"Wrong child, expected: " + prettyName(child) +
", got: " + prettyName(actualChild));
isObject(actualChild, child,
"Wrong direct child of " + prettyName(aContainerID));
var actualGrandChild = container.getDeepestChildAtPoint(x + 1, y + 1);
is(actualGrandChild, grandChild,
"Wrong deepest child, expected: " + prettyName(grandChild) +
", got: " + prettyName(actualGrandChild));
isObject(actualGrandChild, grandChild,
"Wrong deepest child of " + prettyName(aContainerID));
}
/**
* Zoom the given document.
*/
function zoomDocument(aDocument, aZoom)
{
var docShell = aDocument.defaultView.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIWebNavigation).
QueryInterface(Components.interfaces.nsIDocShell);
var docViewer = docShell.contentViewer.
QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
docViewer.fullZoom = aZoom;
}
/**
@ -136,13 +152,20 @@ function getBoundsForDOMElm(aID)
}
var elmWindow = elm.ownerDocument.defaultView;
var winUtil = elmWindow.
return CSSToDevicePixels(elmWindow,
x + elmWindow.mozInnerScreenX,
y + elmWindow.mozInnerScreenY,
width,
height);
}
function CSSToDevicePixels(aWindow, aX, aY, aWidth, aHeight)
{
var winUtil = aWindow.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
var ratio = winUtil.screenPixelsPerCSSPixel;
return [ (x + elmWindow.mozInnerScreenX) * ratio,
(y + elmWindow.mozInnerScreenY) * ratio,
width * ratio,
height * ratio ];
return [aX * ratio, aY * ratio, aWidth * ratio, aHeight * ratio];
}

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

@ -40,7 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441737
// attributes should contain tag:body
attributes = docAcc.attributes;
is(attributes.getStringProperty("tag"), "BODY",
is(attributes.getStringProperty("tag"), "body",
"Wrong attribute on document!");
// nsIAccessibleDocument

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

@ -1,9 +1,12 @@
/**
* Helper method to start a single XUL tree test.
*/
var gXULTreeLoadQueue = null;
function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView)
function loadXULTreeAndDoTest(aDoTestFunc, aTreeID, aTreeView)
{
var doTestFunc = aDoTestFunc ? aDoTestFunc : gXULTreeLoadContext.doTestFunc;
var treeID = aTreeID ? aTreeID : gXULTreeLoadContext.treeID;
var treeView = aTreeView ? aTreeView : gXULTreeLoadContext.treeView;
function loadXULTree(aTreeID, aTreeView)
{
this.treeNode = getNode(aTreeID);
@ -23,19 +26,26 @@ function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView)
}
}
function doXULTreeTest()
gXULTreeLoadContext.queue = new eventQueue();
gXULTreeLoadContext.queue.push(new loadXULTree(treeID, treeView));
gXULTreeLoadContext.queue.onFinish = function()
{
gXULTreeLoadQueue = new eventQueue();
gXULTreeLoadQueue.push(new loadXULTree(aTreeID, aTreeView));
gXULTreeLoadQueue.onFinish = function()
{
SimpleTest.executeSoon(aDoTestFunc);
return DO_NOT_FINISH_TEST;
}
gXULTreeLoadQueue.invoke();
SimpleTest.executeSoon(doTestFunc);
return DO_NOT_FINISH_TEST;
}
gXULTreeLoadContext.queue.invoke();
}
addA11yLoadEvent(doXULTreeTest);
/**
* Analogy of addA11yLoadEvent, nice helper to load XUL tree and start the test.
*/
function addA11yXULTreeLoadEvent(aDoTestFunc, aTreeID, aTreeView)
{
gXULTreeLoadContext.doTestFunc = aDoTestFunc;
gXULTreeLoadContext.treeID = aTreeID;
gXULTreeLoadContext.treeView = aTreeView;
addA11yLoadEvent(loadXULTreeAndDoTest);
}
@ -273,3 +283,14 @@ function createAtom(aName)
return Components.classes["@mozilla.org/atom-service;1"]
.getService(Components.interfaces.nsIAtomService).getAtom(aName);
}
/**
* Used in conjunction with loadXULTreeAndDoTest and addA11yXULTreeLoadEvent.
*/
var gXULTreeLoadContext =
{
doTestFunc: null,
treeID: null,
treeView: null,
queue: null
};

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

@ -46,10 +46,6 @@
-moz-padding-start: 0;
}
#updateDeck > hbox > label:not([class="text-link"]) {
font-style:italic;
}
.update-throbber {
width: 16px;
min-height: 16px;

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

@ -2624,6 +2624,7 @@ function UpdateUrlbarSearchSplitterState()
splitter.id = "urlbar-search-splitter";
splitter.setAttribute("resizebefore", "flex");
splitter.setAttribute("resizeafter", "flex");
splitter.setAttribute("skipintoolbarset", "true");
splitter.className = "chromeclass-toolbar-additional";
}
urlbar.parentNode.insertBefore(splitter, ibefore);

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

@ -225,7 +225,9 @@ Section "MaintenanceService"
; this value to determine if we should show the service update pref.
; Since the Maintenance service can be installed either x86 or x64,
; always use the 64-bit registry for checking if an attempt was made.
SetRegView 64
${If} ${RunningX64}
SetRegView 64
${EndIf}
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
@ -234,7 +236,9 @@ Section "MaintenanceService"
; check from the service so that tests can be run.
; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "Thawte Code Signing CA - G2"
SetRegView lastused
${If} ${RunningX64}
SetRegView lastused
${EndIf}
SectionEnd
; By renaming before deleting we improve things slightly in case
@ -273,8 +277,12 @@ Section "Uninstall"
DeleteRegKey HKLM "${MaintUninstallKey}"
SetRegView 64
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
DeleteRegKey HKLM "${FallbackKey}\"
SetRegView lastused
${If} ${RunningX64}
SetRegView lastused
${EndIf}
SectionEnd

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

@ -121,10 +121,14 @@
; We check to see if the maintenance service install was already attempted.
; Since the Maintenance service can be installed either x86 or x64,
; always use the 64-bit registry for checking if an attempt was made.
SetRegView 64
${If} ${RunningX64}
SetRegView 64
${EndIf}
ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted"
ClearErrors
SetRegView lastused
${If} ${RunningX64}
SetRegView lastused
${EndIf}
; If the maintenance service is already installed, do nothing.
; The maintenance service will launch:
@ -618,12 +622,15 @@
; with at most one certificate. A fallback certificate can only be used
; if the binary is replaced with a different certificate.
; We always use the 64bit registry for certs.
; This call is ignored on 32-bit systems.
SetRegView 64
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegKey HKLM "$R0"
WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}"
WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}"
SetRegView lastused
${If} ${RunningX64}
SetRegView lastused
${EndIf}
ClearErrors
${EndIf}
; Restore the previously used value back

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

@ -214,7 +214,9 @@ Function un.UninstallServiceIfNotUsed
Push $1
; The maintenance service always uses the 64-bit registry on x64 systems
SetRegView 64
${If} ${RunningX64}
SetRegView 64
${EndIf}
; Figure out the number of subkeys
StrCpy $0 0
@ -225,7 +227,9 @@ loop:
goto loop
doneCount:
; Restore back the registry view
SetRegView lastUsed
${If} ${RunningX64}
SetRegView lastUsed
${EndIf}
${If} $0 == 0
; Get the path of the maintenance service uninstaller
ReadRegStr $1 HKLM ${MaintUninstallKey} "UninstallString"
@ -434,10 +438,13 @@ Section "Uninstall"
Pop $MaintCertKey
${If} $MaintCertKey != ""
; We always use the 64bit registry for certs
; This call is ignored on 32-bit systems.
SetRegView 64
DeleteRegKey HKLM "$MaintCertKey\"
SetRegView lastused
${If} ${RunningX64}
SetRegView 64
${EndIf}
DeleteRegKey HKLM "$MaintCertKey"
${If} ${RunningX64}
SetRegView lastused
${EndIf}
${EndIf}
Call un.UninstallServiceIfNotUsed
!endif

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

@ -45,16 +45,14 @@
#ifndef nsImageLoadingContent_h__
#define nsImageLoadingContent_h__
#include "nsIImageLoadingContent.h"
#include "nsINode.h"
#include "imgIRequest.h"
#include "prtypes.h"
#include "imgIContainerObserver.h"
#include "imgIDecoderObserver.h"
#include "mozilla/CORSMode.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h" // NS_CONTENT_DELETE_LIST_MEMBER
#include "nsString.h"
#include "nsEventStates.h"
#include "nsGenericHTMLElement.h"
#include "mozilla/CORSMode.h"
#include "nsIImageLoadingContent.h"
#include "nsIRequest.h"
class nsIURI;
class nsIDocument;

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

@ -1210,23 +1210,18 @@ nsXMLHttpRequest::GetStatus(PRUint32 *aStatus)
}
}
nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel();
PRUint16 readyState;
GetReadyState(&readyState);
if (readyState == UNSENT || readyState == OPENED || mErrorLoad) {
return NS_OK;
}
nsCOMPtr<nsIHttpChannel> httpChannel = GetCurrentHttpChannel();
if (httpChannel) {
nsresult rv = httpChannel->GetResponseStatus(aStatus);
if (rv == NS_ERROR_NOT_AVAILABLE) {
// Someone's calling this before we got a response... Check our
// ReadyState. If we're at 3 or 4, then this means the connection
// errored before we got any data; return 0 in that case.
PRUint16 readyState;
GetReadyState(&readyState);
if (readyState >= LOADING) {
*aStatus = 0;
return NS_OK;
}
if (NS_FAILED(rv)) {
*aStatus = 0;
}
return rv;
}
return NS_OK;

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

@ -219,12 +219,31 @@ checkResponseXMLAccessThrows(xhr);
is(xhr.response, null, "Bad JSON should result in null response.");
is(xhr.response, null, "Bad JSON should result in null response even 2nd time.");
// test response (responseType='blob')
var onloadCount = 0;
function checkOnloadCount() {
if (++onloadCount >= 6) SimpleTest.finish();
};
// Test status/statusText in all readyStates
xhr = new XMLHttpRequest();
function checkXHRStatus() {
if (xhr.readyState == xhr.UNSENT || xhr.readyState == xhr.OPENED) {
is(xhr.status, 0, "should be 0 before getting data");
is(xhr.statusText, "", "should be empty before getting data");
}
else {
is(xhr.status, 200, "should be 200 when we have data");
is(xhr.statusText, "OK", "should be OK when we have data");
}
}
checkXHRStatus();
xhr.open("GET", 'file_XHR_binary1.bin');
checkXHRStatus();
xhr.responseType = 'arraybuffer';
xhr.onreadystatechange = continueTest;
xhr.send(null);
while (xhr.readyState != 4) {
checkXHRStatus();
yield;
}
checkXHRStatus();
// test response (responseType='blob')
var responseTypes = ['blob', 'moz-blob'];
for (var i = 0; i < responseTypes.length; i++) {
var t = responseTypes[i];
@ -244,73 +263,72 @@ for (var i = 0; i < responseTypes.length; i++) {
ok(!(b instanceof File), "should not be a File");
is(b.size, "hello pass\n".length, "wrong blob size");
(function(){
var fr = new FileReader();
fr.onload = function() {
ok(fr.result, "hello pass\n", "wrong values");
checkOnloadCount();
};
fr.readAsBinaryString(b);
})();
var fr = new FileReader();
fr.onload = continueTest;
fr.readAsBinaryString(b);
yield;
ok(fr.result, "hello pass\n", "wrong values");
// with a binary file
(function(){
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
switch (xhr.readyState) {
case 2:
is(xhr.status, 200, "wrong status");
xhr.responseType = t;
break;
case 4:
b = xhr.response;
ok(b != null, "should have a non-null blob");
is(b.size, 12, "wrong blob size");
xhr = new XMLHttpRequest();
xhr.onreadystatechange = continueTest;
xhr.open("GET", 'file_XHR_binary1.bin', true);
xhr.send(null);
while(xhr.readyState != 2)
yield;
var fr = new FileReader();
fr.onload = function() {
is(fr.result, "\xaa\xee\0\x03\xff\xff\xff\xff\xbb\xbb\xbb\xbb", "wrong values");
checkOnloadCount();
};
xhr = null; // kill the XHR object
SpecialPowers.gc();
fr.readAsBinaryString(b);
break;
}
};
xhr.open("GET", 'file_XHR_binary1.bin', true);
xhr.send(null);
})();
is(xhr.status, 200, "wrong status");
xhr.responseType = t;
(function(){
// with a larger binary file
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
b = xhr.response;
ok(b != null, "should have a non-null blob");
is(b.size, 65536, "wrong blob size");
while(xhr.readyState != 4)
yield;
xhr.onreadystatechange = null;
var fr = new FileReader();
fr.onload = function() {
var u8 = new Uint8Array(fr.result);
for (var i = 0; i < 65536; i++) {
if (u8[i] !== (i & 255)) {
break;
}
}
is(i, 65536, "wrong value at offset " + i);
checkOnloadCount();
};
xhr = null; // kill the XHR object
SpecialPowers.gc();
fr.readAsArrayBuffer(b);
}
};
xhr.open("GET", 'file_XHR_binary2.bin', true);
xhr.responseType = t;
xhr.send(null);
})();
b = xhr.response;
ok(b != null, "should have a non-null blob");
is(b.size, 12, "wrong blob size");
fr = new FileReader();
fr.readAsBinaryString(b);
xhr = null; // kill the XHR object
b = null;
SpecialPowers.gc();
fr.onload = continueTest;
yield;
is(fr.result, "\xaa\xee\0\x03\xff\xff\xff\xff\xbb\xbb\xbb\xbb", "wrong values");
// with a larger binary file
xhr = new XMLHttpRequest();
xhr.onreadystatechange = continueTest;
xhr.open("GET", 'file_XHR_binary2.bin', true);
xhr.responseType = t;
xhr.send(null);
while (xhr.readyState != 4)
yield;
xhr.onreadystatechange = null;
var b = xhr.response;
ok(b != null, "should have a non-null blob");
is(b.size, 65536, "wrong blob size");
fr = new FileReader();
fr.readAsArrayBuffer(b);
fr.onload = continueTest;
xhr = null; // kill the XHR object
b = null;
SpecialPowers.gc();
yield;
var u8 = new Uint8Array(fr.result);
for (var i = 0; i < 65536; i++) {
if (u8[i] !== (i & 255)) {
break;
}
}
is(i, 65536, "wrong value at offset " + i);
}
var client = new XMLHttpRequest();
@ -333,7 +351,9 @@ client.open("GET", "file_XHR_pass1.xml", true);
client.send();
client.abort();
SimpleTest.finish();
yield;
} /* runTests */
</script>
</pre>

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

@ -1081,6 +1081,30 @@ protected:
bool mGLBufferIsPremultiplied;
bool mNeedsYFlip;
nsRefPtr<gfxImageSurface> mCachedTempSurface;
gfxIntSize mCachedSize;
gfxImageFormat mCachedFormat;
gfxImageSurface* GetTempSurface(const gfxIntSize& aSize, const gfxImageFormat aFormat)
{
if (!mCachedTempSurface ||
aSize.width != mCachedSize.width ||
aSize.height != mCachedSize.height ||
aFormat != mCachedFormat)
{
mCachedTempSurface = new gfxImageSurface(aSize, aFormat);
mCachedSize = aSize;
mCachedFormat = aFormat;
}
return mCachedTempSurface;
}
void DiscardTempSurface()
{
mCachedTempSurface = nsnull;
}
};
void
@ -1139,7 +1163,7 @@ BasicCanvasLayer::UpdateSurface(gfxASurface* aDestSurface)
mGLContext->MakeCurrent();
#if defined (MOZ_X11) && defined (MOZ_EGL_XRENDER_COMPOSITE)
mGLContext->fFinish();
mGLContext->GuaranteeResolve();
gfxASurface* offscreenSurface = mGLContext->GetOffscreenPixmapSurface();
// XRender can only blend premuliplied alpha, so only allow xrender
@ -1147,16 +1171,22 @@ BasicCanvasLayer::UpdateSurface(gfxASurface* aDestSurface)
if (offscreenSurface && (mGLBufferIsPremultiplied || (GetContentFlags() & CONTENT_OPAQUE))) {
mSurface = offscreenSurface;
mNeedsYFlip = false;
return;
}
else
#endif
{
nsRefPtr<gfxImageSurface> isurf = aDestSurface ?
static_cast<gfxImageSurface*>(aDestSurface) :
new gfxImageSurface(gfxIntSize(mBounds.width, mBounds.height),
(GetContentFlags() & CONTENT_OPAQUE)
? gfxASurface::ImageFormatRGB24
: gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxImageSurface> isurf;
if (aDestSurface) {
DiscardTempSurface();
isurf = static_cast<gfxImageSurface*>(aDestSurface);
} else {
nsIntSize size(mBounds.width, mBounds.height);
gfxImageFormat format = (GetContentFlags() & CONTENT_OPAQUE)
? gfxASurface::ImageFormatRGB24
: gfxASurface::ImageFormatARGB32;
isurf = GetTempSurface(size, format);
}
if (!isurf || isurf->CairoStatus() != 0) {
return;
@ -1194,7 +1224,6 @@ BasicCanvasLayer::UpdateSurface(gfxASurface* aDestSurface)
}
}
}
}
void
BasicCanvasLayer::Paint(gfxContext* aContext)

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

@ -172,10 +172,13 @@ CanvasLayerD3D10::UpdateSurface()
return;
}
const bool stridesMatch = map.RowPitch == mBounds.width * 4;
PRUint8 *destination;
if (map.RowPitch != mBounds.width * 4) {
destination = new PRUint8[mBounds.width * mBounds.height * 4];
if (!stridesMatch) {
destination = GetTempBlob(mBounds.width * mBounds.height * 4);
} else {
DiscardTempBlob();
destination = (PRUint8*)map.pData;
}
@ -204,13 +207,12 @@ CanvasLayerD3D10::UpdateSurface()
if (currentFramebuffer != mCanvasFramebuffer)
mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, currentFramebuffer);
if (map.RowPitch != mBounds.width * 4) {
if (!stridesMatch) {
for (int y = 0; y < mBounds.height; y++) {
memcpy((PRUint8*)map.pData + map.RowPitch * y,
destination + mBounds.width * 4 * y,
mBounds.width * 4);
}
delete [] destination;
}
mTexture->Unmap(0);
} else if (mSurface) {

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

@ -87,6 +87,24 @@ private:
bool mIsD2DTexture;
bool mUsingSharedTexture;
bool mHasAlpha;
nsAutoArrayPtr<PRUint8> mCachedTempBlob;
PRUint32 mCachedTempBlob_Size;
PRUint8* GetTempBlob(const PRUint32 aSize)
{
if (!mCachedTempBlob || aSize != mCachedTempBlob_Size) {
mCachedTempBlob = new PRUint8[aSize];
mCachedTempBlob_Size = aSize;
}
return mCachedTempBlob;
}
void DiscardTempBlob()
{
mCachedTempBlob = nsnull;
}
};
} /* layers */

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

@ -113,10 +113,13 @@ CanvasLayerD3D9::UpdateSurface()
D3DLOCKED_RECT r = textureLock.GetLockRect();
const bool stridesMatch = r.Pitch == mBounds.width * 4;
PRUint8 *destination;
if (r.Pitch != mBounds.width * 4) {
destination = new PRUint8[mBounds.width * mBounds.height * 4];
if (!stridesMatch) {
destination = GetTempBlob(mBounds.width * mBounds.height * 4);
} else {
DiscardTempBlob();
destination = (PRUint8*)r.pBits;
}
@ -145,13 +148,12 @@ CanvasLayerD3D9::UpdateSurface()
if (currentFramebuffer != mCanvasFramebuffer)
mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, currentFramebuffer);
if (r.Pitch != mBounds.width * 4) {
if (!stridesMatch) {
for (int y = 0; y < mBounds.height; y++) {
memcpy((PRUint8*)r.pBits + r.Pitch * y,
destination + mBounds.width * 4 * y,
mBounds.width * 4);
}
delete [] destination;
}
} else {
RECT r;

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

@ -92,6 +92,24 @@ protected:
bool mDataIsPremultiplied;
bool mNeedsYFlip;
bool mHasAlpha;
nsAutoArrayPtr<PRUint8> mCachedTempBlob;
PRUint32 mCachedTempBlob_Size;
PRUint8* GetTempBlob(const PRUint32 aSize)
{
if (!mCachedTempBlob || aSize != mCachedTempBlob_Size) {
mCachedTempBlob = new PRUint8[aSize];
mCachedTempBlob_Size = aSize;
}
return mCachedTempBlob;
}
void DiscardTempBlob()
{
mCachedTempBlob = nsnull;
}
};
// NB: eventually we'll have separate shadow canvas2d and shadow

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

@ -178,6 +178,8 @@ CanvasLayerOGL::UpdateSurface()
if (mCanvasGLContext &&
mCanvasGLContext->GetContextType() == gl()->GetContextType())
{
DiscardTempSurface();
// Can texture share, just make sure it's resolved first
mCanvasGLContext->MakeCurrent();
mCanvasGLContext->GuaranteeResolve();
@ -190,6 +192,7 @@ CanvasLayerOGL::UpdateSurface()
}
} else {
nsRefPtr<gfxASurface> updatedAreaSurface;
if (mDrawTarget) {
// TODO: This is suboptimal - We should have direct handling for the surface types instead of
// going via a gfxASurface.
@ -197,23 +200,24 @@ CanvasLayerOGL::UpdateSurface()
} else if (mCanvasSurface) {
updatedAreaSurface = mCanvasSurface;
} else if (mCanvasGLContext) {
gfxIntSize size(mBounds.width, mBounds.height);
nsRefPtr<gfxImageSurface> updatedAreaImageSurface =
new gfxImageSurface(gfxIntSize(mBounds.width, mBounds.height),
gfxASurface::ImageFormatARGB32);
GetTempSurface(size, gfxASurface::ImageFormatARGB32);
mCanvasGLContext->ReadPixelsIntoImageSurface(0, 0,
mBounds.width,
mBounds.height,
updatedAreaImageSurface);
updatedAreaSurface = updatedAreaImageSurface;
}
mOGLManager->MakeCurrent();
mLayerProgram =
gl()->UploadSurfaceToTexture(updatedAreaSurface,
mBounds,
mTexture,
false,
nsIntPoint(0, 0));
mLayerProgram = gl()->UploadSurfaceToTexture(updatedAreaSurface,
mBounds,
mTexture,
false,
nsIntPoint(0, 0));
}
}

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

@ -94,6 +94,30 @@ protected:
#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
GLXPixmap mPixmap;
#endif
nsRefPtr<gfxImageSurface> mCachedTempSurface;
gfxIntSize mCachedSize;
gfxImageFormat mCachedFormat;
gfxImageSurface* GetTempSurface(const gfxIntSize& aSize, const gfxImageFormat aFormat)
{
if (!mCachedTempSurface ||
aSize.width != mCachedSize.width ||
aSize.height != mCachedSize.height ||
aFormat != mCachedFormat)
{
mCachedTempSurface = new gfxImageSurface(aSize, aFormat);
mCachedSize = aSize;
mCachedFormat = aFormat;
}
return mCachedTempSurface;
}
void DiscardTempSurface()
{
mCachedTempSurface = nsnull;
}
};
// NB: eventually we'll have separate shadow canvas2d and shadow

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

@ -13,14 +13,17 @@
#include "SensorDevice.h"
#include "nsThreadUtils.h"
#include <android/log.h>
using namespace mozilla::hal;
using namespace android;
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GonkSensor" , ## args)
namespace mozilla {
#define DEFAULT_DEVICE_POLL_RATE 100000000 /*100ms*/
double radToDeg(double a) {
return a * (180.0 / M_PI);
}
@ -82,7 +85,6 @@ SensorseventStatus(const sensors_event_t& data)
return data.gyro.status;
}
return SENSOR_STATUS_UNRELIABLE;
}
@ -122,79 +124,96 @@ private:
namespace hal_impl {
static pthread_t sThread;
static bool sInitialized = false;
static bool sContinue = true;
static int sActivatedSensors = 0;
static nsCOMPtr<nsIThread> sSwitchThread;
static void*
UpdateSensorData(void* /*unused*/)
{
SensorDevice &device = SensorDevice::getInstance();
const size_t numEventMax = 16;
sensors_event_t buffer[numEventMax];
int count = 0;
while (sContinue) {
count = device.poll(buffer, numEventMax);
if (count < 0) {
continue;
}
for (int i=0; i<count; i++) {
if (SensorseventStatus(buffer[i]) == SENSOR_STATUS_UNRELIABLE) {
continue;
}
NS_DispatchToMainThread(new SensorRunnable(buffer[i]));
}
}
return NULL;
}
static void
InitializeResources()
{
sInitialized = true;
sContinue = true;
pthread_create(&sThread, NULL, &UpdateSensorData, NULL);
NS_NewThread(getter_AddRefs(sSwitchThread));
}
static void
ReleaseResources()
{
sContinue = false;
pthread_join(sThread, NULL);
sSwitchThread->Shutdown();
sInitialized = false;
}
// This class is used as a runnable on the sSwitchThread
class SensorInfo {
public:
NS_INLINE_DECL_REFCOUNTING(SensorInfo)
SensorInfo(bool aActivate, sensor_t aSensor, pthread_t aThreadId) :
activate(aActivate), sensor(aSensor), threadId(aThreadId) { }
void Switch() {
SensorDevice& device = SensorDevice::getInstance();
device.activate((void*)threadId, sensor.handle, activate);
device.setDelay((void*)threadId, sensor.handle, DEFAULT_DEVICE_POLL_RATE);
}
protected:
SensorInfo() { };
bool activate;
sensor_t sensor;
pthread_t threadId;
class SensorStatus {
public:
SensorData data;
DebugOnly<int> count;
};
static int sActivatedSensors = 0;
static SensorStatus sSensorStatus[NUM_SENSOR_TYPE];
static nsCOMPtr<nsIThread> sSwitchThread;
class PollSensor {
public:
NS_INLINE_DECL_REFCOUNTING(PollSensor);
static nsCOMPtr<nsIRunnable> GetRunnable() {
if (!mRunnable)
mRunnable = NS_NewRunnableMethod(new PollSensor(), &PollSensor::Poll);
return mRunnable;
}
void Poll() {
if (!sActivatedSensors) {
return;
}
SensorDevice &device = SensorDevice::getInstance();
const size_t numEventMax = 16;
sensors_event_t buffer[numEventMax];
int n = device.poll(buffer, numEventMax);
if (n < 0) {
LOG("Error polling for sensor data (err=%d)", n);
return;
}
for (int i = 0; i < n; ++i) {
if (SensorseventStatus(buffer[i]) == SENSOR_STATUS_UNRELIABLE) {
continue;
}
NS_DispatchToMainThread(new SensorRunnable(buffer[i]));
}
if (sActivatedSensors) {
sSwitchThread->Dispatch(GetRunnable(), NS_DISPATCH_NORMAL);
}
}
private:
static nsCOMPtr<nsIRunnable> mRunnable;
};
nsCOMPtr<nsIRunnable> PollSensor::mRunnable = NULL;
class SwitchSensor {
public:
NS_INLINE_DECL_REFCOUNTING(SwitchSensor)
SwitchSensor(bool aActivate, sensor_t aSensor, pthread_t aThreadId) :
mActivate(aActivate), mSensor(aSensor), mThreadId(aThreadId) { }
void Switch() {
int index = HardwareSensorToHalSensor(mSensor.type);
MOZ_ASSERT(sSensorStatus[index].count == 0 || mActivate);
SensorDevice& device = SensorDevice::getInstance();
device.activate((void*)mThreadId, mSensor.handle, mActivate);
device.setDelay((void*)mThreadId, mSensor.handle, DEFAULT_DEVICE_POLL_RATE);
if (mActivate) {
if (++sActivatedSensors == 1) {
sSwitchThread->Dispatch(PollSensor::GetRunnable(), NS_DISPATCH_NORMAL);
}
sSensorStatus[index].count++;
} else {
sSensorStatus[index].count--;
--sActivatedSensors;
}
}
protected:
SwitchSensor() { };
bool mActivate;
sensor_t mSensor;
pthread_t mThreadId;
};
static void
SensorSwitch(SensorType aSensor, bool activate)
SetSensorState(SensorType aSensor, bool activate)
{
int type = HalSensorToHardwareSensor(aSensor);
const sensor_t* sensors = NULL;
@ -202,9 +221,10 @@ SensorSwitch(SensorType aSensor, bool activate)
size_t size = device.getSensorList(&sensors);
for (size_t i = 0; i < size; i++) {
if (sensors[i].type == type) {
// Post an event to the activation thread
nsCOMPtr<nsIRunnable> event = NS_NewRunnableMethod(new SensorInfo(activate, sensors[i], pthread_self()),
&SensorInfo::Switch);
// Post an event to the sensor thread
nsCOMPtr<nsIRunnable> event = NS_NewRunnableMethod(new SwitchSensor(activate, sensors[i], pthread_self()),
&SwitchSensor::Switch);
sSwitchThread->Dispatch(event, NS_DISPATCH_NORMAL);
break;
}
@ -214,28 +234,17 @@ SensorSwitch(SensorType aSensor, bool activate)
void
EnableSensorNotifications(SensorType aSensor)
{
if (!sInitialized) {
InitializeResources();
if (sSwitchThread == nsnull) {
NS_NewThread(getter_AddRefs(sSwitchThread));
}
SensorSwitch(aSensor, true);
sActivatedSensors++;
SetSensorState(aSensor, true);
}
void
DisableSensorNotifications(SensorType aSensor)
{
if (!sInitialized) {
NS_WARNING("Disable sensors without initializing first");
return;
}
SensorSwitch(aSensor, false);
sActivatedSensors--;
if (!sActivatedSensors) {
ReleaseResources();
}
SetSensorState(aSensor, false);
}
} // hal_impl

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

@ -647,7 +647,7 @@ nsWin32Locale::GetPlatformLocale(const nsAString& locale, LCID* winLCID)
char locale_string[9] = {'\0','\0','\0','\0','\0','\0','\0','\0','\0'};
char* language_code;
char* country_code;
int i,j;
size_t i, j;
// parse the locale
const PRUnichar* data;
@ -700,7 +700,7 @@ nsWin32Locale::GetXPLocale(LCID winLCID, nsAString& locale)
}
DWORD lang_id, sublang_id;
int i,j;
size_t i, j;
lang_id = PRIMARYLANGID(LANGIDFROMLCID(winLCID));
sublang_id = SUBLANGID(LANGIDFROMLCID(winLCID));
@ -754,7 +754,7 @@ nsWin32Locale::GetXPLocale(LCID winLCID, nsAString& locale)
void
test_internal_tables(void)
{
int i;
size_t i;
for(i=1;i<LENGTH_MAPPING_LIST;i++) {
if (strcmp(dbg_list[i-1].iso_code,dbg_list[i].iso_code)>=0)

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

@ -255,7 +255,7 @@ nsConverterInputStream::Fill(nsresult * aErrorCode)
"Whoa. The converter should have returned NS_OK_UDEC_MOREINPUT before this point!");
} while (mReplacementChar &&
NS_FAILED(*aErrorCode) &&
mUnicharData->GetBufferSize() > mUnicharDataLength);
PRUint32(mUnicharData->GetBufferSize()) > mUnicharDataLength);
mLeftOverBytes = mByteData->GetLength() - srcConsumed;

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

@ -49,7 +49,7 @@
inline bool WillOverrun(PRUnichar* aDest, PRUnichar* aDestEnd, PRUint32 aLength)
{
NS_ASSERTION(aDest <= aDestEnd, "Pointer overrun even before check");
return ((aDestEnd - aDest) < aLength);
return (PRUint32(aDestEnd - aDest) < aLength);
}
#define CHECK_OVERRUN(dest, destEnd, length) (WillOverrun(dest, destEnd, length))

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

@ -159,8 +159,7 @@ mozJSLoaderErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep)
* Got an error object; prepare appropriate-width versions of
* various arguments to it.
*/
nsAutoString fileUni;
fileUni.AssignWithConversion(rep->filename);
NS_ConvertASCIItoUTF16 fileUni(rep->filename);
PRUint32 column = rep->uctokenptr - rep->uclinebuf;

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

@ -1485,7 +1485,7 @@ XPCConvert::JSErrorToXPCException(XPCCallContext& ccx,
if (report && report->ucmessage) {
bestMessage = (const PRUnichar *)report->ucmessage;
} else if (message) {
bestMessage.AssignWithConversion(message);
CopyASCIItoUTF16(message, bestMessage);
} else {
bestMessage.AssignLiteral("JavaScript Error");
}

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

@ -1109,8 +1109,7 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx,
rv = xpc_exception->ToString(&exn_string);
if (NS_SUCCEEDED(rv)) {
// use toString on the exception as the message
nsAutoString newMessage;
newMessage.AssignWithConversion(exn_string);
NS_ConvertASCIItoUTF16 newMessage(exn_string);
nsMemory::Free((void *) exn_string);
// try to get filename, lineno from the first

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

@ -28,13 +28,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533596
function go() {
var wrappedWin = $('ifr').contentWindow;
is(typeof wrappedWin.expando, 'undefined', "Shouldn't be able to see the expando");
var unwrapped = wrappedWin.wrappedJSObject;
var filter = unwrapped.filter;
is(utils.getClassName(filter), 'Proxy', 'properly wrapped');
is(typeof filter.QueryInterface, 'function', 'double wrapped');
var expando = unwrapped.expando;
is(utils.getClassName(expando), 'Proxy', 'properly wrapped');
is(typeof expando.QueryInterface, 'function', 'double wrapped');
ok(unwrapped.testme(filter),
ok(unwrapped.testme(expando),
"content didn't get a proxy, but another double wrapped object");
SimpleTest.finish();
}

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

@ -1,9 +1,11 @@
<html>
<head>
<script>
var fcn = function() {};
var iter = document.createNodeIterator(document, NodeFilter.SHOW_ELEMENT, fcn, false);
var filter = iter.filter;
// We want to put an expando on the object, but we want this object
// to be wrapped in other compartments. This means that the expando
// must implement precreate, which happens (in general) for nodes.
// So we just do a cyclic reference to the document body.
window.expando = document.documentElement;
function testme(obj) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

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

@ -187,11 +187,6 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *obj
XPCWrappedNative *wn = static_cast<XPCWrappedNative *>(xpc_GetJSPrivate(obj));
// If the object doesn't have classinfo we want to return the same
// XPCWrappedNative so that we keep the same set of interfaces.
if (!wn->GetClassInfo())
return DoubleWrap(cx, obj, flags);
JSAutoEnterCompartment ac;
if (!ac.enter(cx, obj))
return nsnull;

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

@ -142,7 +142,6 @@ public:
nsListControlFrame_id,
nsListItemFrame_id,
nsMathMLContainerFrame_id,
nsMathMLForeignFrameWrapper_id,
nsMathMLFrame_id,
nsMathMLmactionFrame_id,
nsMathMLmathBlockFrame_id,

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

@ -62,7 +62,6 @@ LOCAL_INCLUDES = \
CPPSRCS = nsMathMLChar.cpp \
nsMathMLFrame.cpp \
nsMathMLContainerFrame.cpp \
nsMathMLForeignFrameWrapper.cpp \
nsMathMLOperators.cpp \
nsMathMLTokenFrame.cpp \
nsMathMLmoFrame.cpp \

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

@ -1,90 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is
* The University Of Queensland.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//
// a helper frame class to wrap non-MathML frames so that foreign elements
// (e.g., html:img) can mix better with other surrounding MathML markups
//
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsFrame.h"
#include "nsBlockFrame.h"
#include "nsLineLayout.h"
#include "nsPresContext.h"
#include "nsStyleContext.h"
#include "nsStyleConsts.h"
#include "nsMathMLForeignFrameWrapper.h"
NS_QUERYFRAME_HEAD(nsMathMLForeignFrameWrapper)
NS_QUERYFRAME_ENTRY(nsMathMLFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
nsIFrame*
NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
return new (aPresShell) nsMathMLForeignFrameWrapper(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLForeignFrameWrapper)
NS_IMETHODIMP
nsMathMLForeignFrameWrapper::Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
// Let the base class do the reflow
nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
mReference.x = 0;
mReference.y = aDesiredSize.ascent;
// just make-up a bounding metrics
mBoundingMetrics = nsBoundingMetrics();
mBoundingMetrics.ascent = aDesiredSize.ascent;
mBoundingMetrics.descent = aDesiredSize.height - aDesiredSize.ascent;
mBoundingMetrics.width = aDesiredSize.width;
mBoundingMetrics.leftBearing = 0;
mBoundingMetrics.rightBearing = aDesiredSize.width;
aDesiredSize.mBoundingMetrics = mBoundingMetrics;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
return rv;
}

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

@ -1,122 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla MathML Project.
*
* The Initial Developer of the Original Code is
* The University Of Queensland.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Roger B. Sidje <rbs@maths.uq.edu.au>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//
// a helper frame class to wrap non-MathML frames so that foreign elements
// (e.g., html:img) can mix better with other surrounding MathML markups
//
#ifndef nsMathMLForeignFrameWrapper_h___
#define nsMathMLForeignFrameWrapper_h___
#include "nsCOMPtr.h"
#include "nsMathMLContainerFrame.h"
class nsMathMLForeignFrameWrapper : public nsBlockFrame,
public nsMathMLFrame {
public:
friend nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// Overloaded nsIMathMLFrame methods
NS_IMETHOD
UpdatePresentationDataFromChildAt(PRInt32 aFirstIndex,
PRInt32 aLastIndex,
PRUint32 aFlagsValues,
PRUint32 aFlagsToUpdate)
{
nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(this,
aFirstIndex, aLastIndex, aFlagsValues, aFlagsToUpdate);
return NS_OK;
}
// overloaded nsBlockFrame methods
#ifdef NS_DEBUG
NS_IMETHOD
SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList)
{
NS_ASSERTION(aChildList.NotEmpty() && aChildList.GetLength() == 1,
"there must be one and only one child frame");
return nsBlockFrame::SetInitialChildList(aListID, aChildList);
}
#endif
NS_IMETHOD
Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
// we are just a wrapper and these methods shouldn't be called
NS_IMETHOD
AppendFrames(ChildListID aListID,
nsFrameList& aFrameList)
{
NS_NOTREACHED("unsupported operation");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHOD
InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList)
{
NS_NOTREACHED("unsupported operation");
return NS_ERROR_NOT_IMPLEMENTED;
}
// Our life is bound to the life of our unique child.
// When our child goes away, we ask our parent to delete us
NS_IMETHOD
RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame)
{
return mParent->RemoveFrame(aListID, this);
}
protected:
nsMathMLForeignFrameWrapper(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
virtual ~nsMathMLForeignFrameWrapper() {}
};
#endif /* nsMathMLForeignFrameWrapper_h___ */

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

@ -43,7 +43,6 @@
#include "nsISupports.h"
// Factory methods for creating MathML objects
nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);

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

@ -106,7 +106,6 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../../../xul/base/src \
-I$(srcdir)/../../../../content/svg/content/src \
-I$(srcdir)/../../../../content/base/src \
-I$(srcdir)/../../../../content/html/content/src \
$(NULL)
libs::

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

@ -34,7 +34,11 @@
*
* ***** END LICENSE BLOCK ***** */
// Keep in (case-insensitive) order:
#include "nsContainerFrame.h"
#include "nsGkAtoms.h"
#include "nsIFrame.h"
#include "nsLiteralString.h"
#include "nsSVGEffects.h"
#include "nsSVGFilters.h"

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

@ -34,11 +34,13 @@
*
* ***** END LICENSE BLOCK ***** */
// Keep in (case-insensitive) order:
#include "nsContentUtils.h"
#include "nsFrame.h"
#include "nsGkAtoms.h"
#include "nsLiteralString.h"
#include "nsSVGEffects.h"
#include "nsSVGFilters.h"
#include "nsContentUtils.h"
#include "nsImageLoadingContent.h"
using namespace mozilla;

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

@ -34,9 +34,11 @@
*
* ***** END LICENSE BLOCK ***** */
// Keep in (case-insensitive) order:
#include "nsFrame.h"
#include "nsSVGFilters.h"
#include "nsGkAtoms.h"
#include "nsSVGEffects.h"
#include "nsSVGFilters.h"
typedef nsFrame SVGFELeafFrameBase;

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

@ -34,9 +34,11 @@
*
* ***** END LICENSE BLOCK ***** */
// Keep in (case-insensitive) order:
#include "nsFrame.h"
#include "nsSVGFilters.h"
#include "nsGkAtoms.h"
#include "nsSVGEffects.h"
#include "nsSVGFilters.h"
typedef nsFrame SVGFEUnstyledLeafFrameBase;

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

@ -36,12 +36,11 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGTSpanFrame.h"
#include "nsISVGGlyphFragmentNode.h"
#include "nsSVGGraphicElement.h"
#include "nsSVGAElement.h"
#include "nsSVGUtils.h"
// Keep in (case-insensitive) order:
#include "gfxMatrix.h"
#include "nsSVGAElement.h"
#include "nsSVGTSpanFrame.h"
#include "nsSVGUtils.h"
#include "SVGLengthList.h"
// <a> elements can contain text. nsSVGGlyphFrames expect to have

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

@ -34,17 +34,17 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGClipPathFrame.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGClipPathElement.h"
#include "nsRenderingContext.h"
#include "nsGkAtoms.h"
#include "nsSVGUtils.h"
#include "nsSVGEffects.h"
#include "nsSVGClipPathElement.h"
#include "gfxContext.h"
#include "nsSVGEffects.h"
#include "nsSVGUtils.h"
//----------------------------------------------------------------------
// Implementation

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

@ -34,10 +34,12 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGContainerFrame.h"
// Keep others in (case-insensitive) order:
#include "nsSVGElement.h"
#include "nsSVGUtils.h"
#include "nsSVGOuterSVGFrame.h"
NS_QUERYFRAME_HEAD(nsSVGContainerFrame)
NS_QUERYFRAME_ENTRY(nsSVGContainerFrame)

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

@ -35,15 +35,16 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGEffects.h"
// Keep others in (case-insensitive) order:
#include "nsCSSFrameConstructor.h"
#include "nsISupportsImpl.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGFilterFrame.h"
#include "nsSVGClipPathFrame.h"
#include "nsSVGFilterFrame.h"
#include "nsSVGMaskFrame.h"
#include "nsSVGTextPathFrame.h"
#include "nsCSSFrameConstructor.h"
#include "nsFrameManager.h"
using namespace mozilla;
using namespace mozilla::dom;

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

@ -34,23 +34,19 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGFilterFrame.h"
#include "nsRenderingContext.h"
#include "nsIDocument.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsGkAtoms.h"
#include "nsSVGEffects.h"
#include "nsSVGUtils.h"
#include "nsSVGFilterElement.h"
#include "nsSVGFilters.h"
// Keep others in (case-insensitive) order:
#include "gfxASurface.h"
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGRect.h"
#include "nsSVGFilterInstance.h"
#include "gfxUtils.h"
#include "nsGkAtoms.h"
#include "nsRenderingContext.h"
#include "nsSVGEffects.h"
#include "nsSVGFilterElement.h"
#include "nsSVGFilterInstance.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGUtils.h"
nsIFrame*
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)

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

@ -34,16 +34,17 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGFilterInstance.h"
#include "nsRenderingContext.h"
#include "nsSVGUtils.h"
#include "nsIDOMSVGUnitTypes.h"
// Keep others in (case-insensitive) order:
#include "gfxPlatform.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGFilterElement.h"
#include "nsLayoutUtils.h"
#include "gfxUtils.h"
#include "nsIDOMSVGUnitTypes.h"
#include "nsRenderingContext.h"
#include "nsSVGFilterElement.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGUtils.h"
float
nsSVGFilterInstance::GetPrimitiveNumber(PRUint8 aCtxType, float aValue) const

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

@ -36,24 +36,23 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGForeignObjectFrame.h"
#include "nsIDOMSVGForeignObjectElem.h"
#include "nsIDOMSVGSVGElement.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsRegion.h"
#include "nsRenderingContext.h"
#include "nsGkAtoms.h"
#include "nsLayoutUtils.h"
#include "nsSVGUtils.h"
#include "nsIURI.h"
#include "nsSVGRect.h"
#include "nsINameSpaceManager.h"
#include "nsSVGEffects.h"
#include "nsSVGForeignObjectElement.h"
#include "nsSVGContainerFrame.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "gfxMatrix.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGForeignObjectElem.h"
#include "nsINameSpaceManager.h"
#include "nsLayoutUtils.h"
#include "nsRegion.h"
#include "nsRenderingContext.h"
#include "nsSVGContainerFrame.h"
#include "nsSVGEffects.h"
#include "nsSVGForeignObjectElement.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGUtils.h"
//----------------------------------------------------------------------
// Implementation

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

@ -36,12 +36,15 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMSVGTransformable.h"
// Main header first:
#include "nsSVGGFrame.h"
#include "nsIFrame.h"
// Keep others in (case-insensitive) order:
#include "nsGkAtoms.h"
#include "nsSVGUtils.h"
#include "nsIDOMSVGTransformable.h"
#include "nsIFrame.h"
#include "nsSVGGraphicElement.h"
#include "nsSVGUtils.h"
//----------------------------------------------------------------------
// Implementation

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

@ -36,8 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGGenericContainerFrame.h"
#include "nsSVGUtils.h"
//----------------------------------------------------------------------
// nsSVGGenericContainerFrame Implementation

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

@ -34,14 +34,16 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGGeometryFrame.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "nsPresContext.h"
#include "nsSVGEffects.h"
#include "nsSVGPaintServerFrame.h"
#include "nsSVGPathElement.h"
#include "nsSVGUtils.h"
#include "nsSVGGeometryFrame.h"
#include "nsSVGPaintServerFrame.h"
#include "nsContentUtils.h"
#include "gfxContext.h"
#include "nsSVGEffects.h"
NS_IMPL_FRAMEARENA_HELPERS(nsSVGGeometryFrame)

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

@ -36,27 +36,26 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGGlyphFrame.h"
#include "nsRenderingContext.h"
#include "nsSVGTextFrame.h"
#include "mozilla/LookAndFeel.h"
#include "nsTextFragment.h"
#include "nsBidiPresUtils.h"
#include "nsSVGUtils.h"
#include "SVGLengthList.h"
#include "nsIDOMSVGLength.h"
#include "nsIDOMSVGRect.h"
// Keep others in (case-insensitive) order:
#include "DOMSVGPoint.h"
#include "nsSVGTextPathFrame.h"
#include "nsSVGPathElement.h"
#include "nsSVGRect.h"
#include "nsDOMError.h"
#include "gfxContext.h"
#include "gfxMatrix.h"
#include "gfxPlatform.h"
#include "mozilla/LookAndFeel.h"
#include "nsBidiPresUtils.h"
#include "nsDOMError.h"
#include "nsIDOMSVGRect.h"
#include "nsRenderingContext.h"
#include "nsSVGEffects.h"
#include "nsSVGPaintServerFrame.h"
#include "nsSVGRect.h"
#include "nsSVGTextPathFrame.h"
#include "nsSVGUtils.h"
#include "nsTextFragment.h"
#include "SVGLengthList.h"
using namespace mozilla;

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

@ -37,17 +37,17 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsIDOMSVGAnimTransformList.h"
#include "SVGAnimatedTransformList.h"
#include "nsSVGEffects.h"
#include "nsIDOMSVGStopElement.h"
#include "nsSVGGradientElement.h"
#include "nsSVGGeometryFrame.h"
// Main header first:
#include "nsSVGGradientFrame.h"
#include "gfxContext.h"
// Keep others in (case-insensitive) order:
#include "gfxPattern.h"
#include "nsContentUtils.h"
#include "nsIDOMSVGAnimatedNumber.h"
#include "nsIDOMSVGStopElement.h"
#include "nsSVGEffects.h"
#include "nsSVGGradientElement.h"
#include "SVGAnimatedTransformList.h"
using mozilla::SVGAnimatedTransformList;

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

@ -34,26 +34,23 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGPathGeometryFrame.h"
#include "nsRenderingContext.h"
#include "imgIContainer.h"
#include "nsStubImageDecoderObserver.h"
#include "nsImageLoadingContent.h"
#include "nsIDOMSVGImageElement.h"
#include "nsLayoutUtils.h"
#include "nsSVGEffects.h"
#include "nsSVGImageElement.h"
#include "nsSVGUtils.h"
// Keep in (case-insensitive) order:
#include "gfxContext.h"
#include "gfxMatrix.h"
#include "nsIInterfaceRequestorUtils.h"
#include "gfxPlatform.h"
#include "imgIContainer.h"
#include "nsIDOMSVGImageElement.h"
#include "nsLayoutUtils.h"
#include "nsRenderingContext.h"
#include "nsStubImageDecoderObserver.h"
#include "nsSVGEffects.h"
#include "nsSVGImageElement.h"
#include "nsSVGPathGeometryFrame.h"
#include "nsSVGSVGElement.h"
#include "nsSVGUtils.h"
using namespace mozilla;
class nsRenderingContext;
class nsSVGImageFrame;
class nsSVGImageListener MOZ_FINAL : public nsStubImageDecoderObserver

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

@ -36,15 +36,16 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGInnerSVGFrame.h"
#include "nsRenderingContext.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "nsIFrame.h"
#include "nsISVGChildFrame.h"
#include "nsIDOMSVGAnimatedRect.h"
#include "nsSVGSVGElement.h"
#include "nsRenderingContext.h"
#include "nsSVGContainerFrame.h"
#include "gfxContext.h"
#include "nsSVGSVGElement.h"
nsIFrame*
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)

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

@ -35,21 +35,21 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGIntegrationUtils.h"
#include "nsRenderingContext.h"
#include "nsSVGUtils.h"
#include "nsSVGEffects.h"
#include "nsRegion.h"
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGFilterFrame.h"
#include "nsSVGClipPathFrame.h"
#include "nsSVGMaskFrame.h"
#include "gfxPlatform.h"
// Keep others in (case-insensitive) order:
#include "gfxDrawable.h"
#include "nsDisplayList.h"
#include "nsLayoutUtils.h"
#include "nsRenderingContext.h"
#include "nsSVGClipPathFrame.h"
#include "nsSVGEffects.h"
#include "nsSVGFilterFrame.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGMaskFrame.h"
#include "nsSVGPaintServerFrame.h"
#include "nsSVGUtils.h"
// ----------------------------------------------------------------------

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

@ -34,9 +34,9 @@
*
* ***** END LICENSE BLOCK ***** */
// Keep in (case-insensitive) order:
#include "nsFrame.h"
#include "nsSVGEffects.h"
#include "nsImageLoadingContent.h"
class nsSVGLeafFrame : public nsFrame
{

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

@ -34,17 +34,16 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGMarkerFrame.h"
#include "nsIDOMSVGAnimatedRect.h"
#include "nsIDOMSVGRect.h"
#include "nsIDocument.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "nsRenderingContext.h"
#include "nsSVGPathGeometryFrame.h"
#include "nsSVGEffects.h"
#include "nsSVGMarkerElement.h"
#include "nsSVGPathGeometryElement.h"
#include "gfxContext.h"
#include "nsSVGPathGeometryFrame.h"
nsIFrame*
NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)

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

@ -34,15 +34,15 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGMaskFrame.h"
#include "nsIDocument.h"
#include "nsRenderingContext.h"
#include "nsSVGContainerFrame.h"
#include "nsSVGMaskElement.h"
#include "nsSVGEffects.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "nsRenderingContext.h"
#include "nsSVGEffects.h"
#include "nsSVGMaskElement.h"
//----------------------------------------------------------------------
// Implementation

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

@ -36,25 +36,22 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGOuterSVGFrame.h"
// Keep others in (case-insensitive) order:
#include "DOMSVGTests.h"
#include "gfxMatrix.h"
#include "nsDisplayList.h"
#include "nsIDocument.h"
#include "nsIDOMSVGSVGElement.h"
#include "nsIDOMWindow.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIObjectLoadingContent.h"
#include "nsRenderingContext.h"
#include "nsStubMutationObserver.h"
#include "nsSVGSVGElement.h"
#include "nsSVGTextFrame.h"
#include "DOMSVGTests.h"
#include "nsDisplayList.h"
#include "nsStubMutationObserver.h"
#include "gfxContext.h"
#include "gfxMatrix.h"
#include "gfxRect.h"
#include "nsIContentViewer.h"
#include "nsIDocShell.h"
#include "nsIDOMDocument.h"
#include "nsIDOMWindow.h"
#include "nsPIDOMWindow.h"
#include "nsIObjectLoadingContent.h"
#include "nsIInterfaceRequestorUtils.h"
namespace dom = mozilla::dom;

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

@ -34,7 +34,10 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGPaintServerFrame.h"
// Keep others in (case-insensitive) order:
#include "nsSVGGeometryFrame.h"
NS_IMPL_FRAMEARENA_HELPERS(nsSVGPaintServerFrame)

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

@ -36,19 +36,19 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGPathGeometryFrame.h"
#include "nsGkAtoms.h"
#include "nsRenderingContext.h"
#include "nsSVGMarkerFrame.h"
#include "nsSVGUtils.h"
#include "nsSVGEffects.h"
#include "nsSVGGraphicElement.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGRect.h"
#include "nsSVGPathGeometryElement.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "gfxPlatform.h"
#include "nsGkAtoms.h"
#include "nsRenderingContext.h"
#include "nsSVGEffects.h"
#include "nsSVGGraphicElement.h"
#include "nsSVGMarkerFrame.h"
#include "nsSVGPathGeometryElement.h"
#include "nsSVGUtils.h"
//----------------------------------------------------------------------
// Implementation

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

@ -36,26 +36,24 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGPatternFrame.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGAnimatedRect.h"
#include "nsRenderingContext.h"
#include "SVGAnimatedTransformList.h"
#include "nsStyleContext.h"
#include "nsINameSpaceManager.h"
#include "nsISVGChildFrame.h"
#include "nsSVGRect.h"
#include "nsSVGUtils.h"
#include "nsSVGEffects.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGPatternElement.h"
#include "nsSVGGeometryFrame.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "gfxPlatform.h"
#include "gfxPattern.h"
#include "gfxMatrix.h"
#include "gfxPattern.h"
#include "gfxPlatform.h"
#include "nsContentUtils.h"
#include "nsGkAtoms.h"
#include "nsISVGChildFrame.h"
#include "nsRenderingContext.h"
#include "nsStyleContext.h"
#include "nsSVGEffects.h"
#include "nsSVGGeometryFrame.h"
#include "nsSVGPatternElement.h"
#include "nsSVGUtils.h"
#include "SVGAnimatedTransformList.h"
using namespace mozilla;

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

@ -36,10 +36,11 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMSVGStopElement.h"
#include "nsStyleContext.h"
// Keep in (case-insensitive) order:
#include "nsFrame.h"
#include "nsGkAtoms.h"
#include "nsIDOMSVGStopElement.h"
#include "nsStyleContext.h"
#include "nsSVGEffects.h"
// This is a very simple frame whose only purpose is to capture style change

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

@ -36,12 +36,12 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGEffects.h"
// Keep in (case-insensitive) order:
#include "gfxMatrix.h"
#include "gfxRect.h"
#include "nsSVGGFrame.h"
#include "nsSVGSwitchElement.h"
#include "nsSVGUtils.h"
#include "gfxRect.h"
#include "gfxMatrix.h"
class nsRenderingContext;

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

@ -36,12 +36,13 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGTSpanFrame.h"
// Keep others in (case-insensitive) order:
#include "nsIDOMSVGTSpanElement.h"
#include "nsIDOMSVGAltGlyphElement.h"
#include "nsSVGTSpanFrame.h"
#include "nsSVGUtils.h"
#include "nsSVGTextFrame.h"
#include "nsSVGOuterSVGFrame.h"
//----------------------------------------------------------------------
// Implementation

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

@ -34,18 +34,17 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGContainerFrame.h"
// Keep others in (case-insensitive) order:
#include "nsDOMError.h"
#include "nsSVGGlyphFrame.h"
#include "nsSVGTextFrame.h"
#include "nsSVGUtils.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsIDOMSVGTextElement.h"
#include "nsIDOMSVGAnimatedLengthList.h"
#include "SVGAnimatedNumberList.h"
#include "SVGNumberList.h"
#include "nsSVGGlyphFrame.h"
#include "nsDOMError.h"
#include "SVGLengthList.h"
#include "nsSVGTextPositioningElement.h"
#include "SVGNumberList.h"
using namespace mozilla;

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

@ -36,21 +36,20 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMSVGTextElement.h"
// Main header first:
#include "nsSVGTextFrame.h"
#include "SVGLengthList.h"
#include "nsIDOMSVGLength.h"
#include "nsIDOMSVGAnimatedNumber.h"
// Keep others in (case-insensitive) order:
#include "nsGkAtoms.h"
#include "nsIDOMSVGRect.h"
#include "nsIDOMSVGTextElement.h"
#include "nsISVGGlyphFragmentNode.h"
#include "nsSVGGlyphFrame.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsIDOMSVGRect.h"
#include "nsSVGRect.h"
#include "nsGkAtoms.h"
#include "nsSVGTextPathFrame.h"
#include "nsSVGPathElement.h"
#include "nsSVGUtils.h"
#include "nsSVGGraphicElement.h"
#include "nsSVGPathElement.h"
#include "nsSVGTextPathFrame.h"
#include "nsSVGUtils.h"
#include "SVGLengthList.h"
using namespace mozilla;

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

@ -34,13 +34,14 @@
*
* ***** END LICENSE BLOCK ***** */
// Main header first:
#include "nsSVGTextPathFrame.h"
#include "nsIDOMSVGTextPathElement.h"
#include "nsSVGLength2.h"
#include "nsIDOMSVGURIReference.h"
#include "nsSVGEffects.h"
// Keep others in (case-insensitive) order:
#include "nsContentUtils.h"
#include "nsIDOMSVGTextPathElement.h"
#include "nsSVGEffects.h"
#include "nsSVGLength2.h"
#include "nsSVGPathElement.h"
#include "nsSVGTextPathElement.h"
#include "SVGLengthList.h"

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

@ -34,13 +34,11 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGGFrame.h"
// Keep in (case-insensitive) order:
#include "nsIAnonymousContentCreator.h"
#include "nsIDOMSVGUseElement.h"
#include "nsIDOMSVGTransformable.h"
#include "nsSVGElement.h"
#include "nsSVGGFrame.h"
#include "nsSVGUseElement.h"
#include "gfxMatrix.h"
typedef nsSVGGFrame nsSVGUseFrameBase;

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

@ -34,64 +34,53 @@
*
* ***** END LICENSE BLOCK ***** */
// include nsSVGUtils.h first to ensure definition of M_SQRT1_2 is picked up
// Main header first:
// This is also necessary to ensure our definition of M_SQRT1_2 is picked up
#include "nsSVGUtils.h"
#include "nsIDOMDocument.h"
#include "nsIDOMSVGElement.h"
#include "nsIDOMSVGSVGElement.h"
#include "nsRenderingContext.h"
#include "nsStyleCoord.h"
#include "nsPresContext.h"
#include "nsSVGSVGElement.h"
// Keep others in (case-insensitive) order:
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "gfxMatrix.h"
#include "gfxPlatform.h"
#include "gfxRect.h"
#include "gfxUtils.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/Preferences.h"
#include "nsComputedDOMStyle.h"
#include "nsContentUtils.h"
#include "nsFrameList.h"
#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsIDocument.h"
#include "nsIFrame.h"
#include "nsGkAtoms.h"
#include "nsIURI.h"
#include "nsStyleStruct.h"
#include "nsIPresShell.h"
#include "nsNetUtil.h"
#include "nsFrameList.h"
#include "nsISVGChildFrame.h"
#include "nsContentDLF.h"
#include "nsContentUtils.h"
#include "nsSVGFilterFrame.h"
#include "nsINameSpaceManager.h"
#include "nsDOMError.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGInnerSVGFrame.h"
#include "SVGAnimatedPreserveAspectRatio.h"
#include "nsSVGClipPathFrame.h"
#include "nsSVGMaskFrame.h"
#include "nsSVGContainerFrame.h"
#include "nsSVGTextContainerFrame.h"
#include "nsSVGLength2.h"
#include "nsGenericElement.h"
#include "nsSVGGraphicElement.h"
#include "nsAttrValue.h"
#include "nsIScriptError.h"
#include "gfxContext.h"
#include "gfxMatrix.h"
#include "gfxRect.h"
#include "gfxImageSurface.h"
#include "gfxPlatform.h"
#include "nsSVGForeignObjectFrame.h"
#include "nsIDOMSVGElement.h"
#include "nsIDOMSVGUnitTypes.h"
#include "nsIFrame.h"
#include "nsINameSpaceManager.h"
#include "nsIPresShell.h"
#include "nsIScriptError.h"
#include "nsISVGChildFrame.h"
#include "nsPresContext.h"
#include "nsRenderingContext.h"
#include "nsStyleCoord.h"
#include "nsStyleStruct.h"
#include "nsSVGClipPathFrame.h"
#include "nsSVGContainerFrame.h"
#include "nsSVGEffects.h"
#include "nsMathUtils.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGFilterFrame.h"
#include "nsSVGFilterPaintCallback.h"
#include "nsSVGForeignObjectFrame.h"
#include "nsSVGGeometryFrame.h"
#include "nsComputedDOMStyle.h"
#include "nsSVGPathGeometryFrame.h"
#include "nsSVGInnerSVGFrame.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGLength2.h"
#include "nsSVGMaskFrame.h"
#include "nsSVGOuterSVGFrame.h"
#include "nsSVGPathGeometryElement.h"
#include "prdtoa.h"
#include "mozilla/dom/Element.h"
#include "gfxUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/gfx/2D.h"
#include "nsSVGPathGeometryFrame.h"
#include "nsSVGSVGElement.h"
#include "nsSVGTextContainerFrame.h"
#include "SVGAnimatedPreserveAspectRatio.h"
using namespace mozilla;
using namespace mozilla::dom;

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

@ -109,10 +109,6 @@ _TEST_FILES = findbar_window.xul \
RegisterUnregisterChrome.js \
test_panel.xul \
window_panel.xul \
$(NULL)
_TEST_FILES += \
test_bug360220.xul \
test_bug365773.xul \
test_bug382990.xul \
@ -122,6 +118,7 @@ _TEST_FILES += \
test_bug554279.xul \
test_bug557987.xul\
test_bug562554.xul \
test_bug585946.xul \
test_button.xul \
test_closemenu_attribute.xul \
test_colorpicker_popup.xul \

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

@ -0,0 +1,51 @@
<?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="Toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="startTest();">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<toolbox>
<toolbarpalette/>
<toolbar id="toolbar" defaultset="node1,node2">
<toolbarbutton id="node1" label="node1" removable="true"/>
<toolbarbutton id="node2" label="node2" removable="true"/>
</toolbar>
</toolbox>
<!-- test resuls are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml"
style="height: 300px; overflow: auto;"/>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
SimpleTest.waitForExplicitFinish();
function startTest() {
var toolbar = $("toolbar");
var splitter = document.createElement("splitter");
splitter.setAttribute("id", "dynsplitter");
splitter.setAttribute("skipintoolbarset", "true");
toolbar.insertBefore(splitter, $("node2"));
function checkPos() {
is($("dynsplitter").previousSibling, $("node1"));
is($("dynsplitter").nextSibling, $("node2"));
}
checkPos();
toolbar.style.MozBinding = "url(chrome://global/content/bindings/toolbar.xml#toolbar-drag)";
toolbar.clientTop; // style flush
checkPos();
SimpleTest.finish();
}
]]></script>
</window>

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

@ -180,6 +180,9 @@
<parameter name="aNode"/>
<body>
<![CDATA[
if (aNode.getAttribute("skipintoolbarset") == "true")
return "";
switch (aNode.localName) {
case "toolbarseparator":
return "separator";
@ -213,6 +216,9 @@
<setter>
<![CDATA[
if (val == this.currentSet)
return;
var ids = (val == "__empty") ? [] : val.split(",");
var nodeidx = 0;

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

@ -53,6 +53,7 @@
#endif
static bool gHasActions = false;
static bool gHasCaps = false;
static void notify_action_cb(NotifyNotification *notification,
gchar *action, gpointer user_data)
@ -344,6 +345,7 @@ nsAlertsIconListener::InitAlertAsync(const nsAString & aImageUrl,
GList *server_caps = notify_get_server_caps();
if (server_caps) {
gHasCaps = true;
for (GList* cap = server_caps; cap != NULL; cap = cap->next) {
if (!strcmp((char*) cap->data, "actions")) {
gHasActions = true;
@ -355,6 +357,12 @@ nsAlertsIconListener::InitAlertAsync(const nsAString & aImageUrl,
}
}
if (!gHasCaps) {
// if notify_get_server_caps() failed above we need to assume
// there is no notification-server to display anything
return NS_ERROR_FAILURE;
}
if (!gHasActions && aAlertTextClickable)
return NS_ERROR_FAILURE; // No good, fallback to XUL