Skip to content

Commit

Permalink
Merge m-c to inbound a=merge
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 3rHXXSEcJ6k
  • Loading branch information
KWierso committed Aug 31, 2017
2 parents b7d9407 + 940bdbc commit ef3d37e
Show file tree
Hide file tree
Showing 230 changed files with 7,412 additions and 5,719 deletions.
8 changes: 4 additions & 4 deletions accessible/base/MarkupMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ MARKUPMAP(form,
roles::FORM)

MARKUPMAP(footer,
New_HyperText,
roles::FOOTER)
New_HTMLHeaderOrFooter,
0)

MARKUPMAP(header,
New_HyperText,
roles::HEADER)
New_HTMLHeaderOrFooter,
0)

MARKUPMAP(h1,
New_HyperText,
Expand Down
3 changes: 3 additions & 0 deletions accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ static Accessible* New_HTMLFigcaption(nsIContent* aContent, Accessible* aContext
static Accessible* New_HTMLFigure(nsIContent* aContent, Accessible* aContext)
{ return new HTMLFigureAccessible(aContent, aContext->Document()); }

static Accessible* New_HTMLHeaderOrFooter(nsIContent* aContent, Accessible* aContext)
{ return new HTMLHeaderOrFooterAccessible(aContent, aContext->Document()); }

static Accessible* New_HTMLLegend(nsIContent* aContent, Accessible* aContext)
{ return new HTMLLegendAccessible(aContent, aContext->Document()); }

Expand Down
25 changes: 0 additions & 25 deletions accessible/generic/HyperTextAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1142,31 +1142,6 @@ HyperTextAccessible::LandmarkRole() const
return nsGkAtoms::navigation;
}

if (mContent->IsAnyOfHTMLElements(nsGkAtoms::header,
nsGkAtoms::footer)) {
// Only map header and footer if they are not descendants of an article
// or section tag.
nsIContent* parent = mContent->GetParent();
while (parent) {
if (parent->IsAnyOfHTMLElements(nsGkAtoms::article, nsGkAtoms::section)) {
break;
}
parent = parent->GetParent();
}

// No article or section elements found.
if (!parent) {
if (mContent->IsHTMLElement(nsGkAtoms::header)) {
return nsGkAtoms::banner;
}

if (mContent->IsHTMLElement(nsGkAtoms::footer)) {
return nsGkAtoms::contentinfo;
}
}
return nullptr;
}

if (mContent->IsHTMLElement(nsGkAtoms::aside)) {
return nsGkAtoms::complementary;
}
Expand Down
56 changes: 56 additions & 0 deletions accessible/html/HTMLElementAccessibles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,59 @@ HTMLSummaryAccessible::IsWidget() const
{
return true;
}


////////////////////////////////////////////////////////////////////////////////
// HTMLHeaderOrFooterAccessible
////////////////////////////////////////////////////////////////////////////////

NS_IMPL_ISUPPORTS_INHERITED0(HTMLHeaderOrFooterAccessible, HyperTextAccessible)

role
HTMLHeaderOrFooterAccessible::NativeRole()
{
// Only map header and footer if they are direct descendants of the body tag.
// If other sectioning or sectioning root elements, they become sections.
nsIContent* parent = mContent->GetParent();
while (parent) {
if (parent->IsAnyOfHTMLElements(nsGkAtoms::article, nsGkAtoms::aside,
nsGkAtoms::nav, nsGkAtoms::section,
nsGkAtoms::blockquote, nsGkAtoms::details,
nsGkAtoms::dialog, nsGkAtoms::fieldset,
nsGkAtoms::figure, nsGkAtoms::td)) {
break;
}
parent = parent->GetParent();
}

// No sectioning or sectioning root elements found.
if (!parent) {
if (mContent->IsHTMLElement(nsGkAtoms::header)) {
return roles::HEADER;
}

if (mContent->IsHTMLElement(nsGkAtoms::footer)) {
return roles::FOOTER;
}
}

return roles::SECTION;
}

nsIAtom*
HTMLHeaderOrFooterAccessible::LandmarkRole() const
{
if (!HasOwnContent())
return nullptr;

a11y::role r = const_cast<HTMLHeaderOrFooterAccessible*>(this)->Role();
if (r == roles::HEADER) {
return nsGkAtoms::banner;
}

if (r == roles::FOOTER) {
return nsGkAtoms::contentinfo;
}

return nullptr;
}
20 changes: 20 additions & 0 deletions accessible/html/HTMLElementAccessibles.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ class HTMLSummaryAccessible : public HyperTextAccessibleWrap
virtual bool IsWidget() const override;
};

/**
* Used for HTML header and footer elements.
*/
class HTMLHeaderOrFooterAccessible : public HyperTextAccessibleWrap
{
public:

HTMLHeaderOrFooterAccessible(nsIContent* aContent, DocAccessible* aDoc) :
HyperTextAccessibleWrap(aContent, aDoc) {}

NS_DECL_ISUPPORTS_INHERITED

// Accessible
virtual nsIAtom* LandmarkRole() const override;
virtual a11y::role NativeRole() override;

protected:
virtual ~HTMLHeaderOrFooterAccessible() {}
};

} // namespace a11y
} // namespace mozilla

Expand Down
68 changes: 66 additions & 2 deletions accessible/tests/mochitest/elm/test_HTMLSpec.html
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,20 @@
testElm("footer", obj);

obj = {
role: ROLE_FOOTER,
role: ROLE_SECTION,
absentAttributes: { "xml-roles": "contentinfo" },
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
};
testElm("footer_in_article", obj);
testElm("footer_in_aside", obj);
testElm("footer_in_nav", obj);
testElm("footer_in_section", obj);
testElm("footer_in_blockquote", obj);
testElm("footer_in_details", obj);
testElm("footer_in_dialog", obj);
testElm("footer_in_fieldset", obj);
testElm("footer_in_figure", obj);
testElm("footer_in_td", obj);

// ////////////////////////////////////////////////////////////////////////
// HTML:form
Expand Down Expand Up @@ -609,12 +617,20 @@
testElm("header", obj);

obj = {
role: ROLE_HEADER,
role: ROLE_SECTION,
absentAttributes: { "xml-roles": "banner" },
interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ]
};
testElm("header_in_article", obj);
testElm("header_in_aside", obj);
testElm("header_in_nav", obj);
testElm("header_in_section", obj);
testElm("header_in_blockquote", obj);
testElm("header_in_details", obj);
testElm("header_in_dialog", obj);
testElm("header_in_fieldset", obj);
testElm("header_in_figure", obj);
testElm("header_in_td", obj);

// ////////////////////////////////////////////////////////////////////////
// HTML:hr
Expand Down Expand Up @@ -1471,9 +1487,33 @@
<article>
<footer id="footer_in_article">Some copyright info</footer>
</article>
<aside>
<footer id="footer_in_aside">Some copyright info</footer>
</aside>
<nav>
<footer id="footer_in_nav">Some copyright info</footer>
</nav>
<section>
<footer id="footer_in_section">Some copyright info</footer>
</section>
<blockquote>
<footer id="footer_in_blockquote">Some copyright info</footer>
</blockquote>
<details open="true">
<footer id="footer_in_details">Some copyright info</footer>
</details>
<dialog open="true">
<footer id="footer_in_dialog">Some copyright info</footer>
</dialog>
<fieldset>
<footer id="footer_in_fieldset">Some copyright info</footer>
</fieldset>
<figure>
<footer id="footer_in_figure">Some copyright info</footer>
</figure>
<table><tr><td>
<footer id="footer_in_td">Some copyright info</footer>
</td></tr></table>

<form id="form"></form>

Expand All @@ -1492,9 +1532,33 @@ <h6 id="h6">heading6</h6>
<article>
<header id="header_in_article">Not logo</header>
</article>
<aside>
<header id="header_in_aside">Not logo</header>
</aside>
<nav>
<header id="header_in_nav">Not logo</header>
</nav>
<section>
<header id="header_in_section">Not logo</header>
</section>
<blockquote>
<header id="header_in_blockquote">Not logo</header>
</blockquote>
<details open="true">
<header id="header_in_details">Not logo</header>
</details>
<dialog open="true">
<header id="header_in_dialog">Not logo</header>
</dialog>
<fieldset>
<header id="header_in_fieldset">Not logo</header>
</fieldset>
<figure>
<header id="header_in_figure">Not logo</header>
</figure>
<table><tr><td>
<header id="header_in_td">Not logo</header>
</td></tr></table>

<hr id="hr">
<p id="i_container">normal<i>italic</i></p>
Expand Down
32 changes: 16 additions & 16 deletions accessible/tests/mochitest/jsat/test_landmarks.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,34 @@
}, {
accOrElmOrID: "article_header",
expectedUtterance: [
[{"string": "header"}, "a header within an article"],
["a header within an article", {"string": "header"}]],
["a header within an article"],
["a header within an article"]],
expectedBraille: [
[{"string": "headerAbbr"}, "a header within an article"],
["a header within an article", {"string": "headerAbbr"}]],
["a header within an article"],
["a header within an article"]],
}, {
accOrElmOrID: "article_footer",
expectedUtterance: [
[{"string": "footer"}, "a footer within an article"],
["a footer within an article", {"string": "footer"}]],
["a footer within an article"],
["a footer within an article"]],
expectedBraille: [
[{"string": "footerAbbr"}, "a footer within an article"],
["a footer within an article", {"string": "footerAbbr"}]]
["a footer within an article"],
["a footer within an article"]]
}, {
accOrElmOrID: "section_header",
expectedUtterance: [[{"string": "header"}, "a header within a section"],
["a header within a section", {"string": "header"}]],
expectedUtterance: [["a header within a section"],
["a header within a section"]],
expectedBraille: [
[{"string": "headerAbbr"}, "a header within a section"],
["a header within a section", {"string": "headerAbbr"}]]
["a header within a section"],
["a header within a section"]]
}, {
accOrElmOrID: "section_footer",
expectedUtterance: [
[{"string": "footer"}, "a footer within a section"],
["a footer within a section", {"string": "footer"}]],
["a footer within a section"],
["a footer within a section"]],
expectedBraille: [
[{"string": "footerAbbr"}, "a footer within a section"],
["a footer within a section", {"string": "footerAbbr"}]]
["a footer within a section"],
["a footer within a section"]]
}, {
accOrElmOrID: "aside",
expectedUtterance: [
Expand Down
4 changes: 2 additions & 2 deletions accessible/tests/mochitest/role/test_general.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
// Check that landmark elements get accessibles with styled overflow.
testRole("section_overflow", ROLE_SECTION);
testRole("nav_overflow", ROLE_SECTION);
testRole("header_overflow", ROLE_HEADER);
testRole("header_overflow", ROLE_SECTION);
testRole("aside_overflow", ROLE_NOTE);
testRole("footer_overflow", ROLE_FOOTER);
testRole("footer_overflow", ROLE_SECTION);
testRole("article_overflow", ROLE_ARTICLE);

// test html:div
Expand Down
1 change: 1 addition & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ pref("browser.tabs.loadInBackground", true);
pref("browser.tabs.opentabfor.middleclick", true);
pref("browser.tabs.loadDivertedInBackground", false);
pref("browser.tabs.loadBookmarksInBackground", false);
pref("browser.tabs.loadBookmarksInTabs", false);
pref("browser.tabs.tabClipWidth", 140);
#ifdef UNIX_BUT_NOT_MAC
pref("browser.tabs.drawInTitlebar", false);
Expand Down
13 changes: 10 additions & 3 deletions browser/base/content/aboutDialog-appUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function onUnload(aEvent) {
}


function appUpdater() {
function appUpdater(options = {}) {
XPCOMUtils.defineLazyServiceGetter(this, "aus",
"@mozilla.org/updates/update-service;1",
"nsIApplicationUpdateService");
Expand All @@ -38,6 +38,7 @@ function appUpdater() {
"@mozilla.org/updates/update-manager;1",
"nsIUpdateManager");

this.options = options;
this.updateDeck = document.getElementById("updateDeck");

// Hide the update deck when the update window is already open and it's not
Expand Down Expand Up @@ -186,9 +187,15 @@ appUpdater.prototype =
button.label = this.bundle.formatStringFromName("update.downloadAndInstallButton.label", [updateVersion], 1);
button.accessKey = this.bundle.GetStringFromName("update.downloadAndInstallButton.accesskey");
}
this.updateDeck.selectedPanel = panel;
if (this.options.buttonAutoFocus &&
(!document.commandDispatcher.focusedElement || // don't steal the focus
document.commandDispatcher.focusedElement.localName == "button")) { // except from the other buttons
button.focus();
}
} else {
this.updateDeck.selectedPanel = panel;
}

this.updateDeck.selectedPanel = panel;
},

/**
Expand Down
8 changes: 1 addition & 7 deletions browser/base/content/aboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ function init(aEvent) {
}

if (AppConstants.MOZ_UPDATER) {
gAppUpdater = new appUpdater();

let button = gAppUpdater.updateDeck.selectedPanel.querySelector("button");
if (button && (!document.commandDispatcher.focusedElement || // don't steal the focus
document.commandDispatcher.focusedElement.localName == "button")) { // except from the other buttons
button.focus();
}
gAppUpdater = new appUpdater({ buttonAutoFocus: true });

let channelLabel = document.getElementById("currentChannel");
let currentChannelText = document.getElementById("currentChannelText");
Expand Down
1 change: 1 addition & 0 deletions browser/base/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ html|input.urlbar-input[textoverflow]:not([focused]) {

#urlbar[pageproxystate=invalid] > #page-action-buttons > .urlbar-page-action,
#identity-box.chromeUI ~ #page-action-buttons > .urlbar-page-action,
#urlbar[usertyping] > .urlbar-textbox-container > .urlbar-history-dropmarker,
.urlbar-go-button[pageproxystate="valid"],
.urlbar-go-button:not([parentfocused="true"]),
#urlbar[pageproxystate="invalid"] > #identity-box > #blocked-permissions-container,
Expand Down
Loading

0 comments on commit ef3d37e

Please sign in to comment.