Commit d1c18786 authored by Sylvestre Ledru's avatar Sylvestre Ledru
Browse files

Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan

clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
parent c298fe16
Loading
Loading
Loading
Loading
+346 −323
Original line number Diff line number Diff line
@@ -5,20 +5,20 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

MARKUPMAP(a,
MARKUPMAP(
    a,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // Only some roles truly enjoy life as HTMLLinkAccessibles, for
      // details see closed bug 494807.
      const nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aElement);
      if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
          roleMapEntry->role != roles::LINK) {
              return new HyperTextAccessibleWrap(aElement,
                                                 aContext->Document());
        return new HyperTextAccessibleWrap(aElement, aContext->Document());
      }

      return new HTMLLinkAccessible(aElement, aContext->Document());
    },
          roles::LINK)
    roles::LINK);

MARKUPMAP(abbr, New_HyperText, 0)

@@ -30,21 +30,22 @@ MARKUPMAP(aside, New_HyperText, roles::LANDMARK)

MARKUPMAP(blockquote, New_HyperText, roles::BLOCKQUOTE)

MARKUPMAP(button,
MARKUPMAP(
    button,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLButtonAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(caption,
MARKUPMAP(
    caption,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      if (aContext->IsTable()) {
        dom::HTMLTableElement* tableEl =
            dom::HTMLTableElement::FromNode(aContext->GetContent());
        if (tableEl && tableEl == aElement->GetParent() &&
            tableEl->GetCaption() == aElement) {
                return new HTMLCaptionAccessible(aElement,
                                                 aContext->Document());
          return new HTMLCaptionAccessible(aElement, aContext->Document());
        }
      }
      return nullptr;
@@ -120,7 +121,8 @@ MARKUPMAP(
    },
    roles::SECTION)

MARKUPMAP(dl,
MARKUPMAP(
    dl,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLListAccessible(aElement, aContext->Document());
    },
@@ -128,41 +130,45 @@ MARKUPMAP(dl,

MARKUPMAP(dt, New_HTMLDtOrDd<HTMLLIAccessible>, roles::TERM)

MARKUPMAP(figcaption,
MARKUPMAP(
    figcaption,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLFigcaptionAccessible(aElement, aContext->Document());
    },
    roles::CAPTION)

MARKUPMAP(figure,
MARKUPMAP(
    figure,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLFigureAccessible(aElement, aContext->Document());
    },
    roles::FIGURE, Attr(xmlroles, figure))

MARKUPMAP(fieldset,
MARKUPMAP(
    fieldset,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLGroupboxAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(form,
MARKUPMAP(
    form,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLFormAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(footer,
MARKUPMAP(
    footer,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
            return new HTMLHeaderOrFooterAccessible(aElement,
                                                    aContext->Document());
      return new HTMLHeaderOrFooterAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(header,
MARKUPMAP(
    header,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
            return new HTMLHeaderOrFooterAccessible(aElement,
                                                    aContext->Document());
      return new HTMLHeaderOrFooterAccessible(aElement, aContext->Document());
    },
    0)

@@ -178,13 +184,15 @@ MARKUPMAP(h5, New_HyperText, roles::HEADING)

MARKUPMAP(h6, New_HyperText, roles::HEADING)

MARKUPMAP(hr,
MARKUPMAP(
    hr,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLHRAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(input,
MARKUPMAP(
    input,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // TODO(emilio): This would be faster if it used
      // HTMLInputElement's already-parsed representation.
@@ -198,18 +206,17 @@ MARKUPMAP(input,
      }
      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                                nsGkAtoms::radio, eIgnoreCase)) {
              return new HTMLRadioButtonAccessible(aElement,
                                                   aContext->Document());
        return new HTMLRadioButtonAccessible(aElement, aContext->Document());
      }
      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                                nsGkAtoms::time, eIgnoreCase)) {
              return new EnumRoleAccessible<roles::GROUPING>(
                  aElement, aContext->Document());
        return new EnumRoleAccessible<roles::GROUPING>(aElement,
                                                       aContext->Document());
      }
      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                                nsGkAtoms::date, eIgnoreCase)) {
              return new EnumRoleAccessible<roles::DATE_EDITOR>(
                  aElement, aContext->Document());
        return new EnumRoleAccessible<roles::DATE_EDITOR>(aElement,
                                                          aContext->Document());
      }
      return nullptr;
    },
@@ -217,19 +224,22 @@ MARKUPMAP(input,

MARKUPMAP(ins, New_HyperText, roles::CONTENT_INSERTION)

MARKUPMAP(label,
MARKUPMAP(
    label,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLLabelAccessible(aElement, aContext->Document());
    },
    roles::LABEL)

MARKUPMAP(legend,
MARKUPMAP(
    legend,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLLegendAccessible(aElement, aContext->Document());
    },
    roles::LABEL)

MARKUPMAP(li,
MARKUPMAP(
    li,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // If list item is a child of accessible list then create an
      // accessible for it unconditionally by tag name. nsBlockFrame
@@ -301,27 +311,30 @@ MARKUPMAP(munderover_, New_HyperText, roles::MATHML_UNDER_OVER,

MARKUPMAP(mmultiscripts_, New_HyperText, roles::MATHML_MULTISCRIPTS)

MARKUPMAP(mtable_,
MARKUPMAP(
    mtable_,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLTableAccessible(aElement, aContext->Document());
    },
    roles::MATHML_TABLE, AttrFromDOM(align, align),
          AttrFromDOM(columnlines_, columnlines_),
          AttrFromDOM(rowlines_, rowlines_))
    AttrFromDOM(columnlines_, columnlines_), AttrFromDOM(rowlines_, rowlines_))

MARKUPMAP(mlabeledtr_,
MARKUPMAP(
    mlabeledtr_,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLTableRowAccessible(aElement, aContext->Document());
    },
    roles::MATHML_LABELED_ROW)

MARKUPMAP(mtr_,
MARKUPMAP(
    mtr_,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLTableRowAccessible(aElement, aContext->Document());
    },
    roles::MATHML_TABLE_ROW)

MARKUPMAP(mtd_,
MARKUPMAP(
    mtd_,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLTableCellAccessible(aElement, aContext->Document());
    },
@@ -356,27 +369,29 @@ MARKUPMAP(msline_, New_HyperText, roles::MATHML_STACK_LINE,

MARKUPMAP(nav, New_HyperText, roles::LANDMARK)

MARKUPMAP(ol,
MARKUPMAP(
    ol,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLListAccessible(aElement, aContext->Document());
    },
    roles::LIST)

MARKUPMAP(option,
MARKUPMAP(
    option,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
            return new HTMLSelectOptionAccessible(aElement,
                                                  aContext->Document());
      return new HTMLSelectOptionAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(optgroup,
MARKUPMAP(
    optgroup,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
            return new HTMLSelectOptGroupAccessible(aElement,
                                                    aContext->Document());
      return new HTMLSelectOptGroupAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(output,
MARKUPMAP(
    output,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLOutputAccessible(aElement, aContext->Document());
    },
@@ -384,7 +399,8 @@ MARKUPMAP(output,

MARKUPMAP(p, nullptr, roles::PARAGRAPH)

MARKUPMAP(progress,
MARKUPMAP(
    progress,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLProgressAccessible(aElement, aContext->Document());
    },
@@ -392,23 +408,25 @@ MARKUPMAP(progress,

MARKUPMAP(q, New_HyperText, 0)

MARKUPMAP(section,
MARKUPMAP(
    section,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLSectionAccessible(aElement, aContext->Document());
    },
    0)

MARKUPMAP(summary,
MARKUPMAP(
    summary,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLSummaryAccessible(aElement, aContext->Document());
    },
    roles::SUMMARY)

MARKUPMAP(table,
MARKUPMAP(
    table,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      if (aElement->GetPrimaryFrame() &&
                aElement->GetPrimaryFrame()->AccessibleType() !=
                    eHTMLTableType) {
          aElement->GetPrimaryFrame()->AccessibleType() != eHTMLTableType) {
        return new ARIAGridAccessibleWrap(aElement, aContext->Document());
      }
      return nullptr;
@@ -418,7 +436,8 @@ MARKUPMAP(table,
MARKUPMAP(time, New_HyperText, 0, Attr(xmlroles, time),
          AttrFromDOM(datetime, datetime))

MARKUPMAP(tbody,
MARKUPMAP(
    tbody,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // Expose this as a grouping if its frame type is non-standard.
      if (aElement->GetPrimaryFrame() &&
@@ -429,7 +448,8 @@ MARKUPMAP(tbody,
    },
    roles::GROUPING)

MARKUPMAP(td,
MARKUPMAP(
    td,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      if (aContext->IsTableRow() &&
          aContext->GetContent() == aElement->GetParent()) {
@@ -442,19 +462,19 @@ MARKUPMAP(td,
            (aElement->GetPrimaryFrame() &&
             aElement->GetPrimaryFrame()->AccessibleType() !=
                 eHTMLTableCellType)) {
                return new ARIAGridCellAccessibleWrap(aElement,
                                                      aContext->Document());
          return new ARIAGridCellAccessibleWrap(aElement, aContext->Document());
        }
        if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::scope)) {
                return new HTMLTableHeaderCellAccessibleWrap(
                    aElement, aContext->Document());
          return new HTMLTableHeaderCellAccessibleWrap(aElement,
                                                       aContext->Document());
        }
      }
      return nullptr;
    },
    0)

MARKUPMAP(tfoot,
MARKUPMAP(
    tfoot,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // Expose this as a grouping if its frame type is non-standard.
      if (aElement->GetPrimaryFrame() &&
@@ -465,22 +485,23 @@ MARKUPMAP(tfoot,
    },
    roles::GROUPING)

MARKUPMAP(th,
MARKUPMAP(
    th,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      if (aContext->IsTableRow() &&
          aContext->GetContent() == aElement->GetParent()) {
        if (!aContext->IsHTMLTableRow()) {
                return new ARIAGridCellAccessibleWrap(aElement,
                                                      aContext->Document());
          return new ARIAGridCellAccessibleWrap(aElement, aContext->Document());
        }
              return new HTMLTableHeaderCellAccessibleWrap(
                  aElement, aContext->Document());
        return new HTMLTableHeaderCellAccessibleWrap(aElement,
                                                     aContext->Document());
      }
      return nullptr;
    },
    0)

MARKUPMAP(tfoot,
MARKUPMAP(
    tfoot,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // Expose this as a grouping if its frame type is non-standard.
      if (aElement->GetPrimaryFrame() &&
@@ -491,7 +512,8 @@ MARKUPMAP(tfoot,
    },
    roles::GROUPING)

MARKUPMAP(tr,
MARKUPMAP(
    tr,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      // If HTML:tr element is part of its HTML:table, which has CSS
      // display style other than 'table', then create a generic table row
@@ -521,7 +543,8 @@ MARKUPMAP(tr,
    },
    0)

MARKUPMAP(ul,
MARKUPMAP(
    ul,
    [](Element* aElement, Accessible* aContext) -> Accessible* {
      return new HTMLListAccessible(aElement, aContext->Document());
    },
+6 −3
Original line number Diff line number Diff line
@@ -17,17 +17,20 @@ static void TestSuffix(const OriginAttributes& attrs) {
  EXPECT_EQ(attrs, attrsFromSuffix);
}

TEST(OriginAttributes, Suffix_default) {
TEST(OriginAttributes, Suffix_default)
{
  OriginAttributes attrs;
  TestSuffix(attrs);
}

TEST(OriginAttributes, Suffix_appId_inIsolatedMozBrowser) {
TEST(OriginAttributes, Suffix_appId_inIsolatedMozBrowser)
{
  OriginAttributes attrs(1, true);
  TestSuffix(attrs);
}

TEST(OriginAttributes, Suffix_maxAppId_inIsolatedMozBrowser) {
TEST(OriginAttributes, Suffix_maxAppId_inIsolatedMozBrowser)
{
  OriginAttributes attrs(4294967295, true);
  TestSuffix(attrs);
}
+1 −2
Original line number Diff line number Diff line
@@ -197,8 +197,7 @@ void AnonymousContent::GetComputedStylePropertyValue(
  aRv = cs->GetPropertyValue(aPropertyName, aResult);
}

void AnonymousContent::GetTargetIdForEvent(Event& aEvent, DOMString& aResult)
{
void AnonymousContent::GetTargetIdForEvent(Event& aEvent, DOMString& aResult) {
  nsCOMPtr<Element> el = do_QueryInterface(aEvent.GetOriginalTarget());
  if (el && el->IsInNativeAnonymousSubtree() && mContentNode->Contains(el)) {
    aResult.SetKnownLiveAtom(el->GetID(), DOMString::eTreatNullAsNull);
+15 −14
Original line number Diff line number Diff line
@@ -143,7 +143,8 @@ RefPtr<PerformanceInfoPromise> DocGroup::ReportPerformanceInfo() {
  RefPtr<DocGroup> self = this;

  return CollectMemoryInfo(top, mainThread)
      ->Then(mainThread, __func__,
      ->Then(
          mainThread, __func__,
          [self, host, pid, windowID, duration, isTopLevel,
           items](const PerformanceMemoryInfo& aMemoryInfo) {
            PerformanceInfo info =
+14 −13
Original line number Diff line number Diff line
@@ -12627,7 +12627,8 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
      AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
          NodePrincipal(), inner, AntiTrackingCommon::eStorageAccessAPI,
          performFinalChecks)
          ->Then(GetCurrentThreadSerialEventTarget(), __func__,
          ->Then(
              GetCurrentThreadSerialEventTarget(), __func__,
              [outer, promise] {
                // Step 10. Grant the document access to cookies and store
                // that fact for
Loading