Skip to content

Commit

Permalink
Merge commit '163ee6130a239b893f1e0a75de5c8cfccfdf9ef0' into embedlit…
Browse files Browse the repository at this point in the history
…e_upgrade

Conflicts:
	gfx/gl/GLContextProviderEGL.cpp
	layout/ipc/RenderFrameParent.cpp
  • Loading branch information
tmeshkova committed Jan 23, 2014
2 parents b762b8d + 163ee61 commit 765175f
Show file tree
Hide file tree
Showing 1,266 changed files with 25,806 additions and 28,335 deletions.
2 changes: 2 additions & 0 deletions .clang-format-ignore
@@ -0,0 +1,2 @@
\mfbt/
\js/
11 changes: 6 additions & 5 deletions .lldbinit
Expand Up @@ -5,6 +5,12 @@
# and in the accompanying Python scripts, see python/lldbutils/README.txt.
# -----------------------------------------------------------------------------

# Import the module that defines complex Gecko debugging commands. This assumes
# you are either running lldb from the top level source directory, the objdir,
# or the dist/bin directory. (.lldbinit files in the objdir and dist/bin set
# topsrcdir appropriately.)
script topsrcdir = topsrcdir if locals().has_key("topsrcdir") else "."; sys.path.append(os.path.join(topsrcdir, "python/lldbutils")); import lldbutils; lldbutils.init()

# Mozilla's use of UNIFIED_SOURCES to include multiple source files into a
# single compiled file breaks lldb breakpoint setting. This works around that.
# See http://lldb.llvm.org/troubleshooting.html for more info.
Expand All @@ -15,11 +21,6 @@ settings set target.inline-breakpoint-strategy always
# object as being of type "nsBlockFrame *" rather than "nsIFrame *".
settings set target.prefer-dynamic-value run-target

# Import the module that defines complex Gecko debugging commands. Rather
# than do any kind of searching, this assumes that you are running lldb from
# the top level source directory.
script sys.path.append('python/lldbutils'); import lldbutils; lldbutils.init()

# Show the string value in atoms.
type summary add nsIAtom --summary-string "${var.mString}"

Expand Down
2 changes: 1 addition & 1 deletion CLOBBER
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Updates to NSS seem to require a clobber due bug 959928.
JS build system changes are apparently requiring clobbers.
1 change: 1 addition & 0 deletions README.txt
Expand Up @@ -25,3 +25,4 @@ testing, may be buggy. Firefox nightlies, for example, can be found at:
ftp://ftp.mozilla.org/pub/firefox/nightly/latest-trunk/
- or -
http://nightly.mozilla.org/

14 changes: 5 additions & 9 deletions accessible/src/base/nsCoreUtils.cpp
Expand Up @@ -10,7 +10,6 @@
#include "nsIBaseWindow.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIDOMHTMLElement.h"
#include "nsRange.h"
Expand All @@ -34,6 +33,7 @@

#include "nsITreeBoxObject.h"
#include "nsITreeColumns.h"
#include "mozilla/dom/Element.h"

using namespace mozilla;

Expand Down Expand Up @@ -216,18 +216,16 @@ nsCoreUtils::GetRoleContent(nsINode *aNode)
{
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
if (!content) {
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(aNode));
if (domDoc) {
nsCOMPtr<nsIDocument> doc(do_QueryInterface(aNode));
if (doc) {
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc(do_QueryInterface(aNode));
if (htmlDoc) {
nsCOMPtr<nsIDOMHTMLElement> bodyElement;
htmlDoc->GetBody(getter_AddRefs(bodyElement));
content = do_QueryInterface(bodyElement);
}
else {
nsCOMPtr<nsIDOMElement> docElement;
domDoc->GetDocumentElement(getter_AddRefs(docElement));
content = do_QueryInterface(docElement);
return doc->GetDocumentElement();
}
}
}
Expand Down Expand Up @@ -416,9 +414,7 @@ nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");

int32_t contentType;
docShellTreeItem->GetItemType(&contentType);
return (contentType == nsIDocShellTreeItem::typeContent);
return (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent);
}

bool
Expand Down
39 changes: 19 additions & 20 deletions accessible/src/generic/Accessible.cpp
Expand Up @@ -29,7 +29,6 @@
#include "TreeWalker.h"

#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsIDOMNodeFilter.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMKeyEvent.h"
Expand Down Expand Up @@ -83,6 +82,7 @@
#include "mozilla/unused.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TreeWalker.h"

using namespace mozilla;
using namespace mozilla::a11y;
Expand Down Expand Up @@ -383,9 +383,8 @@ Accessible::AccessKey() const
return KeyBinding();

nsresult rv = NS_ERROR_FAILURE;
int32_t itemType = 0, modifierMask = 0;
treeItem->GetItemType(&itemType);
switch (itemType) {
int32_t modifierMask = 0;
switch (treeItem->ItemType()) {
case nsIDocShellTreeItem::typeChrome:
rv = Preferences::GetInt("ui.key.chromeAccess", &modifierMask);
break;
Expand Down Expand Up @@ -2120,10 +2119,9 @@ Accessible::RelationByType(RelationType aType)
// If the item type is typeContent, we assume we are in browser tab
// content. Note, this includes content such as about:addons,
// for consistency.
int32_t itemType = 0;
root->GetItemType(&itemType);
if (itemType == nsIDocShellTreeItem::typeContent)
if (root->ItemType() == nsIDocShellTreeItem::typeContent) {
return Relation(nsAccUtils::GetDocAccessibleFor(root));
}
}
}
return Relation();
Expand Down Expand Up @@ -3076,25 +3074,26 @@ Accessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
if (accessible)
return accessible;

nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->OwnerDoc());
NS_ENSURE_TRUE(domDoc, nullptr);
nsCOMPtr<nsIDocument> doc = aStartNode->OwnerDoc();

nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
nsCOMPtr<nsIDOMTreeWalker> walker;
domDoc->CreateTreeWalker(rootNode,
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
nullptr, 1, getter_AddRefs(walker));
nsCOMPtr<nsINode> currentNode = aStartNode;
ErrorResult rv;
nsRefPtr<dom::TreeWalker> walker =
doc->CreateTreeWalker(*GetNode(),
nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
nullptr, rv);
NS_ENSURE_TRUE(walker, nullptr);

walker->SetCurrentNode(currentNode);
walker->SetCurrentNode(*currentNode, rv);
if (rv.Failed())
return nullptr;

while (true) {
walker->NextNode(getter_AddRefs(currentNode));
if (!currentNode)
currentNode = walker->NextNode(rv);
if (!currentNode || rv.Failed())
return nullptr;

nsCOMPtr<nsINode> node(do_QueryInterface(currentNode));
Accessible* accessible = mDoc->GetAccessible(node);
Accessible* accessible = mDoc->GetAccessible(currentNode);
if (accessible)
return accessible;
}
Expand Down
40 changes: 17 additions & 23 deletions accessible/src/generic/DocAccessible.cpp
Expand Up @@ -22,7 +22,6 @@
#include "nsIDOMAttr.h"
#include "nsIDOMCharacterData.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsPIDOMWindow.h"
Expand All @@ -42,6 +41,7 @@
#include "nsIWebNavigation.h"
#include "nsFocusManager.h"
#include "mozilla/Assertions.h"
#include "mozilla/dom/DocumentType.h"
#include "mozilla/dom/Element.h"

#ifdef MOZ_XUL
Expand Down Expand Up @@ -189,8 +189,7 @@ DocAccessible::NativeRole()
if (docShell) {
nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
int32_t itemType;
docShell->GetItemType(&itemType);
int32_t itemType = docShell->ItemType();
if (sameTypeRoot == docShell) {
// Root of content or chrome tree
if (itemType == nsIDocShellTreeItem::typeChrome)
Expand Down Expand Up @@ -353,38 +352,39 @@ DocAccessible::GetURL(nsAString& aURL)
NS_IMETHODIMP
DocAccessible::GetTitle(nsAString& aTitle)
{
nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocumentNode);
if (!domDocument) {
if (!mDocumentNode) {
return NS_ERROR_FAILURE;
}
return domDocument->GetTitle(aTitle);
nsString title;
mDocumentNode->GetTitle(title);
aTitle = title;
return NS_OK;
}

NS_IMETHODIMP
DocAccessible::GetMimeType(nsAString& aMimeType)
{
nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocumentNode);
if (!domDocument) {
if (!mDocumentNode) {
return NS_ERROR_FAILURE;
}
return domDocument->GetContentType(aMimeType);
return mDocumentNode->GetContentType(aMimeType);
}

NS_IMETHODIMP
DocAccessible::GetDocType(nsAString& aDocType)
{
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mDocumentNode));
nsCOMPtr<nsIDOMDocumentType> docType;

#ifdef MOZ_XUL
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocumentNode));
if (xulDoc) {
aDocType.AssignLiteral("window"); // doctype not implemented for XUL at time of writing - causes assertion
return NS_OK;
} else
#endif
if (domDoc && NS_SUCCEEDED(domDoc->GetDoctype(getter_AddRefs(docType))) && docType) {
return docType->GetPublicId(aDocType);
if (mDocumentNode) {
dom::DocumentType* docType = mDocumentNode->GetDoctype();
if (docType) {
return docType->GetPublicId(aDocType);
}
}

return NS_ERROR_FAILURE;
Expand Down Expand Up @@ -692,9 +692,7 @@ DocAccessible::AddEventListeners()

// We want to add a command observer only if the document is content and has
// an editor.
int32_t itemType;
docShellTreeItem->GetItemType(&itemType);
if (itemType == nsIDocShellTreeItem::typeContent) {
if (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent) {
nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
if (commandManager)
commandManager->AddCommandObserver(this, "obs_documentCreated");
Expand Down Expand Up @@ -724,9 +722,7 @@ DocAccessible::RemoveEventListeners()
NS_ASSERTION(docShellTreeItem, "doc should support nsIDocShellTreeItem.");

if (docShellTreeItem) {
int32_t itemType;
docShellTreeItem->GetItemType(&itemType);
if (itemType == nsIDocShellTreeItem::typeContent) {
if (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent) {
nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
if (commandManager) {
commandManager->RemoveCommandObserver(this, "obs_documentCreated");
Expand Down Expand Up @@ -2028,9 +2024,7 @@ DocAccessible::IsLoadEventTarget() const
}

// It's content (not chrome) root document.
int32_t contentType;
treeItem->GetItemType(&contentType);
return (contentType == nsIDocShellTreeItem::typeContent);
return (treeItem->ItemType() == nsIDocShellTreeItem::typeContent);
}

PLDHashOperator
Expand Down
4 changes: 1 addition & 3 deletions accessible/src/generic/RootAccessible.cpp
Expand Up @@ -84,9 +84,7 @@ RootAccessible::Name(nsString& aName)
return eNameOK;
}

nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(mDocumentNode);
NS_ENSURE_TRUE(document, eNameOK);
document->GetTitle(aName);
mDocumentNode->GetTitle(aName);
return eNameOK;
}

Expand Down
1 change: 0 additions & 1 deletion accessible/src/html/HTMLTableAccessible.cpp
Expand Up @@ -20,7 +20,6 @@

#include "mozilla/dom/HTMLTableElement.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsIDOMRange.h"
#include "nsISelectionPrivate.h"
#include "nsINameSpaceManager.h"
Expand Down
41 changes: 27 additions & 14 deletions accessible/src/jsat/OutputGenerator.jsm
Expand Up @@ -678,6 +678,32 @@ this.BrailleGenerator = {
let output = OutputGenerator.genForContext.apply(this, arguments);

let acc = aContext.accessible;

// add the static text indicating a list item; do this for both listitems or
// direct first children of listitems, because these are both common browsing
// scenarios
let addListitemIndicator = function addListitemIndicator(indicator = '*') {
output.output.unshift(indicator);
};

if (acc.indexInParent === 1 &&
acc.parent.role == Roles.LISTITEM &&
acc.previousSibling.role == Roles.STATICTEXT) {
if (acc.parent.parent && acc.parent.parent.DOMNode &&
acc.parent.parent.DOMNode.nodeName == 'UL') {
addListitemIndicator();
} else {
addListitemIndicator(acc.previousSibling.name.trim());
}
} else if (acc.role == Roles.LISTITEM && acc.firstChild &&
acc.firstChild.role == Roles.STATICTEXT) {
if (acc.parent.DOMNode.nodeName == 'UL') {
addListitemIndicator();
} else {
addListitemIndicator(acc.firstChild.name.trim());
}
}

if (acc instanceof Ci.nsIAccessibleText) {
output.endOffset = this.outputOrder === OUTPUT_DESC_FIRST ?
output.output.join(' ').length : acc.characterCount;
Expand All @@ -692,20 +718,7 @@ this.BrailleGenerator = {
__proto__: OutputGenerator.objectOutputFunctions,

defaultFunc: function defaultFunc(aAccessible, aRoleStr, aStates, aFlags) {
let braille = this.objectOutputFunctions._generateBaseOutput.apply(this, arguments);

if (aAccessible.indexInParent === 1 &&
aAccessible.parent.role == Roles.LISTITEM &&
aAccessible.previousSibling.role == Roles.STATICTEXT) {
if (aAccessible.parent.parent && aAccessible.parent.parent.DOMNode &&
aAccessible.parent.parent.DOMNode.nodeName == 'UL') {
braille.unshift('*');
} else {
braille.unshift(aAccessible.previousSibling.name);
}
}

return braille;
return this.objectOutputFunctions._generateBaseOutput.apply(this, arguments);
},

listitem: function listitem(aAccessible, aRoleStr, aStates, aFlags) {
Expand Down
22 changes: 4 additions & 18 deletions accessible/src/jsat/TouchAdapter.jsm
Expand Up @@ -334,8 +334,8 @@ this.TouchAdapter = {
* of one single touch.
*/
function TouchPoint(aTouch, aTime, aDPI) {
this.startX = this.x = aTouch.screenX * this.scaleFactor;
this.startY = this.y = aTouch.screenY * this.scaleFactor;
this.startX = this.x = aTouch.screenX;
this.startY = this.y = aTouch.screenY;
this.startTime = aTime;
this.distanceTraveled = 0;
this.dpi = aDPI;
Expand All @@ -346,8 +346,8 @@ TouchPoint.prototype = {
update: function TouchPoint_update(aTouch, aTime) {
let lastX = this.x;
let lastY = this.y;
this.x = aTouch.screenX * this.scaleFactor;
this.y = aTouch.screenY * this.scaleFactor;
this.x = aTouch.screenX;
this.y = aTouch.screenY;
this.time = aTime;

this.distanceTraveled += this.getDistanceToCoord(lastX, lastY);
Expand All @@ -357,20 +357,6 @@ TouchPoint.prototype = {
return Math.sqrt(Math.pow(this.x - aX, 2) + Math.pow(this.y - aY, 2));
},

get scaleFactor() {
if (!this._scaleFactor) {
// Android events come with the x, y coordinates affected by the widget
// scaling; we restore it to normal here.
if (Utils.MozBuildApp == 'mobile/android') {
this._scaleFactor = Utils.win.devicePixelRatio;
} else {
this._scaleFactor = 1;
}
}

return this._scaleFactor;
},

finish: function TouchPoint_finish() {
this.done = true;
},
Expand Down

0 comments on commit 765175f

Please sign in to comment.