Closed Bug 1590639 Opened 4 years ago Closed 4 years ago

Fix non-unified build error in several layout subdirectories


(Core :: Layout, defect, P3)




Tracking Status
firefox72 --- fixed


(Reporter: dholbert, Assigned: dholbert)



(7 files)

I used the flight time on my (nearly-over) vacation to fix some non-unified build bustage.

I'm filing this bug to cover those patches.

This patch is entirely automated, and was generated with the following command:
./mach clang-format -p layout/

The issues fall into these categories:

  • Files that used StaticPrefs::layout_XYZ() API or gfxVars::XYZ that needed an
    include. (Addressed by adding the missing include.)
  • Files that use mozilla::dom::XYZ or mozilla::gfx::XYZ without qualifying the
    namespace & without a 'using' decl. (Addressed by adding "using".)
  • A few other includes for types/inlines that were used without their header.

Depends on D50162

Changes here:

  • Adding a "dom::" prefix in GeckoMVMContext.cpp (could've also added
    a "using" decl, but I'm just adding a one-off prefix to match "dom::Document"
    usage elsewhere in this file).
  • Giving nsLayoutUtils an include for ViewportFrame.h since it uses that type.
  • Giving nsPresArena.cpp an include for nsDisplayList.h to provide the
    DisplayListArenaObjectId enum type.

Depends on D50163

This patch:

  • Gives nsMeterFrame.cpp a "using" decl for mozilla::dom::Document (matching
    local style), to make its "nsCOMPtr<Document>" variable valid.
  • Gives RetainedDisplayListBuilder.cpp an include for nsIFrameInlines.h
    (and nsIFrame.h for good measure) to provide the definition for inline
    function nsIFrame::IsFixedPosContainingBlock().
  • Gives nsDisplayList.cpp an include for LayerAnimationInfo.h, since it uses
    that type.

Depends on D50164

This patch:

  • Gives layout/generic/AnonymousContentKey.h an include for <stdint.h> to
    provide the uint8_t type, and TypedEnumBits.h to provide the
    MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS macro. (This is a change in another
    directory, but it's needed in order for layout/style/ServoStyleSet.cpp to
    build successfully.)
  • Adds a missing "nsINode" forward-decl to dom/base/IdentifierMapEntry.h,
    because it uses that type in function declarations. (This change is needed
    in order for layout/style/CachedInheritingStyles.cpp to build successfully.)
  • Gives CSSStyleRule.cpp an include for PseudoStyleType.h,
    nsCSSPseudoElements.h, and CSSEnabledState.h because it uses those types.
  • Gives GeckoBindings.cpp an include for gfxTextRun.h, to provide the definition
    of type gfxFontGroup (so GeckoBindings can call GetFirstValidFont() on an
    object of that type).
  • Gives Loader.h an include for nsIContentInlines.h, to provide the inline
    function IsInUAWidget().
  • Gives Rule.cpp an include for HoldDropJSObjects.h, to provide DropJSObjects().
  • Gives nsImageLoader.cpp an include for DocumentInlines.h (and Document.h for
    good measure), to provide the inline function GetPresContext().
  • Gives nsStyleStruct.cpp an include for DocumentInlines.h, to provide inline
    function Document::GetPresContext().
  • Gives nsStyleTransformMatrix.h an include for Units.h (instead of gfxPoint.h,
    which isn't useful) to provide the CSSPoint type.
  • Gives nsStyleTransformMatrix.h an include for ServoStyleConsts.h, to provide
    LengthPercentage and the various StyleRotate/StyleScale/StyleTransform/etc
    types. (These can't be easily forward-declared, because some of them are
    legitimate types whereas others are type aliases. We could theoretically
    forward-declare all of the underlying types and then repeat the type aliases,
    but that'd be verbose and unmaintainable.)

Depends on D50165

This patch:

  • Gives SVGFELeafFrame.cpp and SVGFEUnstyledLeafFrame.cpp the correct
    namespace-prefixing in some static_cast operation, and changes the capturing
    variable to be "auto*" to avoid repeating the long typename.
  • Gives nsSVGContainerFrame.cpp, nsSVGIntegrationUtils.cpp, and
    nsSVGSwitchFrame.cpp a "using namespace mozilla::dom" decl, so that their
    multiple unprefixed SVGElement* usages become valid.
  • Gives nsFilterInstance.h a forward-decl for WrFiltersHolder (which it uses in
    function declarations)
  • Gives nsFilterInstance.cpp an include for nsSVGIntegrationUtils.h to provide
    the WrFiltersHolder type (which it uses).
  • Gives nsSVGPatternFrame.h mozilla-namespace prefixes before all its
    SVGAniated* type usages, to make them valid.

Depends on D50166

This patch:

  • Gives ServoStyleRuleMap.cpp an include for Element.h (to provide that type).
  • Gives inDeepTreeWalker.cpp a mozilla::dom prefix for its one use of Document.
  • Gives inLayoutUtils.cpp a "using" decl for mozilla::dom, so we can compile
    with the many un-namespaced "Document" and "Element" usages in that file.

Depends on D50167

Pushed by
part 0: Run clang-format on layout/. r=TYLin
part 1: Fix non-unified build issues in layout/generic. r=TYLin
part 2: Fix non-unified build issues in layout/base. r=TYLin
part 3: Fix non-unified build issues in layout/{forms,painting}. r=TYLin
part 4: Fix non-unified build issues in layout/style. r=emilio
part 5: Fix non-unified build issues in layout/svg. r=emilio
part 6: Fix non-unified build issues in layout/inspector. r=emilio
You need to log in before you can comment on or make changes to this bug.