Skip to content

Commit

Permalink
Merge mozilla-central to autoland. a=merge CLOSED TREE
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianbrindusan committed Dec 10, 2018
2 parents 8d2df14 + c0be6a4 commit 989d78f
Show file tree
Hide file tree
Showing 75 changed files with 803 additions and 413 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ lextab.py
# Ignore temp files created by patch command.
*.orig
*.rej

# Ignore file generated by lalrpop at build time.
third_party/rust/lalrpop/src/parser/lrgrammar.rs
3 changes: 3 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ subinclude:servo/.hgignore
^testing/raptor/raptor-venv
^testing/raptor/raptor/tests/.*.json
^testing/raptor/webext/raptor/auto_gen_test_config.js

# Ignore file generated by lalrpop at build time.
^third_party/rust/lalrpop/src/parser/lrgrammar.rs
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ ad179a6fc14cbd41d10a018ac4a3822db119de3b FIREFOX_BETA_64_BASE
c44fbdd5173548c9035256dda8fd3512f67118a8 FIREFOX_NIGHTLY_64_END
58a0412e15574f063cd380517a0369bfb48b22e0 PRE_TREEWIDE_CLANG_FORMAT
9ad82455dcee2bc1d438e46016b8db00e88758a8 FIREFOX_BETA_65_BASE
3386ff76878d83496bb822d09115c77472808b53 FIREFOX_NIGHTLY_65_END
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
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.

Bug 1499026 - Update to ICU 63 requires clobber
Merge day clobber
14 changes: 8 additions & 6 deletions accessible/base/nsAccUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,23 @@ int32_t nsAccUtils::GetARIAOrDefaultLevel(const Accessible* aAccessible) {
}

int32_t nsAccUtils::GetLevelForXULContainerItem(nsIContent* aContent) {
nsCOMPtr<nsIDOMXULContainerItemElement> item(do_QueryInterface(aContent));
nsCOMPtr<nsIDOMXULContainerItemElement> item =
aContent->AsElement()->AsXULContainerItem();
if (!item) return 0;

nsCOMPtr<nsIDOMXULContainerElement> container;
item->GetParentContainer(getter_AddRefs(container));
nsCOMPtr<Element> containerElement;
item->GetParentContainer(getter_AddRefs(containerElement));
nsCOMPtr<nsIDOMXULContainerElement> container =
containerElement ? containerElement->AsXULContainer() : nullptr;
if (!container) return 0;

// Get level of the item.
int32_t level = -1;
while (container) {
level++;

nsCOMPtr<nsIDOMXULContainerElement> parentContainer;
container->GetParentContainer(getter_AddRefs(parentContainer));
parentContainer.swap(container);
container->GetParentContainer(getter_AddRefs(containerElement));
container = containerElement ? containerElement->AsXULContainer() : nullptr;
}

return level;
Expand Down
27 changes: 20 additions & 7 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,15 @@ void Accessible::XULElmName(DocAccessible* aDocument, nsIContent* aElm,
*/

// CASE #1 (via label attribute) -- great majority of the cases
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemEl = do_QueryInterface(aElm);
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemEl =
aElm->AsElement()->AsXULSelectControlItem();
if (itemEl) {
itemEl->GetLabel(aName);
} else {
// Use @label if this is not a select control element, which uses label
// attribute to indicate, which option is selected.
nsCOMPtr<nsIDOMXULSelectControlElement> select = do_QueryInterface(aElm);
nsCOMPtr<nsIDOMXULSelectControlElement> select =
aElm->AsElement()->AsXULSelectControl();
if (!select) {
aElm->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aName);
}
Expand Down Expand Up @@ -1673,7 +1675,7 @@ Relation Accessible::RelationByType(RelationType aType) const {
} else {
// In XUL, use first <button default="true" .../> in the document
nsIDocument* doc = mContent->OwnerDoc();
nsCOMPtr<nsIDOMXULButtonElement> buttonEl;
nsIContent* buttonEl = nullptr;
if (doc->IsXULDocument()) {
dom::XULDocument* xulDoc = doc->AsXULDocument();
nsCOMPtr<nsIHTMLCollection> possibleDefaultButtons =
Expand All @@ -1683,7 +1685,13 @@ Relation Accessible::RelationByType(RelationType aType) const {
uint32_t length = possibleDefaultButtons->Length();
// Check for button in list of default="true" elements
for (uint32_t count = 0; count < length && !buttonEl; count++) {
buttonEl = do_QueryInterface(possibleDefaultButtons->Item(count));
nsIContent* item = possibleDefaultButtons->Item(count);
RefPtr<nsIDOMXULButtonElement> button =
item->IsElement() ? item->AsElement()->AsXULButton()
: nullptr;
if (button) {
buttonEl = item;
}
}
}
if (!buttonEl) { // Check for anonymous accept button in <dialog>
Expand All @@ -1692,11 +1700,16 @@ Relation Accessible::RelationByType(RelationType aType) const {
nsIContent* possibleButtonEl =
rootElm->OwnerDoc()->GetAnonymousElementByAttribute(
rootElm, nsGkAtoms::_default, NS_LITERAL_STRING("true"));
buttonEl = do_QueryInterface(possibleButtonEl);
if (possibleButtonEl && possibleButtonEl->IsElement()) {
RefPtr<nsIDOMXULButtonElement> button =
possibleButtonEl->AsElement()->AsXULButton();
if (button) {
buttonEl = possibleButtonEl;
}
}
}
}
nsCOMPtr<nsIContent> relatedContent(do_QueryInterface(buttonEl));
return Relation(mDoc, relatedContent);
return Relation(mDoc, buttonEl);
}
}
return Relation();
Expand Down
2 changes: 1 addition & 1 deletion accessible/generic/RootAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void RootAccessible::ProcessDOMEvent(Event* aDOMEvent) {
// If multiselect tree, we should fire selectionadd or selection removed
if (FocusMgr()->HasDOMFocus(targetNode)) {
nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSel =
do_QueryInterface(targetNode);
targetNode->AsElement()->AsXULMultiSelectControl();
nsAutoString selType;
multiSel->GetSelType(selType);
if (selType.IsEmpty() || !selType.EqualsLiteral("single")) {
Expand Down
20 changes: 9 additions & 11 deletions accessible/xul/XULComboboxAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ uint64_t XULComboboxAccessible::NativeState() const {
// Get focus status from base class
uint64_t state = Accessible::NativeState();

nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm()->AsXULMenuList();
if (menuList) {
bool isOpen = false;
menuList->GetOpen(&isOpen);
Expand All @@ -70,15 +70,13 @@ uint64_t XULComboboxAccessible::NativeState() const {
void XULComboboxAccessible::Description(nsString& aDescription) {
aDescription.Truncate();
// Use description of currently focused option
nsCOMPtr<nsIDOMXULMenuListElement> menuListElm(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMXULMenuListElement> menuListElm = Elm()->AsXULMenuList();
if (!menuListElm) return;

nsCOMPtr<nsIDOMXULSelectControlItemElement> focusedOptionItem;
nsCOMPtr<Element> focusedOptionItem;
menuListElm->GetSelectedItem(getter_AddRefs(focusedOptionItem));
nsCOMPtr<nsIContent> focusedOptionContent =
do_QueryInterface(focusedOptionItem);
if (focusedOptionContent && mDoc) {
Accessible* focusedOptionAcc = mDoc->GetAccessible(focusedOptionContent);
if (focusedOptionItem && mDoc) {
Accessible* focusedOptionAcc = mDoc->GetAccessible(focusedOptionItem);
if (focusedOptionAcc) focusedOptionAcc->Description(aDescription);
}
}
Expand All @@ -87,7 +85,7 @@ void XULComboboxAccessible::Value(nsString& aValue) const {
aValue.Truncate();

// The value is the option or text shown entered in the combobox.
nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm()->AsXULMenuList();
if (menuList) menuList->GetLabel(aValue);
}

Expand All @@ -100,7 +98,7 @@ bool XULComboboxAccessible::DoAction(uint8_t aIndex) const {
if (aIndex != XULComboboxAccessible::eAction_Click) return false;

// Programmaticaly toggle the combo box.
nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm()->AsXULMenuList();
if (!menuList) return false;

bool isDroppedDown = false;
Expand All @@ -113,7 +111,7 @@ void XULComboboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
aName.Truncate();
if (aIndex != XULComboboxAccessible::eAction_Click) return;

nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm()->AsXULMenuList();
if (!menuList) return;

bool isDroppedDown = false;
Expand Down Expand Up @@ -155,7 +153,7 @@ bool XULComboboxAccessible::AreItemsOperable() const {
return false;
}

nsCOMPtr<nsIDOMXULMenuListElement> menuListElm = do_QueryInterface(mContent);
nsCOMPtr<nsIDOMXULMenuListElement> menuListElm = Elm()->AsXULMenuList();
if (menuListElm) {
bool isOpen = false;
menuListElm->GetOpen(&isOpen);
Expand Down
9 changes: 4 additions & 5 deletions accessible/xul/XULFormControlAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ uint64_t XULButtonAccessible::NativeState() const {
uint64_t state = Accessible::NativeState();

// Buttons can be checked -- they simply appear pressed in rather than checked
nsCOMPtr<nsIDOMXULButtonElement> xulButtonElement(
do_QueryInterface(mContent));
nsCOMPtr<nsIDOMXULButtonElement> xulButtonElement = Elm()->AsXULButton();
if (xulButtonElement) {
nsAutoString type;
xulButtonElement->GetType(type);
Expand Down Expand Up @@ -157,15 +156,15 @@ bool XULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen) const {

while (parent) {
nsCOMPtr<nsIDOMXULButtonElement> parentButtonElement =
do_QueryInterface(parent);
parent->AsElement()->AsXULButton();
if (parentButtonElement) {
parentButtonElement->GetOpen(&isOpen);
if (aToggleOpen) parentButtonElement->SetOpen(!isOpen);
return isOpen;
}

nsCOMPtr<nsIDOMXULMenuListElement> parentMenuListElement =
do_QueryInterface(parent);
parent->AsElement()->AsXULMenuList();
if (parentMenuListElement) {
parentMenuListElement->GetOpen(&isOpen);
if (aToggleOpen) parentMenuListElement->SetOpen(!isOpen);
Expand Down Expand Up @@ -247,7 +246,7 @@ uint64_t XULRadioButtonAccessible::NativeState() const {
state |= states::CHECKABLE;

nsCOMPtr<nsIDOMXULSelectControlItemElement> radioButton =
do_QueryInterface(mContent);
Elm()->AsXULSelectControlItem();
if (radioButton) {
bool selected = false; // Radio buttons can be selected
radioButton->GetSelected(&selected);
Expand Down
Loading

0 comments on commit 989d78f

Please sign in to comment.