Skip to content

Commit

Permalink
Merge mozilla-central into build-system
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Jan 4, 2013
2 parents 7212a48 + 0c52b64 commit 6f50a40
Show file tree
Hide file tree
Showing 514 changed files with 7,137 additions and 9,736 deletions.
1 change: 1 addition & 0 deletions accessible/src/base/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../xul \
-I$(srcdir)/../../../layout/generic \
-I$(srcdir)/../../../layout/style \
-I$(srcdir)/../../../layout/svg \
-I$(srcdir)/../../../layout/xul/base/src \
$(NULL)

Expand Down
4 changes: 1 addition & 3 deletions accessible/src/base/nsAccUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ class nsAccUtils
static DocAccessible* GetDocAccessibleFor(nsIDocShellTreeItem* aContainer)
{
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aContainer));
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
return GetAccService()->GetDocAccessible(presShell);
return GetAccService()->GetDocAccessible(docShell->GetPresShell());
}

/**
Expand Down
5 changes: 0 additions & 5 deletions accessible/src/base/nsAccessNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ class nsAccessNode : public nsISupports
{
return GetNode() && GetNode()->IsNodeOfType(nsINode::eCONTENT);
}
bool IsElement() const
{
nsINode* node = GetNode();
return node && node->IsElement();
}
bool IsDocumentNode() const
{
return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
Expand Down
17 changes: 12 additions & 5 deletions accessible/src/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "nsLayoutUtils.h"
#include "nsNPAPIPluginInstance.h"
#include "nsObjectFrame.h"
#include "nsSVGPathGeometryFrame.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
Expand Down Expand Up @@ -196,9 +197,7 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
if (treeItem != rootTreeItem) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(rootTreeItem));
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
ps = presShell;
ps = docShell->GetPresShell();
}

return aCanCreate ? GetDocAccessible(ps) : ps->GetDocAccessible();
Expand Down Expand Up @@ -912,8 +911,16 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
}

if (!newAcc) {
if (content->IsSVG(nsGkAtoms::svg)) {
newAcc = new EnumRoleAccessible(content, document, roles::DIAGRAM);
if (content->IsSVG()) {
nsSVGPathGeometryFrame* pathGeometryFrame = do_QueryFrame(frame);
if (pathGeometryFrame) {
// A graphic elements: rect, circle, ellipse, line, path, polygon,
// polyline and image. A 'use' and 'text' graphic elements require
// special support.
newAcc = new EnumRoleAccessible(content, document, roles::GRAPHIC);
} else if (content->Tag() == nsGkAtoms::svg) {
newAcc = new EnumRoleAccessible(content, document, roles::DIAGRAM);
}
} else if (content->IsMathML(nsGkAtoms::math)) {
newAcc = new EnumRoleAccessible(content, document, roles::EQUATION);
}
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/base/nsCoreUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "nsISelectionController.h"
#include "nsPIDOMWindow.h"
#include "nsGUIEvent.h"
#include "nsIView.h"
#include "nsView.h"
#include "nsLayoutUtils.h"
#include "nsGkAtoms.h"

Expand Down
6 changes: 3 additions & 3 deletions accessible/src/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "nsIStringBundle.h"
#include "nsPresContext.h"
#include "nsIFrame.h"
#include "nsIView.h"
#include "nsView.h"
#include "nsIDocShellTreeItem.h"
#include "nsIScrollableFrame.h"
#include "nsFocusManager.h"
Expand Down Expand Up @@ -624,7 +624,7 @@ Accessible::VisibilityState()
nsIFrame* curFrame = frame;
nsPoint framePos(0, 0);
do {
nsIView* view = curFrame->GetView();
nsView* view = curFrame->GetView();
if (view && view->GetVisibility() == nsViewVisibility_kHide)
return states::INVISIBLE;

Expand Down Expand Up @@ -2015,7 +2015,7 @@ Accessible::RelationByType(uint32_t aType)
// above it).
nsIFrame *frame = GetFrame();
if (frame) {
nsIView *view = frame->GetViewExternal();
nsView *view = frame->GetViewExternal();
if (view) {
nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
if (scrollFrame || view->GetWidget() || !frame->GetParent())
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/generic/Accessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct nsRect;
class nsIContent;
class nsIFrame;
class nsIAtom;
class nsIView;
class nsView;

namespace mozilla {
namespace a11y {
Expand Down
39 changes: 21 additions & 18 deletions accessible/src/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ DocAccessible::AttributeWillChange(nsIDocument* aDocument,
// because dependent IDs cache doesn't contain IDs from non accessible
// elements.
if (aModType != nsIDOMMutationEvent::ADDITION)
RemoveDependentIDsFor(accessible, aAttribute);
RemoveDependentIDsFor(aElement, aAttribute);

// Store the ARIA attribute old value so that it can be used after
// attribute change. Note, we assume there's no nested ARIA attribute
Expand Down Expand Up @@ -928,7 +928,7 @@ DocAccessible::AttributeChanged(nsIDocument* aDocument,
// dependent IDs cache when its accessible is created.
if (aModType == nsIDOMMutationEvent::MODIFICATION ||
aModType == nsIDOMMutationEvent::ADDITION) {
AddDependentIDsFor(accessible, aAttribute);
AddDependentIDsFor(aElement, aAttribute);
}
}

Expand Down Expand Up @@ -1312,8 +1312,10 @@ DocAccessible::BindToDocument(Accessible* aAccessible,
mAccessibleCache.Put(aAccessible->UniqueID(), aAccessible);

aAccessible->SetRoleMapEntry(aRoleMapEntry);
if (aAccessible->IsElement())
AddDependentIDsFor(aAccessible);

nsIContent* content = aAccessible->GetContent();
if (content && content->IsElement())
AddDependentIDsFor(content->AsElement());

return true;
}
Expand Down Expand Up @@ -1534,7 +1536,7 @@ DocAccessible::ProcessLoad()
}

void
DocAccessible::AddDependentIDsFor(Accessible* aRelProvider,
DocAccessible::AddDependentIDsFor(dom::Element* aRelProviderElm,
nsIAtom* aRelAttr)
{
for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
Expand All @@ -1543,19 +1545,19 @@ DocAccessible::AddDependentIDsFor(Accessible* aRelProvider,
continue;

if (relAttr == nsGkAtoms::_for) {
if (!aRelProvider->GetContent()->IsHTML() ||
(aRelProvider->GetContent()->Tag() != nsGkAtoms::label &&
aRelProvider->GetContent()->Tag() != nsGkAtoms::output))
if (!aRelProviderElm->IsHTML() ||
(aRelProviderElm->Tag() != nsGkAtoms::label &&
aRelProviderElm->Tag() != nsGkAtoms::output))
continue;

} else if (relAttr == nsGkAtoms::control) {
if (!aRelProvider->GetContent()->IsXUL() ||
(aRelProvider->GetContent()->Tag() != nsGkAtoms::label &&
aRelProvider->GetContent()->Tag() != nsGkAtoms::description))
if (!aRelProviderElm->IsXUL() ||
(aRelProviderElm->Tag() != nsGkAtoms::label &&
aRelProviderElm->Tag() != nsGkAtoms::description))
continue;
}

IDRefsIterator iter(this, aRelProvider->GetContent(), relAttr);
IDRefsIterator iter(this, aRelProviderElm, relAttr);
while (true) {
const nsDependentSubstring id = iter.NextID();
if (id.IsEmpty())
Expand All @@ -1571,7 +1573,7 @@ DocAccessible::AddDependentIDsFor(Accessible* aRelProvider,

if (providers) {
AttrRelProvider* provider =
new AttrRelProvider(relAttr, aRelProvider->GetContent());
new AttrRelProvider(relAttr, aRelProviderElm);
if (provider) {
providers->AppendElement(provider);

Expand All @@ -1595,15 +1597,15 @@ DocAccessible::AddDependentIDsFor(Accessible* aRelProvider,
}

void
DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
DocAccessible::RemoveDependentIDsFor(dom::Element* aRelProviderElm,
nsIAtom* aRelAttr)
{
for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
nsIAtom* relAttr = *kRelationAttrs[idx];
if (aRelAttr && aRelAttr != *kRelationAttrs[idx])
continue;

IDRefsIterator iter(this, aRelProvider->GetContent(), relAttr);
IDRefsIterator iter(this, aRelProviderElm, relAttr);
while (true) {
const nsDependentSubstring id = iter.NextID();
if (id.IsEmpty())
Expand All @@ -1614,7 +1616,7 @@ DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
for (uint32_t jdx = 0; jdx < providers->Length(); ) {
AttrRelProvider* provider = (*providers)[jdx];
if (provider->mRelAttr == relAttr &&
provider->mContent == aRelProvider->GetContent())
provider->mContent == aRelProviderElm)
providers->RemoveElement(provider);
else
jdx++;
Expand Down Expand Up @@ -1914,8 +1916,9 @@ DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
{
aRoot->mStateFlags |= eIsNotInDocument;

if (aRoot->IsElement())
RemoveDependentIDsFor(aRoot);
nsIContent* rootContent = aRoot->GetContent();
if (rootContent && rootContent->IsElement())
RemoveDependentIDsFor(rootContent->AsElement());

uint32_t count = aRoot->ContentChildCount();
for (uint32_t idx = 0; idx < count; idx++)
Expand Down
4 changes: 2 additions & 2 deletions accessible/src/generic/DocAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class DocAccessible : public HyperTextAccessibleWrap,
* @param aRelProvider [in] accessible that element has relation attribute
* @param aRelAttr [in, optional] relation attribute
*/
void AddDependentIDsFor(Accessible* aRelProvider,
void AddDependentIDsFor(dom::Element* aRelProviderElm,
nsIAtom* aRelAttr = nullptr);

/**
Expand All @@ -376,7 +376,7 @@ class DocAccessible : public HyperTextAccessibleWrap,
* @param aRelProvider [in] accessible that element has relation attribute
* @param aRelAttr [in, optional] relation attribute
*/
void RemoveDependentIDsFor(Accessible* aRelProvider,
void RemoveDependentIDsFor(dom::Element* aRelProviderElm,
nsIAtom* aRelAttr = nullptr);

/**
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/mac/RootAccessibleWrap.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
nsIFrame *frame = GetFrame();
if (frame) {
nsIView *view = frame->GetViewExternal();
nsView *view = frame->GetViewExternal();
if (view) {
nsIWidget *widget = view->GetWidget();
if (widget) {
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "nsINodeInfo.h"
#include "nsIServiceManager.h"
#include "nsTextFormatter.h"
#include "nsIView.h"
#include "nsView.h"
#include "nsIViewManager.h"
#include "nsEventMap.h"
#include "nsArrayUtils.h"
Expand Down
1 change: 0 additions & 1 deletion accessible/tests/mochitest/name/test_svg.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg2">
<title>A tooltip</title>
</svg>

</body>
</html>
1 change: 1 addition & 0 deletions accessible/tests/mochitest/role.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const ROLE_COMBOBOX_OPTION = nsIAccessibleRole.ROLE_COMBOBOX_OPTION;
const ROLE_COLUMNHEADER = nsIAccessibleRole.ROLE_COLUMNHEADER;
const ROLE_DEFINITION = nsIAccessibleRole.ROLE_DEFINITION;
const ROLE_DEFINITION_LIST = nsIAccessibleRole.ROLE_DEFINITION_LIST;
const ROLE_DIAGRAM = nsIAccessibleRole.ROLE_DIAGRAM;
const ROLE_DIALOG = nsIAccessibleRole.ROLE_DIALOG;
const ROLE_DOCUMENT = nsIAccessibleRole.ROLE_DOCUMENT;
const ROLE_EMBEDDED_OBJECT = nsIAccessibleRole.ROLE_EMBEDDED_OBJECT;
Expand Down
1 change: 1 addition & 0 deletions accessible/tests/mochitest/role/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MOCHITEST_A11Y_FILES =\
test_aria.html \
test_aria.xul \
test_general.html \
test_svg.html \
$(NULL)

include $(topsrcdir)/config/rules.mk
70 changes: 70 additions & 0 deletions accessible/tests/mochitest/role/test_svg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<title>SVG elements accessible roles</title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />

<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../attributes.js"></script>

<script type="application/javascript">
function doTests()
{
testRole("svg", ROLE_DIAGRAM);
testRole("rect", ROLE_GRAPHIC);
testRole("circle", ROLE_GRAPHIC);
testRole("ellipse", ROLE_GRAPHIC);
testRole("line", ROLE_GRAPHIC);
testRole("polygon", ROLE_GRAPHIC);
testRole("polyline", ROLE_GRAPHIC);
testRole("path", ROLE_GRAPHIC);
testRole("image", ROLE_GRAPHIC);

SimpleTest.finish();
}

SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTests);
</script>
</head>
<body>

<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=822983"
title="Map SVG graphic elements to accessibility API">
Bug 822983
</a>

<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="300" height="100" id="rect"
style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"/>
<circle cx="100" cy="50" r="40" stroke="black" id="circle"
stroke-width="2" fill="red"/>
<ellipse cx="300" cy="80" rx="100" ry="50" id="ellipse"
style="fill:yellow;stroke:purple;stroke-width:2"/>
<line x1="0" y1="0" x2="200" y2="200" id="line"
style="stroke:rgb(255,0,0);stroke-width:2"/>
<polygon points="200,10 250,190 160,210" id="polygon"
style="fill:lime;stroke:purple;stroke-width:1"/>
<polyline points="20,20 40,25 60,40 80,120 120,140 200,180" id="polyline"
style="fill:none;stroke:black;stroke-width:3" />
<path d="M150 0 L75 200 L225 200 Z" id="path"/>
<image x1="25" y1="80" width="50" height="20" id="image"
xlink:href="../moz.png"/>
</svg>

</body>
</html>
6 changes: 5 additions & 1 deletion b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pref("extensions.getAddons.cache.enabled", false);

// Context Menu
pref("ui.click_hold_context_menus", true);
pref("ui.click_hold_context_menus.delay", 1000);
pref("ui.click_hold_context_menus.delay", 750);

// Enable device storage
pref("device.storage.enabled", true);
Expand Down Expand Up @@ -615,3 +615,7 @@ pref("wap.UAProf.tagname", "x-wap-profile");

// Wait up to this much milliseconds when orientation changed
pref("layers.orientation.sync.timeout", 1000);

// Don't discard WebGL contexts for foreground apps on memory
// pressure.
pref("webgl.can-lose-context-in-foreground", false);
4 changes: 2 additions & 2 deletions b2g/config/panda/releng-pandaboard.tt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"size": 676536592,
"digest": "5aa3f1b523faa8996dbcde44a99d846740f80b5361d3109f36688c7bac86979861311c4e7d69b67d9ea1d7c56e20947a30576b3e3f08f7c1e42ec4c2192d92e1",
"size": 676664796,
"digest": "d50e0a916bb54c12f55961b3155c1bb754e46fccd0cc965f6c37c2142a7080e58dc3980b7f7f1249b078a21553d6ae2edfefce18213cf8c8fc3f593db27bb0e6",
"algorithm": "sha512",
"filename": "gonk.tar.xz"
}
Expand Down
Loading

0 comments on commit 6f50a40

Please sign in to comment.