Skip to content

Commit

Permalink
Merge commit '93c2d2c4b4d915be37314b68713f2a596d6e8066' into regress_…
Browse files Browse the repository at this point in the history
…93c2d2c4b4d915be37314b68713f2a596d6e8066

Conflicts:
	content/media/MediaDecoder.cpp
	content/media/moz.build
	embedding/moz.build
	gfx/layers/client/TextureClient.cpp
	layout/base/FrameLayerBuilder.cpp
  • Loading branch information
tmeshkova committed Sep 18, 2014
2 parents 2aa5a2a + 93c2d2c commit 234ceae
Show file tree
Hide file tree
Showing 2,647 changed files with 59,213 additions and 27,553 deletions.
2 changes: 1 addition & 1 deletion accessible/base/AccCollector.h
Expand Up @@ -71,7 +71,7 @@ class AccCollector
* Collect embedded objects. Provide quick access to accessible by index and
* vice versa.
*/
class EmbeddedObjCollector : public AccCollector
class EmbeddedObjCollector MOZ_FINAL : public AccCollector
{
public:
virtual ~EmbeddedObjCollector() { }
Expand Down
4 changes: 2 additions & 2 deletions accessible/base/NotificationController.h
Expand Up @@ -85,8 +85,8 @@ class TNotification : public Notification
/**
* Used to process notifications from core for the document accessible.
*/
class NotificationController : public EventQueue,
public nsARefreshObserver
class NotificationController MOZ_FINAL : public EventQueue,
public nsARefreshObserver
{
public:
NotificationController(DocAccessible* aDocument, nsIPresShell* aPresShell);
Expand Down
10 changes: 5 additions & 5 deletions accessible/base/nsAccessibilityService.h
Expand Up @@ -41,11 +41,11 @@ ApplicationAccessible* ApplicationAcc();
} // namespace a11y
} // namespace mozilla

class nsAccessibilityService : public mozilla::a11y::DocManager,
public mozilla::a11y::FocusManager,
public mozilla::a11y::SelectionManager,
public nsIAccessibilityService,
public nsIObserver
class nsAccessibilityService MOZ_FINAL : public mozilla::a11y::DocManager,
public mozilla::a11y::FocusManager,
public mozilla::a11y::SelectionManager,
public nsIAccessibilityService,
public nsIObserver
{
public:
typedef mozilla::a11y::Accessible Accessible;
Expand Down
2 changes: 1 addition & 1 deletion accessible/generic/Accessible.cpp
Expand Up @@ -1287,7 +1287,7 @@ Accessible::NativeAttributes()
// override properties on a widget they used in an iframe.
nsIContent* startContent = mContent;
while (startContent) {
nsIDocument* doc = startContent->GetDocument();
nsIDocument* doc = startContent->GetComposedDoc();
if (!doc)
break;

Expand Down
18 changes: 16 additions & 2 deletions accessible/generic/DocAccessible.cpp
Expand Up @@ -1309,8 +1309,22 @@ DocAccessible::GetAccessibleOrContainer(nsINode* aNode) const

nsINode* currNode = aNode;
Accessible* accessible = nullptr;
while (!(accessible = GetAccessible(currNode)) &&
(currNode = currNode->GetParentNode()));
while (!(accessible = GetAccessible(currNode))) {
nsINode* parent = nullptr;

// If this is a content node, try to get a flattened parent content node.
// This will smartly skip from the shadow root to the host element,
// over parentless document fragment
if (currNode->IsContent())
parent = currNode->AsContent()->GetFlattenedTreeParent();

// Fallback to just get parent node, in case there is no parent content
// node. Or current node is not a content node.
if (!parent)
parent = currNode->GetParentNode();

if (!(currNode = parent)) break;
}

return accessible;
}
Expand Down
2 changes: 1 addition & 1 deletion accessible/generic/OuterDocAccessible.h
Expand Up @@ -20,7 +20,7 @@ namespace a11y {
* the inner document root.
*/

class OuterDocAccessible : public AccessibleWrap
class OuterDocAccessible MOZ_FINAL : public AccessibleWrap
{
public:
OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
Expand Down
2 changes: 1 addition & 1 deletion accessible/html/HTMLFormControlAccessible.h
Expand Up @@ -109,7 +109,7 @@ class HTMLButtonAccessible : public HyperTextAccessibleWrap
* Accessible for HTML input@type="text", input@type="password", textarea and
* other HTML text controls.
*/
class HTMLTextFieldAccessible : public HyperTextAccessibleWrap
class HTMLTextFieldAccessible MOZ_FINAL : public HyperTextAccessibleWrap
{

public:
Expand Down
4 changes: 2 additions & 2 deletions accessible/html/HTMLImageMapAccessible.h
Expand Up @@ -16,7 +16,7 @@ namespace a11y {
/**
* Used for HTML image maps.
*/
class HTMLImageMapAccessible : public ImageAccessibleWrap
class HTMLImageMapAccessible MOZ_FINAL : public ImageAccessibleWrap
{
public:
HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
Expand Down Expand Up @@ -52,7 +52,7 @@ class HTMLImageMapAccessible : public ImageAccessibleWrap
/**
* Accessible for image map areas - must be child of image.
*/
class HTMLAreaAccessible : public HTMLLinkAccessible
class HTMLAreaAccessible MOZ_FINAL : public HTMLLinkAccessible
{
public:

Expand Down
2 changes: 1 addition & 1 deletion accessible/html/HTMLSelectAccessible.h
Expand Up @@ -163,7 +163,7 @@ class HTMLComboboxListAccessible;
/*
* A class the represents the HTML Combobox widget.
*/
class HTMLComboboxAccessible : public AccessibleWrap
class HTMLComboboxAccessible MOZ_FINAL : public AccessibleWrap
{
public:
enum { eAction_Click = 0 };
Expand Down
7 changes: 6 additions & 1 deletion accessible/jsat/AccessFu.css
Expand Up @@ -9,9 +9,14 @@
display: none;
border-radius: 2px;
box-shadow: 1px 1px 1px #444;
display: none;
}

#virtual-cursor-box.show {
display: block;
}

#virtual-cursor-inset {
#virtual-cursor-box > div {
border-radius: 1px;
box-shadow: inset 1px 1px 1px #444;
display: block;
Expand Down
42 changes: 13 additions & 29 deletions accessible/jsat/AccessFu.jsm
Expand Up @@ -248,7 +248,7 @@ this.AccessFu = { // jshint ignore:line
}

if (this._notifyOutputPref.value) {
Services.obs.notifyObservers(null, 'accessfu-output',
Services.obs.notifyObservers(null, 'accessibility-output',
JSON.stringify(aPresentationData));
}
},
Expand Down Expand Up @@ -394,23 +394,19 @@ this.AccessFu = { // jshint ignore:line
_processedMessageManagers: [],

/**
* Adjusts the given bounds relative to the given browser. Converts from
* screen or device pixels to either device or CSS pixels.
* Adjusts the given bounds relative to the given browser.
* @param {Rect} aJsonBounds the bounds to adjust
* @param {browser} aBrowser the browser we want the bounds relative to
* @param {bool} aToCSSPixels whether to convert to CSS pixels (as opposed to
* device pixels)
* @param {bool} aFromDevicePixels whether to convert from device pixels (as
* opposed to screen pixels)
*/
adjustContentBounds:
function(aJsonBounds, aBrowser, aToCSSPixels, aFromDevicePixels) {
function(aJsonBounds, aBrowser, aToCSSPixels) {
let bounds = new Rect(aJsonBounds.left, aJsonBounds.top,
aJsonBounds.right - aJsonBounds.left,
aJsonBounds.bottom - aJsonBounds.top);
let win = Utils.win;
let dpr = win.devicePixelRatio;
let vp = Utils.getViewport(win);
let offset = { left: -win.mozInnerScreenX, top: -win.mozInnerScreenY };

if (!aBrowser.contentWindow) {
Expand All @@ -421,16 +417,6 @@ this.AccessFu = { // jshint ignore:line
offset.left += clientRect.left + win.mozInnerScreenX;
offset.top += clientRect.top + win.mozInnerScreenY;
}

// Here we scale from screen pixels to layout device pixels by dividing by
// the resolution (caused by pinch-zooming). The resolution is the
// viewport zoom divided by the devicePixelRatio. If there's no viewport,
// then we're on a platform without pinch-zooming and we can just ignore
// this.
if (!aFromDevicePixels && vp) {
bounds = bounds.scale(vp.zoom / dpr, vp.zoom / dpr);
}

// Add the offset; the offset is in CSS pixels, so multiply the
// devicePixelRatio back in before adding to preserve unit consistency.
bounds = bounds.translate(offset.left * dpr, offset.top * dpr);
Expand Down Expand Up @@ -528,7 +514,7 @@ var Output = {
},

B2G: function B2G(aDetails) {
Utils.dispatchChromeEvent('accessfu-output', aDetails);
Utils.dispatchChromeEvent('accessibility-output', aDetails);
},

Visual: function Visual(aDetail, aBrowser) {
Expand All @@ -545,11 +531,10 @@ var Output = {
highlightBox.id = 'virtual-cursor-box';

// Add highlight inset for inner shadow
let inset = Utils.win.document.
createElementNS('http://www.w3.org/1999/xhtml', 'div');
inset.id = 'virtual-cursor-inset';
highlightBox.appendChild(
Utils.win.document.createElementNS(
'http://www.w3.org/1999/xhtml', 'div'));

highlightBox.appendChild(inset);
this.highlightBox = Cu.getWeakReference(highlightBox);
} else {
highlightBox = this.highlightBox.get();
Expand All @@ -559,20 +544,20 @@ var Output = {
let r = AccessFu.adjustContentBounds(aDetail.bounds, aBrowser, true);

// First hide it to avoid flickering when changing the style.
highlightBox.style.display = 'none';
highlightBox.classList.remove('show');
highlightBox.style.top = (r.top - padding) + 'px';
highlightBox.style.left = (r.left - padding) + 'px';
highlightBox.style.width = (r.width + padding*2) + 'px';
highlightBox.style.height = (r.height + padding*2) + 'px';
highlightBox.style.display = 'block';
highlightBox.classList.add('show');

break;
}
case 'tabstate-change':
{
let highlightBox = this.highlightBox ? this.highlightBox.get() : null;
if (highlightBox) {
highlightBox.style.display = 'none';
highlightBox.classList.remove('show');
}
break;
}
Expand Down Expand Up @@ -889,8 +874,7 @@ var Input = {
activateContextMenu: function activateContextMenu(aDetails) {
if (Utils.MozBuildApp === 'mobile/android') {
let p = AccessFu.adjustContentBounds(aDetails.bounds,
Utils.CurrentBrowser,
true, true).center();
Utils.CurrentBrowser, true).center();
Services.obs.notifyObservers(null, 'Gesture:LongPress',
JSON.stringify({x: p.x, y: p.y}));
}
Expand All @@ -915,8 +899,8 @@ var Input = {
doScroll: function doScroll(aDetails) {
let horizontal = aDetails.horizontal;
let page = aDetails.page;
let p = AccessFu.adjustContentBounds(aDetails.bounds, Utils.CurrentBrowser,
true, true).center();
let p = AccessFu.adjustContentBounds(
aDetails.bounds, Utils.CurrentBrowser, true).center();
Utils.winUtils.sendWheelEvent(p.x, p.y,
horizontal ? page : 0, horizontal ? 0 : page, 0,
Utils.win.WheelEvent.DOM_DELTA_PAGE, 0, 0, 0, 0);
Expand Down
48 changes: 29 additions & 19 deletions accessible/jsat/Utils.jsm
Expand Up @@ -255,15 +255,6 @@ this.Utils = { // jshint ignore:line
}
},

getViewport: function getViewport(aWindow) {
switch (this.MozBuildApp) {
case 'mobile/android':
return aWindow.BrowserApp.selectedTab.getViewport();
default:
return null;
}
},

getState: function getState(aAccessibleOrEvent) {
if (aAccessibleOrEvent instanceof Ci.nsIAccessibleStateChangeEvent) {
return new State(
Expand Down Expand Up @@ -302,18 +293,37 @@ this.Utils = { // jshint ignore:line
return doc.QueryInterface(Ci.nsIAccessibleDocument).virtualCursor;
},

getBounds: function getBounds(aAccessible) {
let objX = {}, objY = {}, objW = {}, objH = {};
aAccessible.getBounds(objX, objY, objW, objH);
return new Rect(objX.value, objY.value, objW.value, objH.value);
getContentResolution: function _getContentResolution(aAccessible) {
let resX = { value: 1 }, resY = { value: 1 };
aAccessible.document.window.QueryInterface(
Ci.nsIInterfaceRequestor).getInterface(
Ci.nsIDOMWindowUtils).getResolution(resX, resY);
return [resX.value, resY.value];
},

getTextBounds: function getTextBounds(aAccessible, aStart, aEnd) {
let accText = aAccessible.QueryInterface(Ci.nsIAccessibleText);
let objX = {}, objY = {}, objW = {}, objH = {};
accText.getRangeExtents(aStart, aEnd, objX, objY, objW, objH,
Ci.nsIAccessibleCoordinateType.COORDTYPE_SCREEN_RELATIVE);
return new Rect(objX.value, objY.value, objW.value, objH.value);
getBounds: function getBounds(aAccessible, aPreserveContentScale) {
let objX = {}, objY = {}, objW = {}, objH = {};
aAccessible.getBounds(objX, objY, objW, objH);

let [scaleX, scaleY] = aPreserveContentScale ? [1, 1] :
this.getContentResolution(aAccessible);

return new Rect(objX.value, objY.value, objW.value, objH.value).scale(
scaleX, scaleY);
},

getTextBounds: function getTextBounds(aAccessible, aStart, aEnd,
aPreserveContentScale) {
let accText = aAccessible.QueryInterface(Ci.nsIAccessibleText);
let objX = {}, objY = {}, objW = {}, objH = {};
accText.getRangeExtents(aStart, aEnd, objX, objY, objW, objH,
Ci.nsIAccessibleCoordinateType.COORDTYPE_SCREEN_RELATIVE);

let [scaleX, scaleY] = aPreserveContentScale ? [1, 1] :
this.getContentResolution(aAccessible);

return new Rect(objX.value, objY.value, objW.value, objH.value).scale(
scaleX, scaleY);
},

/**
Expand Down
18 changes: 5 additions & 13 deletions accessible/jsat/content-script.js
Expand Up @@ -65,14 +65,10 @@ function forwardToChild(aMessage, aListener, aVCPosition) {
}

function activateContextMenu(aMessage) {
function sendContextMenuCoordinates(aAccessible) {
let bounds = Utils.getBounds(aAccessible);
sendAsyncMessage('AccessFu:ActivateContextMenu', {bounds: bounds});
}

let position = Utils.getVirtualCursor(content.document).position;
if (!forwardToChild(aMessage, activateContextMenu, position)) {
sendContextMenuCoordinates(position);
sendAsyncMessage('AccessFu:ActivateContextMenu',
{ bounds: Utils.getBounds(position, true) });
}
}

Expand All @@ -85,16 +81,12 @@ function presentCaretChange(aText, aOldOffset, aNewOffset) {
}

function scroll(aMessage) {
function sendScrollCoordinates(aAccessible) {
let bounds = Utils.getBounds(aAccessible);
let position = Utils.getVirtualCursor(content.document).position;
if (!forwardToChild(aMessage, scroll, position)) {
sendAsyncMessage('AccessFu:DoScroll',
{ bounds: bounds,
{ bounds: Utils.getBounds(position, true),
page: aMessage.json.page,
horizontal: aMessage.json.horizontal });
}

let position = Utils.getVirtualCursor(content.document).position;
if (!forwardToChild(aMessage, scroll, position)) {
sendScrollCoordinates(position);
}
}
Expand Down
2 changes: 1 addition & 1 deletion accessible/tests/mochitest/actions/test_general.xul
Expand Up @@ -24,7 +24,7 @@
if (navigator.platform.startsWith("Mac")) {
SimpleTest.expectAssertions(0, 1);
} else {
SimpleTest.expectAssertions(1);
SimpleTest.expectAssertions(0, 1);
}
function doTest()
Expand Down
6 changes: 3 additions & 3 deletions accessible/tests/mochitest/jsat/jsatcommon.js
Expand Up @@ -81,7 +81,7 @@ var AccessFuTest = {
isDeeply(data.details, aWaitForData, "Data is correct");
aListener.apply(listener);
};
Services.obs.addObserver(listener, 'accessfu-output', false);
Services.obs.addObserver(listener, 'accessibility-output', false);
return listener;
},

Expand All @@ -90,12 +90,12 @@ var AccessFuTest = {
},

off: function AccessFuTest_off(aListener) {
Services.obs.removeObserver(aListener, 'accessfu-output');
Services.obs.removeObserver(aListener, 'accessibility-output');
},

once: function AccessFuTest_once(aWaitForData, aListener) {
return this._addObserver(aWaitForData, function observerAndRemove() {
Services.obs.removeObserver(this, 'accessfu-output');
Services.obs.removeObserver(this, 'accessibility-output');
aListener();
});
},
Expand Down
2 changes: 1 addition & 1 deletion accessible/xul/XULFormControlAccessible.h
Expand Up @@ -110,7 +110,7 @@ class XULDropmarkerAccessible : public LeafAccessible
/**
* Used for XUL groupbox element.
*/
class XULGroupboxAccessible : public AccessibleWrap
class XULGroupboxAccessible MOZ_FINAL : public AccessibleWrap
{
public:
XULGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
Expand Down

0 comments on commit 234ceae

Please sign in to comment.