Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Merge mozilla-central to fx-team
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed May 4, 2016
2 parents 4ae1cff + 3354786 commit f0e04c7
Show file tree
Hide file tree
Showing 284 changed files with 22,244 additions and 3,396 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ obj*/**
# We ignore all these directories by default, until we get them enabled.
# If you are enabling a directory, please add directory specific exclusions
# below.
accessible/**
addon-sdk/**
build/**
caps/**
Expand Down
15 changes: 15 additions & 0 deletions accessible/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": [
"../.eslintrc"
],
"globals": {
"Cc": true,
"Ci": true,
"Components": true,
"console": true,
"Cu": true,
"dump": true,
"Services": true,
"XPCOMUtils": true
}
}
97 changes: 60 additions & 37 deletions accessible/base/TextAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
return; // XXX: we don't support text attrs on document with no body

nsIFrame* rootFrame = mHyperTextAcc->GetFrame();
NS_ASSERTION(rootFrame, "No frame for accessible!");
MOZ_ASSERT(rootFrame, "No frame for accessible!");
if (!rootFrame)
return;

Expand All @@ -87,9 +87,10 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
if (mOffsetAcc) {
offsetNode = mOffsetAcc->GetContent();
offsetElm = nsCoreUtils::GetDOMElementFor(offsetNode);
NS_ASSERTION(offsetElm, "No element for offset accessible!");
MOZ_ASSERT(offsetElm, "No element for offset accessible!");
if (!offsetElm)
return;

frame = offsetElm->GetPrimaryFrame();
}

Expand Down Expand Up @@ -165,6 +166,9 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
if (!currAcc->IsText())
break;

MOZ_ASSERT(nsCoreUtils::GetDOMElementFor(currAcc->GetContent()),
"Text accessible has to have an associated DOM element");

bool offsetFound = false;
for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
TextAttr* textAttr = aAttrArray[attrIdx];
Expand All @@ -187,6 +191,9 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
if (!currAcc->IsText())
break;

MOZ_ASSERT(nsCoreUtils::GetDOMElementFor(currAcc->GetContent()),
"Text accessible has to have an associated DOM element");

bool offsetFound = false;
for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
TextAttr* textAttr = aAttrArray[attrIdx];
Expand Down Expand Up @@ -344,8 +351,13 @@ TextAttrsMgr::BGColorTextAttr::
GetValueFor(Accessible* aAccessible, nscolor* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
return frame ? GetColor(frame, aValue) : false;
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
return GetColor(frame, aValue);
}
}
return false;
}

void
Expand Down Expand Up @@ -407,12 +419,13 @@ TextAttrsMgr::ColorTextAttr::
GetValueFor(Accessible* aAccessible, nscolor* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = frame->StyleColor()->mColor;
return true;
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = frame->StyleColor()->mColor;
return true;
}
}

return false;
}

Expand Down Expand Up @@ -445,8 +458,13 @@ TextAttrsMgr::FontFamilyTextAttr::
GetValueFor(Accessible* aAccessible, nsString* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
return frame ? GetFontFamily(frame, *aValue) : false;
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
return GetFontFamily(frame, *aValue);
}
}
return false;
}

void
Expand Down Expand Up @@ -494,13 +512,14 @@ bool
TextAttrsMgr::FontSizeTextAttr::
GetValueFor(Accessible* aAccessible, nscoord* aValue)
{
nsIContent* content = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = content->GetPrimaryFrame();
if (frame) {
*aValue = frame->StyleFont()->mSize;
return true;
nsIContent* el = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
if (el) {
nsIFrame* frame = el->GetPrimaryFrame();
if (frame) {
*aValue = frame->StyleFont()->mSize;
return true;
}
}

return false;
}

Expand Down Expand Up @@ -551,12 +570,13 @@ TextAttrsMgr::FontStyleTextAttr::
GetValueFor(Accessible* aAccessible, nscoord* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = frame->StyleFont()->mFont.style;
return true;
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = frame->StyleFont()->mFont.style;
return true;
}
}

return false;
}

Expand Down Expand Up @@ -593,12 +613,13 @@ TextAttrsMgr::FontWeightTextAttr::
GetValueFor(Accessible* aAccessible, int32_t* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = GetFontWeight(frame);
return true;
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = GetFontWeight(frame);
return true;
}
}

return false;
}

Expand Down Expand Up @@ -727,12 +748,13 @@ TextAttrsMgr::TextDecorTextAttr::
GetValueFor(Accessible* aAccessible, TextDecorValue* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = TextDecorValue(frame);
return aValue->IsDefined();
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = TextDecorValue(frame);
return aValue->IsDefined();
}
}

return false;
}

Expand Down Expand Up @@ -790,12 +812,13 @@ TextAttrsMgr::TextPosTextAttr::
GetValueFor(Accessible* aAccessible, TextPosValue* aValue)
{
nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = GetTextPosValue(frame);
return *aValue != eTextPosNone;
if (elm) {
nsIFrame* frame = elm->GetPrimaryFrame();
if (frame) {
*aValue = GetTextPosValue(frame);
return *aValue != eTextPosNone;
}
}

return false;
}

Expand Down
7 changes: 3 additions & 4 deletions accessible/jsat/OutputGenerator.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,9 @@ var OutputGenerator = {
_addMencloseNotations: function _addMencloseNotations(aOutput, aAccessible) {
let notations = Utils.getAttributes(aAccessible).notation || 'longdiv';
aOutput[this.outputOrder === OUTPUT_DESC_FIRST ? 'push' : 'unshift'].apply(
aOutput, [for (notation of notations.split(' '))
{string: this._getOutputName('notation-' + notation)}
]
);
aOutput, notations.split(' ').map(notation => {
return { string: this._getOutputName('notation-' + notation) };
}));
},

/**
Expand Down
2 changes: 2 additions & 0 deletions accessible/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ if CONFIG['MOZ_XUL']:
DIRS += ['xul']

TEST_DIRS += ['tests/mochitest']

BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
Loading

0 comments on commit f0e04c7

Please sign in to comment.