Permalink
Browse files

Merge mozilla-central into build-system

--HG--
rename : content/html/content/public/nsHTMLCanvasElement.h => content/html/content/public/HTMLCanvasElement.h
rename : content/html/content/src/nsHTMLCanvasElement.cpp => content/html/content/src/HTMLCanvasElement.cpp
  • Loading branch information...
Ms2ger committed Jan 6, 2013
2 parents f4c101b + d16c389 commit fd3a319badc55b51b4d4bbdf1bf02eb499859f37
Showing 585 changed files with 19,271 additions and 9,224 deletions.
@@ -35,7 +35,7 @@
#include "nsINameSpaceManager.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
-#include "nsIViewManager.h"
+#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
#include "nsUnicharUtils.h"
#include "nsIURI.h"
@@ -1253,7 +1253,7 @@ DocAccessible::GetNativeWindow() const
if (!mPresShell)
return nullptr;
- nsIViewManager* vm = mPresShell->GetViewManager();
+ nsViewManager* vm = mPresShell->GetViewManager();
if (!vm)
return nullptr;
@@ -529,22 +529,32 @@ HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
} else {
// findNode could be null if aNodeOffset == # of child nodes, which means
// one of two things:
- // 1) we're at the end of the children, keep findNode = null, so that we get
- // the last possible offset
- // 2) there are no children and the passed-in node is mContent, which means
- // we're an aempty nsIAccessibleText
- // 3) there are no children, and the passed-in node is not mContent -- use
+ // 1) there are no children, and the passed-in node is not mContent -- use
// parentContent for the node to find
+ // 2) there are no children and the passed-in node is mContent, which means
+ // we're an empty nsIAccessibleText
+ // 3) there are children and we're at the end of the children
findNode = aNode->GetChildAt(aNodeOffset);
- if (!findNode && !aNodeOffset) {
- if (aNode == GetNode()) {
- // There are no children, which means this is an empty nsIAccessibleText, in which
- // case we can only be at hypertext offset 0
- *aHyperTextOffset = 0;
- return nullptr;
+ if (!findNode) {
+ if (aNodeOffset == 0) {
+ if (aNode == GetNode()) {
+ // Case #1: this accessible has no children and thus has empty text,
+ // we can only be at hypertext offset 0.
+ *aHyperTextOffset = 0;
+ return nullptr;
+ }
+
+ // Case #2: there are no children, we're at this node.
+ findNode = aNode;
+ } else if (aNodeOffset == aNode->GetChildCount()) {
+ // Case #3: we're after the last child, get next node to this one.
+ for (nsINode* tmpNode = aNode;
+ !findNode && tmpNode && tmpNode != mContent;
+ tmpNode = tmpNode->GetParent()) {
+ findNode = tmpNode->GetNextSibling();
+ }
}
- findNode = aNode; // Case #2: there are no children
}
}
@@ -28,7 +28,7 @@
#include "nsIDOMHTMLTableCellElement.h"
#include "nsIDOMHTMLTableElement.h"
#include "nsIDOMHTMLTableRowElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
+#include "nsIDOMHTMLTableSectionElement.h"
#include "nsIDocument.h"
#include "nsIMutableArray.h"
#include "nsIPresShell.h"
@@ -10,7 +10,7 @@
#include "nsCOMPtr.h"
#include "nsObjCExceptions.h"
#include "nsIWidget.h"
-#include "nsIViewManager.h"
+#include "nsViewManager.h"
using namespace mozilla::a11y;
@@ -34,7 +34,7 @@
#include "nsIServiceManager.h"
#include "nsTextFormatter.h"
#include "nsView.h"
-#include "nsIViewManager.h"
+#include "nsViewManager.h"
#include "nsEventMap.h"
#include "nsArrayUtils.h"
#include "mozilla/Preferences.h"
@@ -1653,7 +1653,7 @@ AccessibleWrap::GetHWNDFor(Accessible* aAccessible)
nsIWidget* widget = frame->GetNearestWidget();
if (widget && widget->IsVisible()) {
nsIPresShell* shell = document->PresShell();
- nsIViewManager* vm = shell->GetViewManager();
+ nsViewManager* vm = shell->GetViewManager();
if (vm) {
nsCOMPtr<nsIWidget> rootWidget;
vm->GetRootWidget(getter_AddRefs(rootWidget));
@@ -21,7 +21,7 @@
#include "nsISelectionController.h"
#include "nsIServiceManager.h"
#include "nsIURI.h"
-#include "nsIViewManager.h"
+#include "nsViewManager.h"
#include "nsIWebNavigation.h"
using namespace mozilla;
@@ -1266,6 +1266,38 @@ function synthSelectAll(aNodeOrID, aCheckerOrEventSeq)
}
}
+/**
+ * Move the caret in text accessible.
+ */
+function moveCaretToDOMPoint(aID, aNode, aOffset, aExpectedOffset,
+ aFocusTargetID)
+{
+ this.target = getAccessible(aID, [nsIAccessibleText]);
+ this.focus = aFocusTargetID ? getAccessible(aFocusTargetID) : null;
+ this.focusNode = this.focus ? this.focus.DOMNode : null;
+
+ this.invoke = function moveCaretToDOMPoint_invoke()
+ {
+ if (this.focusNode)
+ this.focusNode.focus();
+
+ window.getSelection().getRangeAt(0).setStart(aNode, aOffset);
+ }
+
+ this.getID = function moveCaretToDOMPoint_getID()
+ {
+ return "Set caret on " + prettyName(aID) + " at point: " +
+ prettyName(aNode) + " node with offset " + aOffset;
+ }
+
+ this.eventSeq = [
+ new caretMoveChecker(aExpectedOffset, this.target)
+ ];
+
+ if (this.focus)
+ this.eventSeq.push(new asyncInvokerChecker(EVENT_FOCUS, this.focus));
+}
+
/**
* Set caret offset in text accessible.
*/
@@ -77,6 +77,18 @@
id = "p";
gQueue.push(new synthTab(id, new caretMoveChecker(0, id)));
+ // Set caret after a child of span element, i.e. after 'text' text.
+ gQueue.push(new moveCaretToDOMPoint("test1", getNode("test1_span"), 1,
+ 4, "test1"));
+ gQueue.push(new moveCaretToDOMPoint("test2", getNode("test2_span"), 1,
+ 4, "test2"));
+
+ // empty text element
+ gQueue.push(new moveCaretToDOMPoint("test3", getNode("test3"), 0,
+ 0, "test3"));
+ gQueue.push(new moveCaretToDOMPoint("test4", getNode("test4_span"), 0,
+ 0, "test4"));
+
gQueue.invoke(); // Will call SimpleTest.finish();
}
@@ -90,7 +102,12 @@
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=454377"
title="Accessible caret move events testing">
- Mozilla Bug 454377
+ Bug 454377
+ </a>
+ <a target="_blank"
+ href="https://bugzilla.mozilla.org/show_bug.cgi?id=824901"
+ title="HyperTextAccessible::DOMPointToHypertextOffset fails for node and offset equal to node child count">
+ Bug 824901
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
@@ -102,6 +119,11 @@
<p id="p" contentEditable="true"><span>text</span><br/>text</p>
<div id="div" contentEditable="true"><p id="p1_in_div">text</p><p id="p2_in_div">text</p></div>
+ <p contentEditable="true" id="test1"><span id="test1_span">text</span>ohoho</p>
+ <p contentEditable="true" id="test2"><span><span id="test2_span">text</span></span>ohoho</p>
+ <p contentEditable="true" id="test3"></p>
+ <p contentEditable="true" id="test4"><span id="test4_span"></span></p>
+
<div id="eventdump"></div>
</body>
</html>
View
@@ -283,10 +283,14 @@ pref("content.image.allow_locking", true);
pref("image.mem.min_discard_timeout_ms", 10000);
pref("image.mem.max_decoded_image_kb", 5120); /* 5MB */
+// XXX this isn't a good check for "are touch events supported", but
+// we don't really have a better one at the moment.
+#ifdef MOZ_WIDGET_GONK
// enable touch events interfaces
pref("dom.w3c_touch_events.enabled", 1);
pref("dom.w3c_touch_events.safetyX", 0); // escape borders in units of 1/240"
pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240"
+#endif
#ifdef MOZ_SAFE_BROWSING
// Safe browsing does nothing unless this pref is set
@@ -544,6 +548,8 @@ pref("hal.processPriorityManager.gonk.masterOomScoreAdjust", 0);
pref("hal.processPriorityManager.gonk.masterKillUnderMB", 1);
pref("hal.processPriorityManager.gonk.foregroundOomScoreAdjust", 67);
pref("hal.processPriorityManager.gonk.foregroundKillUnderMB", 4);
+pref("hal.processPriorityManager.gonk.backgroundPerceivableOomScoreAdjust", 134);
+pref("hal.processPriorityManager.gonk.backgroundPerceivebleKillUnderMB", 5);
pref("hal.processPriorityManager.gonk.backgroundHomescreenOomScoreAdjust", 200);
pref("hal.processPriorityManager.gonk.backgroundHomescreenKillUnderMB", 5);
pref("hal.processPriorityManager.gonk.backgroundOomScoreAdjust", 400);
View
@@ -18,8 +18,6 @@ ifdef MOZ_EXTENSIONS
tier_app_dirs += extensions
endif
-tier_app_dirs += services
-
tier_app_dirs += \
$(MOZ_BRANDING_DIRECTORY) \
b2g \
Oops, something went wrong.

0 comments on commit fd3a319

Please sign in to comment.