diff --git a/accessible/generic/DocAccessible.h b/accessible/generic/DocAccessible.h index c7c455f951ce..bfb502f1a1da 100644 --- a/accessible/generic/DocAccessible.h +++ b/accessible/generic/DocAccessible.h @@ -643,7 +643,7 @@ protected: */ union { // ARIA attribute value - nsAtom* mARIAAttrOldValue; + const nsAtom* mARIAAttrOldValue; // True if the accessible state bit was on bool mStateBitWasOn; diff --git a/browser/themes/shared/controlcenter/panel.inc.css b/browser/themes/shared/controlcenter/panel.inc.css index d002ff8bf46e..5e0c3684ff9a 100644 --- a/browser/themes/shared/controlcenter/panel.inc.css +++ b/browser/themes/shared/controlcenter/panel.inc.css @@ -436,7 +436,7 @@ description#identity-popup-content-verifier, #identity-popup-trackersView-list { padding: 5px 20px; -moz-box-flex: 1; - overflow: scroll; + overflow: auto; } .identity-popup-trackersView-list-item { diff --git a/devtools/client/themes/webconsole.css b/devtools/client/themes/webconsole.css index 61a3a30b24db..ab2f322ffc33 100644 --- a/devtools/client/themes/webconsole.css +++ b/devtools/client/themes/webconsole.css @@ -254,6 +254,7 @@ a { flex-shrink: 0; color: var(--frame-link-source); margin-inline-start: 5px; + margin-inline-end: 10px; } .stack-trace { diff --git a/dom/base/AttrArray.cpp b/dom/base/AttrArray.cpp index 25cd5cac1d89..1d66d42b79e1 100644 --- a/dom/base/AttrArray.cpp +++ b/dom/base/AttrArray.cpp @@ -34,7 +34,7 @@ AttrArray::Impl::~Impl() } const nsAttrValue* -AttrArray::GetAttr(nsAtom* aLocalName, int32_t aNamespaceID) const +AttrArray::GetAttr(const nsAtom* aLocalName, int32_t aNamespaceID) const { if (aNamespaceID == kNameSpaceID_None) { // This should be the common case so lets make an optimized loop @@ -273,7 +273,7 @@ AttrArray::GetExistingAttrNameFromQName(const nsAString& aName) const } int32_t -AttrArray::IndexOfAttr(nsAtom* aLocalName, int32_t aNamespaceID) const +AttrArray::IndexOfAttr(const nsAtom* aLocalName, int32_t aNamespaceID) const { if (!mImpl) { return -1; diff --git a/dom/base/AttrArray.h b/dom/base/AttrArray.h index 5fc2f2546ad9..6f59cd7995d2 100644 --- a/dom/base/AttrArray.h +++ b/dom/base/AttrArray.h @@ -46,7 +46,7 @@ public: return NonMappedAttrCount() + MappedAttrCount(); } - const nsAttrValue* GetAttr(nsAtom* aLocalName, + const nsAttrValue* GetAttr(const nsAtom* aLocalName, int32_t aNamespaceID = kNameSpaceID_None) const; // As above but using a string attr name and always using // kNameSpaceID_None. This is always case-sensitive. @@ -79,7 +79,7 @@ public: const nsAttrName* GetSafeAttrNameAt(uint32_t aPos) const; const nsAttrName* GetExistingAttrNameFromQName(const nsAString& aName) const; - int32_t IndexOfAttr(nsAtom* aLocalName, int32_t aNamespaceID = kNameSpaceID_None) const; + int32_t IndexOfAttr(const nsAtom* aLocalName, int32_t aNamespaceID = kNameSpaceID_None) const; // SetAndSwapMappedAttr swaps the current attribute value with aValue. // If the attribute was unset, an empty value will be swapped into aValue diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 8c56ebef7a09..60275261df2f 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -2420,8 +2420,8 @@ Element::InternalGetAttrNameFromQName(const nsAString& aStr, bool Element::MaybeCheckSameAttrVal(int32_t aNamespaceID, - nsAtom* aName, - nsAtom* aPrefix, + const nsAtom* aName, + const nsAtom* aPrefix, const nsAttrValueOrString& aValue, bool aNotify, nsAttrValue& aOldValue, @@ -2905,7 +2905,7 @@ Element::GetEventListenerManagerForAttr(nsAtom* aAttrName, } bool -Element::GetAttr(int32_t aNameSpaceID, nsAtom* aName, +Element::GetAttr(int32_t aNameSpaceID, const nsAtom* aName, nsAString& aResult) const { DOMString str; @@ -2916,7 +2916,7 @@ Element::GetAttr(int32_t aNameSpaceID, nsAtom* aName, int32_t Element::FindAttrValueIn(int32_t aNameSpaceID, - nsAtom* aName, + const nsAtom* aName, AttrValuesArray* aValues, nsCaseTreatment aCaseSensitive) const { diff --git a/dom/base/Element.h b/dom/base/Element.h index 22204e7b50c7..27c73f19fdc8 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -707,8 +707,9 @@ public: * @param aOldValueSet [out] Indicates whether an old attribute value has been * stored in aOldValue. The bool will be set to true if a value was stored. */ - bool MaybeCheckSameAttrVal(int32_t aNamespaceID, nsAtom* aName, - nsAtom* aPrefix, + bool MaybeCheckSameAttrVal(int32_t aNamespaceID, + const nsAtom* aName, + const nsAtom* aPrefix, const nsAttrValueOrString& aValue, bool aNotify, nsAttrValue& aOldValue, uint8_t* aModType, bool* aHasListeners, @@ -765,9 +766,9 @@ public: * GetAttr is not inlined on purpose, to keep down codesize from all the * inlined nsAttrValue bits for C++ callers. */ - bool GetAttr(int32_t aNameSpaceID, nsAtom* aName, nsAString& aResult) const; + bool GetAttr(int32_t aNameSpaceID, const nsAtom* aName, nsAString& aResult) const; - bool GetAttr(nsAtom* aName, nsAString& aResult) const + bool GetAttr(const nsAtom* aName, nsAString& aResult) const { return GetAttr(kNameSpaceID_None, aName, aResult); } @@ -780,9 +781,9 @@ public: * @param aAttr the attribute name * @return whether an attribute exists */ - inline bool HasAttr(int32_t aNameSpaceID, nsAtom* aName) const; + inline bool HasAttr(int32_t aNameSpaceID, const nsAtom* aName) const; - bool HasAttr(nsAtom* aAttr) const + bool HasAttr(const nsAtom* aAttr) const { return HasAttr(kNameSpaceID_None, aAttr); } @@ -797,7 +798,7 @@ public: * @param aValue The value to compare to. * @param aCaseSensitive Whether to do a case-sensitive compare on the value. */ - inline bool AttrValueIs(int32_t aNameSpaceID, nsAtom* aName, + inline bool AttrValueIs(int32_t aNameSpaceID, const nsAtom* aName, const nsAString& aValue, nsCaseTreatment aCaseSensitive) const; @@ -812,8 +813,8 @@ public: * @param aCaseSensitive Whether to do a case-sensitive compare on the value. */ bool AttrValueIs(int32_t aNameSpaceID, - nsAtom* aName, - nsAtom* aValue, + const nsAtom* aName, + const nsAtom* aValue, nsCaseTreatment aCaseSensitive) const; enum { @@ -838,7 +839,7 @@ public: */ typedef nsStaticAtom* const AttrValuesArray; int32_t FindAttrValueIn(int32_t aNameSpaceID, - nsAtom* aName, + const nsAtom* aName, AttrValuesArray* aValues, nsCaseTreatment aCaseSensitive) const; @@ -1014,7 +1015,7 @@ private: uint32_t aMapCount); protected: - inline bool GetAttr(int32_t aNameSpaceID, nsAtom* aName, + inline bool GetAttr(int32_t aNameSpaceID, const nsAtom* aName, DOMString& aResult) const { NS_ASSERTION(nullptr != aName, "must have attribute name"); @@ -1463,12 +1464,12 @@ public: return HasServoData() && Servo_Element_IsDisplayContents(this); } - const nsAttrValue* GetParsedAttr(nsAtom* aAttr) const + const nsAttrValue* GetParsedAttr(const nsAtom* aAttr) const { return mAttrs.GetAttr(aAttr); } - const nsAttrValue* GetParsedAttr(nsAtom* aAttr, int32_t aNameSpaceID) const + const nsAttrValue* GetParsedAttr(const nsAtom* aAttr, int32_t aNameSpaceID) const { return mAttrs.GetAttr(aAttr, aNameSpaceID); } @@ -1497,7 +1498,7 @@ public: * is, this should only be called from methods that only care about attrs * that effectively live in mAttrs. */ - BorrowedAttrInfo GetAttrInfo(int32_t aNamespaceID, nsAtom* aName) const + BorrowedAttrInfo GetAttrInfo(int32_t aNamespaceID, const nsAtom* aName) const { NS_ASSERTION(aName, "must have attribute name"); NS_ASSERTION(aNamespaceID != kNameSpaceID_Unknown, @@ -2018,7 +2019,7 @@ private: NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID) inline bool -Element::HasAttr(int32_t aNameSpaceID, nsAtom* aName) const +Element::HasAttr(int32_t aNameSpaceID, const nsAtom* aName) const { NS_ASSERTION(nullptr != aName, "must have attribute name"); NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, @@ -2029,7 +2030,7 @@ Element::HasAttr(int32_t aNameSpaceID, nsAtom* aName) const inline bool Element::AttrValueIs(int32_t aNameSpaceID, - nsAtom* aName, + const nsAtom* aName, const nsAString& aValue, nsCaseTreatment aCaseSensitive) const { @@ -2042,8 +2043,8 @@ Element::AttrValueIs(int32_t aNameSpaceID, inline bool Element::AttrValueIs(int32_t aNameSpaceID, - nsAtom* aName, - nsAtom* aValue, + const nsAtom* aName, + const nsAtom* aValue, nsCaseTreatment aCaseSensitive) const { NS_ASSERTION(aName, "Must have attr name"); diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 85ca6485464f..c4d19b147d45 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -883,17 +883,18 @@ FragmentOrElement::GetChildren(uint32_t aFilter) return list.forget(); } -static nsIContent* -FindChromeAccessOnlySubtreeOwner(nsIContent* aContent) +static nsINode* +FindChromeAccessOnlySubtreeOwner(nsINode* aNode) { - if (aContent->ChromeOnlyAccess()) { - bool chromeAccessOnly = false; - while (aContent && !chromeAccessOnly) { - chromeAccessOnly = aContent->IsRootOfChromeAccessOnlySubtree(); - aContent = aContent->GetParent(); - } + if (!aNode->ChromeOnlyAccess()) { + return aNode; } - return aContent; + + while (aNode && !aNode->IsRootOfChromeAccessOnlySubtree()) { + aNode = aNode->GetParentNode(); + } + + return aNode ? aNode->GetParentOrHostNode() : nullptr; } already_AddRefed @@ -904,11 +905,7 @@ FindChromeAccessOnlySubtreeOwner(EventTarget* aTarget) return node.forget(); } - if (!node->IsContent()) { - return nullptr; - } - - node = FindChromeAccessOnlySubtreeOwner(node->AsContent()); + node = FindChromeAccessOnlySubtreeOwner(node); return node.forget(); } @@ -951,9 +948,9 @@ nsIContent::GetEventTargetParent(EventChainPreVisitor& aVisitor) (aVisitor.mEvent->mOriginalTarget == this && (aVisitor.mRelatedTargetIsInAnon = relatedTarget->ChromeOnlyAccess()))) { - nsIContent* anonOwner = FindChromeAccessOnlySubtreeOwner(this); + nsINode* anonOwner = FindChromeAccessOnlySubtreeOwner(this); if (anonOwner) { - nsIContent* anonOwnerRelated = + nsINode* anonOwnerRelated = FindChromeAccessOnlySubtreeOwner(relatedTarget); if (anonOwnerRelated) { // Note, anonOwnerRelated may still be inside some other diff --git a/dom/base/NodeInfo.h b/dom/base/NodeInfo.h index 6d157f837fe2..e2c705b1d0b3 100644 --- a/dom/base/NodeInfo.h +++ b/dom/base/NodeInfo.h @@ -154,23 +154,23 @@ public: bool NameAndNamespaceEquals(NodeInfo* aNodeInfo) const; - bool Equals(nsAtom* aNameAtom) const + bool Equals(const nsAtom* aNameAtom) const { return mInner.mName == aNameAtom; } - bool Equals(nsAtom* aNameAtom, nsAtom* aPrefixAtom) const + bool Equals(const nsAtom* aNameAtom, const nsAtom* aPrefixAtom) const { return (mInner.mName == aNameAtom) && (mInner.mPrefix == aPrefixAtom); } - bool Equals(nsAtom* aNameAtom, int32_t aNamespaceID) const + bool Equals(const nsAtom* aNameAtom, int32_t aNamespaceID) const { return ((mInner.mName == aNameAtom) && (mInner.mNamespaceID == aNamespaceID)); } - bool Equals(nsAtom* aNameAtom, nsAtom* aPrefixAtom, int32_t aNamespaceID) const + bool Equals(const nsAtom* aNameAtom, const nsAtom* aPrefixAtom, int32_t aNamespaceID) const { return ((mInner.mName == aNameAtom) && (mInner.mPrefix == aPrefixAtom) && @@ -192,7 +192,7 @@ public: bool NamespaceEquals(const nsAString& aNamespaceURI) const; - inline bool QualifiedNameEquals(nsAtom* aNameAtom) const; + inline bool QualifiedNameEquals(const nsAtom* aNameAtom) const; bool QualifiedNameEquals(const nsAString& aQualifiedName) const { diff --git a/dom/base/NodeInfoInlines.h b/dom/base/NodeInfoInlines.h index d16e846517c9..e2917e0e1cde 100644 --- a/dom/base/NodeInfoInlines.h +++ b/dom/base/NodeInfoInlines.h @@ -58,7 +58,7 @@ NodeInfo::Equals(const nsAString& aName, const nsAString& aPrefix, } inline bool -NodeInfo::QualifiedNameEquals(nsAtom* aNameAtom) const +NodeInfo::QualifiedNameEquals(const nsAtom* aNameAtom) const { MOZ_ASSERT(aNameAtom, "Must have name atom"); if (!GetPrefixAtom()) { @@ -72,8 +72,8 @@ NodeInfo::QualifiedNameEquals(nsAtom* aNameAtom) const } // namespace mozilla inline void -CheckValidNodeInfo(uint16_t aNodeType, nsAtom *aName, int32_t aNamespaceID, - nsAtom* aExtraName) +CheckValidNodeInfo(uint16_t aNodeType, const nsAtom *aName, + int32_t aNamespaceID, const nsAtom* aExtraName) { MOZ_ASSERT(aNodeType == nsINode::ELEMENT_NODE || aNodeType == nsINode::ATTRIBUTE_NODE || diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index 25d18a27d7e3..0a24a34712b3 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -211,6 +211,8 @@ public: void SetIsUAWidget() { + MOZ_ASSERT(!HasChildren()); + SetFlags(NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS | NODE_CHROME_ONLY_ACCESS); mIsUAWidget = true; } diff --git a/dom/base/nsAttrName.h b/dom/base/nsAttrName.h index df5418c8229d..473b4f676122 100644 --- a/dom/base/nsAttrName.h +++ b/dom/base/nsAttrName.h @@ -105,7 +105,7 @@ public: // call this function on nsAttrName structs with 0 mBits, so no attempt // must be made to do anything with mBits besides comparing it with the // incoming aAtom argument. - bool Equals(nsAtom* aAtom) const + bool Equals(const nsAtom* aAtom) const { return reinterpret_cast(aAtom) == mBits; } @@ -116,7 +116,7 @@ public: return IsAtom() && Atom()->Equals(aLocalName); } - bool Equals(nsAtom* aLocalName, int32_t aNamespaceID) const + bool Equals(const nsAtom* aLocalName, int32_t aNamespaceID) const { if (aNamespaceID == kNameSpaceID_None) { return Equals(aLocalName); @@ -187,7 +187,7 @@ public: return mBits - 0; } - bool IsSmaller(nsAtom* aOther) const + bool IsSmaller(const nsAtom* aOther) const { return mBits < reinterpret_cast(aOther); } diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp index 7edbef56b491..826f834e79d1 100644 --- a/dom/base/nsAttrValue.cpp +++ b/dom/base/nsAttrValue.cpp @@ -1099,7 +1099,7 @@ nsAttrValue::Equals(const nsAString& aValue, } bool -nsAttrValue::Equals(nsAtom* aValue, nsCaseTreatment aCaseSensitive) const +nsAttrValue::Equals(const nsAtom* aValue, nsCaseTreatment aCaseSensitive) const { if (aCaseSensitive != eCaseMatters) { // Need a better way to handle this! diff --git a/dom/base/nsAttrValue.h b/dom/base/nsAttrValue.h index 62bee69de5e6..222455a9d492 100644 --- a/dom/base/nsAttrValue.h +++ b/dom/base/nsAttrValue.h @@ -219,7 +219,7 @@ public: bool Equals(const nsAttrValue& aOther) const; // aCaseSensitive == eIgnoreCase means ASCII case-insenstive matching bool Equals(const nsAString& aValue, nsCaseTreatment aCaseSensitive) const; - bool Equals(nsAtom* aValue, nsCaseTreatment aCaseSensitive) const; + bool Equals(const nsAtom* aValue, nsCaseTreatment aCaseSensitive) const; /** * Compares this object with aOther according to their string representation. diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 55705a5b2b8b..40acb7307961 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2093,9 +2093,18 @@ nsContentUtils::CanCallerAccess(nsIPrincipal* aSubjectPrincipal, // static bool -nsContentUtils::CanCallerAccess(nsINode* aNode) +nsContentUtils::CanCallerAccess(const nsINode* aNode) { - return CanCallerAccess(SubjectPrincipal(), aNode->NodePrincipal()); + nsIPrincipal* subject = SubjectPrincipal(); + if (IsSystemPrincipal(subject)) { + return true; + } + + if (aNode->ChromeOnlyAccess()) { + return false; + } + + return CanCallerAccess(subject, aNode->NodePrincipal()); } // static diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 370900b26b8c..5dd13e0bbd91 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -634,7 +634,7 @@ public: const nsINode* unTrustedNode); // Check if the (JS) caller can access aNode. - static bool CanCallerAccess(nsINode* aNode); + static bool CanCallerAccess(const nsINode* aNode); // Check if the (JS) caller can access aWindow. // aWindow can be either outer or inner window. diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index d8818ce80c55..ed10131a22b8 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -178,26 +178,6 @@ public: */ virtual already_AddRefed GetChildren(uint32_t aFilter) = 0; - /** - * Get whether this content is C++-generated anonymous content - * @see nsIAnonymousContentCreator - * @return whether this content is anonymous - */ - bool IsRootOfNativeAnonymousSubtree() const - { - NS_ASSERTION(!HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT) || - (HasFlag(NODE_IS_ANONYMOUS_ROOT) && - HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE)), - "Some flags seem to be missing!"); - return HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT); - } - - bool IsRootOfChromeAccessOnlySubtree() const - { - return HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT | - NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS); - } - /** * Makes this content anonymous * @see nsIAnonymousContentCreator @@ -273,7 +253,7 @@ public: return IsInNamespace(kNameSpaceID_XHTML); } - inline bool IsHTMLElement(nsAtom* aTag) const + inline bool IsHTMLElement(const nsAtom* aTag) const { return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML); } @@ -289,7 +269,7 @@ public: return IsInNamespace(kNameSpaceID_SVG); } - inline bool IsSVGElement(nsAtom* aTag) const + inline bool IsSVGElement(const nsAtom* aTag) const { return mNodeInfo->Equals(aTag, kNameSpaceID_SVG); } @@ -305,7 +285,7 @@ public: return IsInNamespace(kNameSpaceID_XUL); } - inline bool IsXULElement(nsAtom* aTag) const + inline bool IsXULElement(const nsAtom* aTag) const { return mNodeInfo->Equals(aTag, kNameSpaceID_XUL); } @@ -321,7 +301,7 @@ public: return IsInNamespace(kNameSpaceID_MathML); } - inline bool IsMathMLElement(nsAtom* aTag) const + inline bool IsMathMLElement(const nsAtom* aTag) const { return mNodeInfo->Equals(aTag, kNameSpaceID_MathML); } diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 1286e5635abd..b764c7841407 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -173,7 +173,7 @@ nsINode::~nsINode() } void* -nsINode::GetProperty(nsAtom* aPropertyName, nsresult* aStatus) const +nsINode::GetProperty(const nsAtom* aPropertyName, nsresult* aStatus) const { if (!HasProperties()) { // a fast HasFlag() test if (aStatus) { @@ -204,13 +204,13 @@ nsINode::SetProperty(nsAtom* aPropertyName, } void -nsINode::DeleteProperty(nsAtom* aPropertyName) +nsINode::DeleteProperty(const nsAtom* aPropertyName) { OwnerDoc()->PropertyTable().DeleteProperty(this, aPropertyName); } void* -nsINode::UnsetProperty(nsAtom* aPropertyName, nsresult* aStatus) +nsINode::UnsetProperty(const nsAtom* aPropertyName, nsresult* aStatus) { return OwnerDoc()->PropertyTable().UnsetProperty(this, aPropertyName, aStatus); } diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 616ba11633b6..0a9da4874bea 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -731,7 +731,7 @@ public: return IsElement() && IsInNamespace(kNameSpaceID_XHTML); } - inline bool IsHTMLElement(nsAtom* aTag) const + inline bool IsHTMLElement(const nsAtom* aTag) const { return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_XHTML); } @@ -747,7 +747,7 @@ public: return IsElement() && IsInNamespace(kNameSpaceID_SVG); } - inline bool IsSVGElement(nsAtom* aTag) const + inline bool IsSVGElement(const nsAtom* aTag) const { return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_SVG); } @@ -763,7 +763,7 @@ public: return IsElement() && IsInNamespace(kNameSpaceID_XUL); } - inline bool IsXULElement(nsAtom* aTag) const + inline bool IsXULElement(const nsAtom* aTag) const { return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_XUL); } @@ -779,7 +779,7 @@ public: return IsElement() && IsInNamespace(kNameSpaceID_MathML); } - inline bool IsMathMLElement(nsAtom* aTag) const + inline bool IsMathMLElement(const nsAtom* aTag) const { return IsElement() && mNodeInfo->Equals(aTag, kNameSpaceID_MathML); } @@ -865,7 +865,7 @@ public: * (though a null return value does not imply the * property was not set, i.e. it can be set to null). */ - void* GetProperty(nsAtom* aPropertyName, nsresult* aStatus = nullptr) const; + void* GetProperty(const nsAtom* aPropertyName, nsresult* aStatus = nullptr) const; /** * Set a property to be associated with this node. This will overwrite an @@ -904,7 +904,7 @@ public: * * @param aPropertyName name of property to destroy. */ - void DeleteProperty(nsAtom* aPropertyName); + void DeleteProperty(const nsAtom* aPropertyName); /** * Unset a property associated with this node. The value will not be @@ -919,7 +919,7 @@ public: * (though a null return value does not imply the * property was not set, i.e. it can be set to null). */ - void* UnsetProperty(nsAtom* aPropertyName, nsresult* aStatus = nullptr); + void* UnsetProperty(const nsAtom* aPropertyName, nsresult* aStatus = nullptr); bool HasProperties() const { @@ -1232,6 +1232,26 @@ public: return HasFlag(NODE_IS_IN_SHADOW_TREE); } + /** + * Get whether this node is C++-generated anonymous content + * @see nsIAnonymousContentCreator + * @return whether this content is anonymous + */ + bool IsRootOfNativeAnonymousSubtree() const + { + NS_ASSERTION(!HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT) || + (HasFlag(NODE_IS_ANONYMOUS_ROOT) && + HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE)), + "Some flags seem to be missing!"); + return HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT); + } + + bool IsRootOfChromeAccessOnlySubtree() const + { + return HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT | + NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS); + } + /** * Returns true if |this| node is the common ancestor of the start/end * nodes of a Range in a Selection or a descendant of such a common ancestor. diff --git a/dom/base/nsMappedAttributes.cpp b/dom/base/nsMappedAttributes.cpp index 3408259c8164..b315e45f5fc7 100644 --- a/dom/base/nsMappedAttributes.cpp +++ b/dom/base/nsMappedAttributes.cpp @@ -175,7 +175,7 @@ nsMappedAttributes::SetAndSwapAttr(nsAtom* aAttrName, nsAttrValue& aValue, } const nsAttrValue* -nsMappedAttributes::GetAttr(nsAtom* aAttrName) const +nsMappedAttributes::GetAttr(const nsAtom* aAttrName) const { MOZ_ASSERT(aAttrName, "null name"); @@ -278,7 +278,7 @@ nsMappedAttributes::GetExistingAttrNameFromQName(const nsAString& aName) const } int32_t -nsMappedAttributes::IndexOfAttr(nsAtom* aLocalName) const +nsMappedAttributes::IndexOfAttr(const nsAtom* aLocalName) const { uint32_t i; for (i = 0; i < mAttrCount; ++i) { diff --git a/dom/base/nsMappedAttributes.h b/dom/base/nsMappedAttributes.h index 45279df31973..417346056a2a 100644 --- a/dom/base/nsMappedAttributes.h +++ b/dom/base/nsMappedAttributes.h @@ -35,7 +35,7 @@ public: void SetAndSwapAttr(nsAtom* aAttrName, nsAttrValue& aValue, bool* aValueWasSet); - const nsAttrValue* GetAttr(nsAtom* aAttrName) const; + const nsAttrValue* GetAttr(const nsAtom* aAttrName) const; const nsAttrValue* GetAttr(const nsAString& aAttrName) const; uint32_t Count() const @@ -75,7 +75,7 @@ public: // aValue; any value that was already in aValue is destroyed. void RemoveAttrAt(uint32_t aPos, nsAttrValue& aValue); const nsAttrName* GetExistingAttrNameFromQName(const nsAString& aName) const; - int32_t IndexOfAttr(nsAtom* aLocalName) const; + int32_t IndexOfAttr(const nsAtom* aLocalName) const; // Apply the contained mapper to the contained set of servo rules, // unless the servo rules have already been initialized. diff --git a/dom/base/nsPropertyTable.cpp b/dom/base/nsPropertyTable.cpp index bfef34248c5f..9e113f476527 100644 --- a/dom/base/nsPropertyTable.cpp +++ b/dom/base/nsPropertyTable.cpp @@ -41,7 +41,7 @@ public: // Destroy all remaining properties (without removing them) void Destroy(); - bool Equals(nsAtom *aPropertyName) + bool Equals(const nsAtom *aPropertyName) { return mName == aPropertyName; } @@ -136,7 +136,7 @@ nsPropertyTable::EnumerateAll(NSPropertyFunc aCallBack, void* aData) void* nsPropertyTable::GetPropertyInternal(nsPropertyOwner aObject, - nsAtom* aPropertyName, + const nsAtom* aPropertyName, bool aRemove, nsresult* aResult) { @@ -216,7 +216,7 @@ nsPropertyTable::SetPropertyInternal(nsPropertyOwner aObject, nsresult nsPropertyTable::DeleteProperty(nsPropertyOwner aObject, - nsAtom* aPropertyName) + const nsAtom* aPropertyName) { MOZ_ASSERT(aPropertyName && aObject, "unexpected null param"); @@ -230,7 +230,7 @@ nsPropertyTable::DeleteProperty(nsPropertyOwner aObject, } nsPropertyTable::PropertyList* -nsPropertyTable::GetPropertyListFor(nsAtom* aPropertyName) const +nsPropertyTable::GetPropertyListFor(const nsAtom* aPropertyName) const { PropertyList* result; diff --git a/dom/base/nsPropertyTable.h b/dom/base/nsPropertyTable.h index 9d9efc0a379f..bda8a7f7d688 100644 --- a/dom/base/nsPropertyTable.h +++ b/dom/base/nsPropertyTable.h @@ -61,7 +61,7 @@ class nsPropertyTable * |aResult|, if supplied, is filled in with a return status code. **/ void* GetProperty(const nsPropertyOwner& aObject, - nsAtom *aPropertyName, + const nsAtom *aPropertyName, nsresult *aResult = nullptr) { return GetPropertyInternal(aObject, aPropertyName, false, aResult); @@ -97,7 +97,7 @@ class nsPropertyTable * Delete the property |aPropertyName| in the global category for object * |aObject|. The property's destructor function will be called. */ - nsresult DeleteProperty(nsPropertyOwner aObject, nsAtom* aPropertyName); + nsresult DeleteProperty(nsPropertyOwner aObject, const nsAtom* aPropertyName); /** * Unset the property |aPropertyName| in the global category for object @@ -105,7 +105,7 @@ class nsPropertyTable * property value is returned. */ void* UnsetProperty(const nsPropertyOwner& aObject, - nsAtom* aPropertyName, + const nsAtom* aPropertyName, nsresult* aStatus = nullptr) { return GetPropertyInternal(aObject, aPropertyName, true, aStatus); @@ -167,9 +167,9 @@ class nsPropertyTable private: void DestroyPropertyList(); - PropertyList* GetPropertyListFor(nsAtom* aPropertyName) const; + PropertyList* GetPropertyListFor(const nsAtom* aPropertyName) const; void* GetPropertyInternal(nsPropertyOwner aObject, - nsAtom* aPropertyName, + const nsAtom* aPropertyName, bool aRemove, nsresult* aStatus); nsresult SetPropertyInternal(nsPropertyOwner aObject, diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 5b22faae0aca..2a00cbf40597 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -4957,6 +4957,7 @@ WorkerPrivate::ConnectMessagePort(JSContext* aCx, } RootedDictionary init(aCx); + init.mData = JS_GetEmptyStringValue(aCx); init.mBubbles = false; init.mCancelable = false; init.mSource.SetValue().SetAsMessagePort() = port; diff --git a/gfx/layers/LayersLogging.h b/gfx/layers/LayersLogging.h index 4c747899772c..1fc09fe05133 100644 --- a/gfx/layers/LayersLogging.h +++ b/gfx/layers/LayersLogging.h @@ -14,6 +14,7 @@ #include "mozilla/gfx/Types.h" // for SamplingFilter, SurfaceFormat #include "mozilla/layers/CompositorTypes.h" // for TextureFlags #include "mozilla/layers/WebRenderLayersLogging.h" +#include "mozilla/layers/ZoomConstraints.h" #include "nsAString.h" #include "nsPrintfCString.h" // for nsPrintfCString #include "nsRegion.h" // for nsRegion, nsIntRegion diff --git a/gfx/layers/wr/IpcResourceUpdateQueue.h b/gfx/layers/wr/IpcResourceUpdateQueue.h index 6e71e5151ce5..a63d75438d66 100644 --- a/gfx/layers/wr/IpcResourceUpdateQueue.h +++ b/gfx/layers/wr/IpcResourceUpdateQueue.h @@ -9,6 +9,7 @@ #include "mozilla/layers/WebRenderMessages.h" #include "mozilla/layers/RefCountedShmem.h" +#include "mozilla/layers/TextureClient.h" #include "mozilla/webrender/WebRenderTypes.h" namespace mozilla { diff --git a/gfx/webrender_bindings/WebRenderAPI.h b/gfx/webrender_bindings/WebRenderAPI.h index 17c3a1f98603..575366c5be82 100644 --- a/gfx/webrender_bindings/WebRenderAPI.h +++ b/gfx/webrender_bindings/WebRenderAPI.h @@ -13,6 +13,7 @@ #include "mozilla/AlreadyAddRefed.h" #include "mozilla/gfx/CompositorHitTestInfo.h" +#include "mozilla/layers/IpcResourceUpdateQueue.h" #include "mozilla/layers/ScrollableLayerGuid.h" #include "mozilla/layers/SyncObject.h" #include "mozilla/Range.h" diff --git a/js/src/builtin/String.cpp b/js/src/builtin/String.cpp index d90298b3e048..8079d7db6195 100644 --- a/js/src/builtin/String.cpp +++ b/js/src/builtin/String.cpp @@ -2744,6 +2744,18 @@ BuildFlatRopeReplacement(JSContext* cx, HandleString textstr, HandleLinearString } RopeBuilder builder(cx); + + /* + * Special case when the pattern string is '', which matches to the + * head of the string and doesn't overlap with any component of the rope. + */ + if (patternLength == 0) { + MOZ_ASSERT(match == 0); + if (!builder.append(repstr)) { + return nullptr; + } + } + size_t pos = 0; while (!r.empty()) { RootedString str(cx, r.front()); diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index e4d6c73e13cf..43e3973f3a95 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1722,6 +1722,21 @@ NewRope(JSContext* cx, unsigned argc, Value* vp) return true; } +static bool +IsRope(JSContext* cx, unsigned argc, Value* vp) +{ + CallArgs args = CallArgsFromVp(argc, vp); + + if (!args.get(0).isString()) { + JS_ReportErrorASCII(cx, "isRope requires a string argument."); + return false; + } + + JSString* str = args[0].toString(); + args.rval().setBoolean(str->isRope()); + return true; +} + static bool EnsureFlatString(JSContext* cx, unsigned argc, Value* vp) { @@ -5950,6 +5965,10 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = { " Available options:\n" " nursery: bool - force the string to be created in/out of the nursery, if possible.\n"), + JS_FN_HELP("isRope", IsRope, 1, 0, +"isRope(str)", +" Returns true if the parameter is a rope"), + JS_FN_HELP("settlePromiseNow", SettlePromiseNow, 1, 0, "settlePromiseNow(promise)", " 'Settle' a 'promise' immediately. This just marks the promise as resolved\n" diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h index f62c4f7fc80d..2ff1f061c331 100644 --- a/js/src/jit/MacroAssembler.h +++ b/js/src/jit/MacroAssembler.h @@ -1613,7 +1613,8 @@ class MacroAssembler : public MacroAssemblerSpecific void wasmCallImport(const wasm::CallSiteDesc& desc, const wasm::CalleeDesc& callee); // WasmTableCallIndexReg must contain the index of the indirect call. - void wasmCallIndirect(const wasm::CallSiteDesc& desc, const wasm::CalleeDesc& callee, bool needsBoundsCheck); + void wasmCallIndirect(const wasm::CallSiteDesc& desc, const wasm::CalleeDesc& callee, + bool needsBoundsCheck); // This function takes care of loading the pointer to the current instance // as the implicit first argument. It preserves TLS and pinned registers. diff --git a/js/src/tests/non262/String/replace-rope-empty.js b/js/src/tests/non262/String/replace-rope-empty.js new file mode 100644 index 000000000000..89f9bc83b3fd --- /dev/null +++ b/js/src/tests/non262/String/replace-rope-empty.js @@ -0,0 +1,28 @@ +var BUGNUMBER = 1509768; +var summary = "String#replace with an empty string pattern on a rope should prepend the replacement string."; + +print(BUGNUMBER + ": " + summary); + +// Rope is created when the string length >= 24. +// +// This testcase depends on that condition to reliably test the code for +// String#replace on a rope. +// +// Please rewrite this testcase when the following assertion fails. +assertEq(isRope("a".repeat(23)), false); +assertEq(isRope("a".repeat(24)), true); + +// Not a rope. +assertEq("a".repeat(23).replace("", "foo"), + "foo" + "a".repeat(23)); +assertEq("a".repeat(23).replace("", ""), + "a".repeat(23)); + +// A rope. +assertEq("a".repeat(24).replace("", "foo"), + "foo" + "a".repeat(24)); +assertEq("a".repeat(24).replace("", ""), + "a".repeat(24)); + +if (typeof reportCompare === "function") + reportCompare(true, true); diff --git a/js/src/wasm/WasmCompile.cpp b/js/src/wasm/WasmCompile.cpp index c69a90f2895d..76d35ca892ba 100644 --- a/js/src/wasm/WasmCompile.cpp +++ b/js/src/wasm/WasmCompile.cpp @@ -542,18 +542,6 @@ wasm::CompileBuffer(const CompileArgs& args, const ShareableBytes& bytecode, Uni return nullptr; } -#ifdef ENABLE_WASM_CRANELIFT - if (compilerEnv.tier() == Tier::Optimized && - compilerEnv.optimizedBackend() == OptimizedBackend::Cranelift) - { - // At the moment, Cranelift performs no validation, so validate - // explicitly. - if (!ValidateForCranelift(bytecode, error)) { - return nullptr; - } - } -#endif - ModuleGenerator mg(args, &env, nullptr, error); if (!mg.init()) { return nullptr; diff --git a/js/src/wasm/WasmCraneliftCompile.cpp b/js/src/wasm/WasmCraneliftCompile.cpp index 28fc346035e5..392bf23dbfec 100644 --- a/js/src/wasm/WasmCraneliftCompile.cpp +++ b/js/src/wasm/WasmCraneliftCompile.cpp @@ -279,10 +279,12 @@ wasm::CraneliftCompileFunctions(const ModuleEnvironment& env, LifoAlloc& lifo, const FuncCompileInputVector& inputs, CompiledCode* code, + ExclusiveDeferredValidationState& dvs, UniqueChars* error) { MOZ_ASSERT(env.tier() == Tier::Optimized); MOZ_ASSERT(env.optimizedBackend() == OptimizedBackend::Cranelift); + MOZ_ASSERT(!env.isAsmJS()); AutoCranelift compiler(env); if (!compiler.init()) { @@ -301,6 +303,11 @@ wasm::CraneliftCompileFunctions(const ModuleEnvironment& env, } for (const FuncCompileInput& func : inputs) { + Decoder d(func.begin, func.end, func.lineOrBytecode, error); + if (!ValidateFunctionBody(env, func.index, func.end - func.begin, d, dvs)) { + return false; + } + CraneliftFuncCompileInput clifInput(func); CraneliftCompiledFunc clifFunc; diff --git a/js/src/wasm/WasmCraneliftCompile.h b/js/src/wasm/WasmCraneliftCompile.h index 5316dfa37772..1cadb35f4e86 100644 --- a/js/src/wasm/WasmCraneliftCompile.h +++ b/js/src/wasm/WasmCraneliftCompile.h @@ -32,6 +32,7 @@ CraneliftCompileFunctions(const ModuleEnvironment& env, LifoAlloc& lifo, const FuncCompileInputVector& inputs, CompiledCode* code, + ExclusiveDeferredValidationState& dvs, UniqueChars* error); } // namespace wasm diff --git a/js/src/wasm/WasmGenerator.cpp b/js/src/wasm/WasmGenerator.cpp index 5e881cc560e0..2d4d6dad5e4d 100644 --- a/js/src/wasm/WasmGenerator.cpp +++ b/js/src/wasm/WasmGenerator.cpp @@ -672,7 +672,7 @@ ExecuteCompileTask(CompileTask* task, UniqueChars* error) #ifdef ENABLE_WASM_CRANELIFT if (task->env.optimizedBackend() == OptimizedBackend::Cranelift) { if (!CraneliftCompileFunctions(task->env, task->lifo, task->inputs, &task->output, - error)) + task->dvs, error)) { return false; } diff --git a/js/src/wasm/WasmValidate.cpp b/js/src/wasm/WasmValidate.cpp index 9e50637d7849..0d92c1900615 100644 --- a/js/src/wasm/WasmValidate.cpp +++ b/js/src/wasm/WasmValidate.cpp @@ -2533,8 +2533,7 @@ DecodeFunctionBody(Decoder& d, const ModuleEnvironment& env, } static bool -DecodeCodeSection(Decoder& d, ModuleEnvironment* env, - ExclusiveDeferredValidationState& dvs) +DecodeCodeSection(Decoder& d, ModuleEnvironment* env, ExclusiveDeferredValidationState& dvs) { if (!env->codeSection) { if (env->numFuncDefs() != 0) { @@ -2863,35 +2862,3 @@ wasm::Validate(JSContext* cx, const ShareableBytes& bytecode, UniqueChars* error MOZ_ASSERT(!*error, "unreported error in decoding"); return true; } - -bool -wasm::ValidateForCranelift(const ShareableBytes& bytecode, UniqueChars* error) -{ - Decoder d(bytecode.bytes, 0, error); - - // Cranelift doesn't support GC yet. - HasGcTypes hasGcTypes = HasGcTypes::False; - - // Cranelift doesn't support threads yet. - Shareable threadSupport = Shareable::False; - - CompilerEnvironment compilerEnv(CompileMode::Once, Tier::Optimized, - OptimizedBackend::Cranelift, DebugEnabled::False, hasGcTypes); - ModuleEnvironment env(hasGcTypes, &compilerEnv, threadSupport); - - if (!DecodeModuleEnvironment(d, &env)) { - return false; - } - - ExclusiveDeferredValidationState dvs(mutexid::WasmDeferredValidation); - - if (!DecodeCodeSection(d, &env, dvs)) { - return false; - } - if (!DecodeModuleTail(d, &env, dvs)) { - return false; - } - - MOZ_ASSERT(!*error, "unreported error in decoding"); - return true; -} diff --git a/js/src/wasm/WasmValidate.h b/js/src/wasm/WasmValidate.h index 8b3a0b819db9..4361fa809e8f 100644 --- a/js/src/wasm/WasmValidate.h +++ b/js/src/wasm/WasmValidate.h @@ -932,11 +932,6 @@ ConvertMemoryPagesToBytes(Limits* memory); MOZ_MUST_USE bool Validate(JSContext* cx, const ShareableBytes& bytecode, UniqueChars* error); -// Same, but don't require a JSContext. -MOZ_MUST_USE bool -ValidateForCranelift(const ShareableBytes& bytecode, UniqueChars* error); - - } // namespace wasm } // namespace js diff --git a/js/src/wasm/cranelift/build.rs b/js/src/wasm/cranelift/build.rs index 28a07f7f396d..6715ff5ff19d 100644 --- a/js/src/wasm/cranelift/build.rs +++ b/js/src/wasm/cranelift/build.rs @@ -50,24 +50,30 @@ fn main() { "-DRUST_BINDGEN", ]).clang_arg("-I../.."); - let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap()) - .join("js/src/rust/extra-bindgen-flags"); + match env::var_os("MOZ_TOPOBJDIR") { + Some(path) => { + let path = PathBuf::from(path).join("js/src/rust/extra-bindgen-flags"); - let mut extra_flags = String::new(); - File::open(&path) - .expect("Failed to open extra-bindgen-flags file") - .read_to_string(&mut extra_flags) - .expect("Failed to read extra-bindgen-flags file"); + let mut extra_flags = String::new(); + File::open(&path) + .expect("Failed to open extra-bindgen-flags file") + .read_to_string(&mut extra_flags) + .expect("Failed to read extra-bindgen-flags file"); - let display_path = path.to_str().expect("path is utf8 encoded"); - println!("cargo:rerun-if-changed={}", display_path); + let display_path = path.to_str().expect("path is utf8 encoded"); + println!("cargo:rerun-if-changed={}", display_path); - let extra_flags: Vec = extra_flags - .split_whitespace() - .map(|s| s.to_owned()) - .collect(); - for flag in extra_flags { - bindings = bindings.clang_arg(flag); + let extra_flags: Vec = extra_flags + .split_whitespace() + .map(|s| s.to_owned()) + .collect(); + for flag in extra_flags { + bindings = bindings.clang_arg(flag); + } + } + None => { + println!("cargo:warning={}", "MOZ_TOPOBJDIR should be set by default, otherwise the build is not guaranted to finish."); + } } let bindings = bindings diff --git a/js/src/wasm/cranelift/src/baldrapi.rs b/js/src/wasm/cranelift/src/baldrapi.rs index 1513757710e4..1f02c2d93b52 100644 --- a/js/src/wasm/cranelift/src/baldrapi.rs +++ b/js/src/wasm/cranelift/src/baldrapi.rs @@ -23,7 +23,7 @@ use cranelift_codegen::binemit::CodeOffset; use cranelift_codegen::entity::EntityRef; -use cranelift_codegen::ir; +use cranelift_codegen::ir::SourceLoc; use cranelift_wasm::FuncIndex; use compile::CompiledFunc; @@ -51,7 +51,7 @@ impl CraneliftCompiledFunc { } impl CraneliftMetadataEntry { - pub fn direct_call(offset: CodeOffset, func_index: FuncIndex, srcloc: ir::SourceLoc) -> Self { + pub fn direct_call(offset: CodeOffset, func_index: FuncIndex, srcloc: SourceLoc) -> Self { Self { which: CraneliftMetadataEntry_Which_DirectCall, offset, @@ -60,7 +60,7 @@ impl CraneliftMetadataEntry { } } - pub fn indirect_call(offset: CodeOffset, srcloc: ir::SourceLoc) -> Self { + pub fn indirect_call(offset: CodeOffset, srcloc: SourceLoc) -> Self { Self { which: CraneliftMetadataEntry_Which_IndirectCall, offset, @@ -69,7 +69,7 @@ impl CraneliftMetadataEntry { } } - pub fn trap(offset: CodeOffset, srcloc: ir::SourceLoc, which: Trap) -> Self { + pub fn trap(offset: CodeOffset, srcloc: SourceLoc, which: Trap) -> Self { Self { which: CraneliftMetadataEntry_Which_Trap, offset, @@ -78,7 +78,7 @@ impl CraneliftMetadataEntry { } } - pub fn memory_access(offset: CodeOffset, srcloc: ir::SourceLoc) -> Self { + pub fn memory_access(offset: CodeOffset, srcloc: SourceLoc) -> Self { Self { which: CraneliftMetadataEntry_Which_MemoryAccess, offset, diff --git a/js/src/wasm/cranelift/src/baldrdash.rs b/js/src/wasm/cranelift/src/baldrdash.rs index 97b5f1e6638a..15cf85269f3b 100644 --- a/js/src/wasm/cranelift/src/baldrdash.rs +++ b/js/src/wasm/cranelift/src/baldrdash.rs @@ -17,13 +17,10 @@ // baldrapi but none of the functions. use baldrapi::CraneliftModuleEnvironment; -use cranelift_codegen::binemit::CodeOffset; -use cranelift_codegen::cursor::{Cursor, FuncCursor}; +use cranelift_codegen::cursor::FuncCursor; use cranelift_codegen::entity::EntityRef; use cranelift_codegen::ir::immediates::{Ieee32, Ieee64}; -use cranelift_codegen::ir::stackslot::StackSize; use cranelift_codegen::ir::{self, InstBuilder}; -use cranelift_codegen::{CodegenError, CodegenResult}; use cranelift_wasm::{FuncIndex, GlobalIndex, SignatureIndex, TableIndex}; use std::mem; use std::slice; @@ -40,13 +37,6 @@ pub use baldrapi::FuncTypeIdDescKind; pub use baldrapi::Trap; pub use baldrapi::TypeCode; -pub enum ConstantValue { - I32(i32), - I64(i64), - F32(f32), - F64(f64), -} - /// Convert a `TypeCode` into the equivalent Cranelift type. /// /// We expect Cranelift's `VOID` type to go away in the future, so use `None` to represent a @@ -111,7 +101,7 @@ impl GlobalDesc { let v = baldrapi::global_constantValue(self.0); // Note that the floating point constants below match v.t { - TypeCode::I32 => pos.ins().iconst(ir::types::I32, v.u.i32 as i64), + TypeCode::I32 => pos.ins().iconst(ir::types::I32, i64::from(v.u.i32)), TypeCode::I64 => pos.ins().iconst(ir::types::I64, v.u.i64), TypeCode::F32 => pos.ins().f32const(Ieee32::with_bits(v.u.i32 as u32)), TypeCode::F64 => pos.ins().f64const(Ieee64::with_bits(v.u.i64 as u64)), @@ -201,6 +191,6 @@ impl<'a> ModuleEnvironment<'a> { GlobalDesc(unsafe { baldrapi::env_global(self.env, global_index.index()) }) } pub fn min_memory_length(&self) -> i64 { - self.env.min_memory_length as i64 + i64::from(self.env.min_memory_length) } } diff --git a/js/src/wasm/cranelift/src/compile.rs b/js/src/wasm/cranelift/src/compile.rs index d953b3697b9f..b019cdb1b2fc 100644 --- a/js/src/wasm/cranelift/src/compile.rs +++ b/js/src/wasm/cranelift/src/compile.rs @@ -20,18 +20,14 @@ use baldrdash as bd; use cpu::make_isa; -use cranelift_codegen::binemit::{Addend, CodeOffset, NullTrapSink, Reloc, RelocSink, TrapSink}; -use cranelift_codegen::cursor::{Cursor, FuncCursor}; +use cranelift_codegen::binemit::{Addend, CodeOffset, NullTrapSink, Reloc, RelocSink}; use cranelift_codegen::entity::EntityRef; +use cranelift_codegen::ir; use cranelift_codegen::ir::stackslot::StackSize; -use cranelift_codegen::ir::{InstBuilder, SourceLoc, TrapCode}; use cranelift_codegen::isa::TargetIsa; -use cranelift_codegen::settings::Flags; -use cranelift_codegen::{self, ir}; -use cranelift_codegen::{CodegenError, CodegenResult}; -use cranelift_wasm::{ - self, FuncIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex, WasmResult, -}; +use cranelift_codegen::CodegenResult; +use cranelift_codegen::Context; +use cranelift_wasm::{FuncIndex, FuncTranslator, WasmResult}; use std::fmt; use std::mem; use utils::DashResult; @@ -70,8 +66,8 @@ pub struct BatchCompiler<'a, 'b> { static_environ: &'a bd::StaticEnvironment, environ: bd::ModuleEnvironment<'b>, isa: Box, - context: cranelift_codegen::Context, - trans: cranelift_wasm::FuncTranslator, + context: Context, + trans: FuncTranslator, pub current_func: CompiledFunc, } @@ -85,8 +81,8 @@ impl<'a, 'b> BatchCompiler<'a, 'b> { static_environ, environ, isa: make_isa(static_environ)?, - context: cranelift_codegen::Context::new(), - trans: cranelift_wasm::FuncTranslator::new(), + context: Context::new(), + trans: FuncTranslator::new(), current_func: CompiledFunc::new(), }) } @@ -146,11 +142,7 @@ impl<'a, 'b> BatchCompiler<'a, 'b> { } { - let eenv = &mut EmitEnv::new( - &self.context.func, - &self.environ, - &mut self.current_func.metadata, - ); + let eenv = &mut EmitEnv::new(&mut self.current_func.metadata); let mut trap_sink = NullTrapSink {}; unsafe { let code_buffer = &mut self.current_func.code_buffer; @@ -173,7 +165,7 @@ impl<'a, 'b> BatchCompiler<'a, 'b> { // Cranelift computes the total stack frame size including the pushed return address, // standard SM prologue pushes, and its own stack slots. let total = self.context.func.stack_slots.frame_size.expect("No frame"); - let sm_pushed = self.isa.flags().baldrdash_prologue_words() as StackSize + let sm_pushed = StackSize::from(self.isa.flags().baldrdash_prologue_words()) * mem::size_of::() as StackSize; total .checked_sub(sm_pushed) @@ -277,8 +269,8 @@ impl<'a, 'b> BatchCompiler<'a, 'b> { _ => panic!("Bad format for call"), }; - let func_index = match callee { - &ir::ExternalName::User { + let func_index = match *callee { + ir::ExternalName::User { namespace: 0, index, } => FuncIndex::new(index as usize), @@ -427,27 +419,17 @@ pub fn symbolic_function_name(sym: bd::SymbolicAddress) -> ir::ExternalName { } /// References joined so we can implement `RelocSink`. -struct EmitEnv<'a, 'b, 'c> { - func: &'a ir::Function, - env: &'b bd::ModuleEnvironment<'b>, - metadata: &'c mut Vec, +struct EmitEnv<'a> { + metadata: &'a mut Vec, } -impl<'a, 'b, 'c> EmitEnv<'a, 'b, 'c> { - pub fn new( - func: &'a ir::Function, - env: &'b bd::ModuleEnvironment, - metadata: &'c mut Vec, - ) -> EmitEnv<'a, 'b, 'c> { - EmitEnv { - func, - env, - metadata, - } +impl<'a> EmitEnv<'a> { + pub fn new(metadata: &'a mut Vec) -> EmitEnv<'a> { + EmitEnv { metadata } } } -impl<'a, 'b, 'c> RelocSink for EmitEnv<'a, 'b, 'c> { +impl<'a> RelocSink for EmitEnv<'a> { fn reloc_ebb(&mut self, _offset: CodeOffset, _reloc: Reloc, _ebb_offset: CodeOffset) { unimplemented!(); } @@ -460,14 +442,11 @@ impl<'a, 'b, 'c> RelocSink for EmitEnv<'a, 'b, 'c> { _addend: Addend, ) { // Decode the function name. - match name { - &ir::ExternalName::User { - namespace: 0, - index, - } => { + match *name { + ir::ExternalName::User { namespace: 0, .. } => { // This is a direct function call handled by `emit_metadata` above. } - &ir::ExternalName::User { + ir::ExternalName::User { namespace: 1, index, } => { @@ -478,7 +457,7 @@ impl<'a, 'b, 'c> RelocSink for EmitEnv<'a, 'b, 'c> { self.metadata .push(bd::MetadataEntry::symbolic_access(offset, sym)); } - &ir::ExternalName::LibCall(call) => { + ir::ExternalName::LibCall(call) => { let sym = match call { ir::LibCall::CeilF32 => bd::SymbolicAddress::CeilF32, ir::LibCall::CeilF64 => bd::SymbolicAddress::CeilF64, diff --git a/js/src/wasm/cranelift/src/cpu.rs b/js/src/wasm/cranelift/src/cpu.rs index ae3c5fb7f915..88d28cf32eb9 100644 --- a/js/src/wasm/cranelift/src/cpu.rs +++ b/js/src/wasm/cranelift/src/cpu.rs @@ -23,10 +23,7 @@ use cranelift_codegen::isa; use cranelift_codegen::settings::{self, Configurable}; -use std::error; -use std::mem; use std::str::FromStr; -use target_lexicon; use utils::{BasicError, DashResult}; use baldrdash::StaticEnvironment; diff --git a/js/src/wasm/cranelift/src/lib.rs b/js/src/wasm/cranelift/src/lib.rs index 717d896a06f3..e937bfe8d9f5 100644 --- a/js/src/wasm/cranelift/src/lib.rs +++ b/js/src/wasm/cranelift/src/lib.rs @@ -13,9 +13,6 @@ * limitations under the License. */ -#![allow(unused)] -#![warn(unused_must_use)] - extern crate cranelift_codegen; extern crate cranelift_wasm; #[macro_use] @@ -53,12 +50,12 @@ pub extern "C" fn cranelift_initialize() { /// /// This is declared in `clifapi.h`. #[no_mangle] -pub extern "C" fn cranelift_compiler_create<'a, 'b>( +pub unsafe extern "C" fn cranelift_compiler_create<'a, 'b>( static_env: *const StaticEnvironment, env: *const baldrapi::CraneliftModuleEnvironment, ) -> *mut BatchCompiler<'a, 'b> { - let env = unsafe { env.as_ref().unwrap() }; - let static_env = unsafe { static_env.as_ref().unwrap() }; + let env = env.as_ref().unwrap(); + let static_env = static_env.as_ref().unwrap(); match BatchCompiler::new(static_env, ModuleEnvironment::new(env)) { Ok(compiler) => Box::into_raw(Box::new(compiler)), Err(err) => { @@ -72,26 +69,26 @@ pub extern "C" fn cranelift_compiler_create<'a, 'b>( /// /// This is declared in `clifapi.h`. #[no_mangle] -pub extern "C" fn cranelift_compiler_destroy(compiler: *mut BatchCompiler) { +pub unsafe extern "C" fn cranelift_compiler_destroy(compiler: *mut BatchCompiler) { assert!( !compiler.is_null(), "NULL pointer passed to cranelift_compiler_destroy" ); // Convert the pointer back into the box it came from. Then drop it. - let _box = unsafe { Box::from_raw(compiler) }; + let _box = Box::from_raw(compiler); } /// Compile a single function. /// /// This is declared in `clifapi.h`. #[no_mangle] -pub extern "C" fn cranelift_compile_function( +pub unsafe extern "C" fn cranelift_compile_function( compiler: *mut BatchCompiler, data: *const FuncCompileInput, result: *mut CompiledFunc, ) -> bool { - let compiler = unsafe { compiler.as_mut().unwrap() }; - let data = unsafe { data.as_ref().unwrap() }; + let compiler = compiler.as_mut().unwrap(); + let data = data.as_ref().unwrap(); if let Err(e) = compiler.translate_wasm(data) { error!("Wasm translation error: {}\n{}", e, compiler); @@ -105,7 +102,7 @@ pub extern "C" fn cranelift_compile_function( // TODO(bbouvier) if destroy is called while one of these objects is alive, you're going to // have a bad time. Would be nice to be able to enforce lifetimes accross languages, somehow. - let result = unsafe { result.as_mut().unwrap() }; + let result = result.as_mut().unwrap(); result.reset(&compiler.current_func); true diff --git a/js/src/wasm/cranelift/src/utils.rs b/js/src/wasm/cranelift/src/utils.rs index c1a21ac84f92..07a5de456d93 100644 --- a/js/src/wasm/cranelift/src/utils.rs +++ b/js/src/wasm/cranelift/src/utils.rs @@ -14,7 +14,6 @@ */ /// Helpers common to other source files here. -use std; use std::error; use std::fmt; diff --git a/js/src/wasm/cranelift/src/wasm2clif.rs b/js/src/wasm/cranelift/src/wasm2clif.rs index f1f64344bb30..aae303a207e6 100644 --- a/js/src/wasm/cranelift/src/wasm2clif.rs +++ b/js/src/wasm/cranelift/src/wasm2clif.rs @@ -27,12 +27,11 @@ use cranelift_codegen::ir::condcodes::IntCC; use cranelift_codegen::ir::InstBuilder; use cranelift_codegen::isa::{CallConv, TargetFrontendConfig, TargetIsa}; use cranelift_codegen::packed_option::PackedOption; -use cranelift_codegen::settings::Flags; use cranelift_wasm::{ - self, FuncIndex, GlobalIndex, MemoryIndex, ReturnMode, SignatureIndex, TableIndex, WasmResult, + FuncEnvironment, FuncIndex, GlobalIndex, GlobalVariable, MemoryIndex, ReturnMode, + SignatureIndex, TableIndex, WasmResult, }; use std::collections::HashMap; -use target_lexicon::Triple; /// Get the integer type used for representing pointers on this platform. fn native_pointer_type() -> ir::Type { @@ -373,7 +372,7 @@ impl<'a, 'b, 'c> TransEnv<'a, 'b, 'c> { } } -impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { +impl<'a, 'b, 'c> FuncEnvironment for TransEnv<'a, 'b, 'c> { fn target_config(&self) -> TargetFrontendConfig { self.isa.frontend_config() } @@ -382,11 +381,7 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { native_pointer_type() } - fn make_global( - &mut self, - func: &mut ir::Function, - index: GlobalIndex, - ) -> cranelift_wasm::GlobalVariable { + fn make_global(&mut self, func: &mut ir::Function, index: GlobalIndex) -> GlobalVariable { let global = self.env.global(index); if global.is_constant() { // Constant globals have a known value at compile time. We insert an instruction to @@ -394,7 +389,7 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { let mut pos = FuncCursor::new(func); pos.next_ebb().expect("empty function"); pos.next_inst(); - cranelift_wasm::GlobalVariable::Const(global.emit_constant(&mut pos)) + GlobalVariable::Const(global.emit_constant(&mut pos)) } else { // This is a global variable. Here we don't care if it is mutable or not. let offset = global.tls_offset(); @@ -419,7 +414,7 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { // Create a Cranelift global variable. We don't need to remember the reference, the // function translator does that for us. - cranelift_wasm::GlobalVariable::Memory { + GlobalVariable::Memory { gv, ty: global.value_type().into(), } @@ -535,7 +530,6 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { ) -> WasmResult { let wsig = self.env.signature(sig_index); - // TODO: When compiling asm.js, the table index in inferred from the signature index. // Currently, WebAssembly doesn't support multiple tables. That may change. assert_eq!(table_index.index(), 0); let wtable = self.get_table(pos.func, table_index); @@ -689,23 +683,22 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { fn translate_memory_grow( &mut self, mut pos: FuncCursor, - index: MemoryIndex, - heap: ir::Heap, + _index: MemoryIndex, + _heap: ir::Heap, val: ir::Value, ) -> WasmResult { - use cranelift_codegen::ir::types::I32; // We emit a call to `uint32_t growMemory_i32(Instance* instance, uint32_t delta)` via a // stub. let (fnref, sigref) = self.symbolic_funcref(pos.func, bd::SymbolicAddress::GrowMemory, || { let mut sig = ir::Signature::new(CallConv::Baldrdash); sig.params.push(ir::AbiParam::new(native_pointer_type())); - sig.params.push(ir::AbiParam::new(I32).uext()); + sig.params.push(ir::AbiParam::new(ir::types::I32).uext()); sig.params.push(ir::AbiParam::special( native_pointer_type(), ir::ArgumentPurpose::VMContext, )); - sig.returns.push(ir::AbiParam::new(I32).uext()); + sig.returns.push(ir::AbiParam::new(ir::types::I32).uext()); sig }); @@ -728,10 +721,9 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { fn translate_memory_size( &mut self, mut pos: FuncCursor, - index: MemoryIndex, - heap: ir::Heap, + _index: MemoryIndex, + _heap: ir::Heap, ) -> WasmResult { - use cranelift_codegen::ir::types::I32; // We emit a call to `uint32_t currentMemory_i32(Instance* instance)` via a stub. let (fnref, sigref) = self.symbolic_funcref(pos.func, bd::SymbolicAddress::CurrentMemory, || { @@ -741,7 +733,7 @@ impl<'a, 'b, 'c> cranelift_wasm::FuncEnvironment for TransEnv<'a, 'b, 'c> { native_pointer_type(), ir::ArgumentPurpose::VMContext, )); - sig.returns.push(ir::AbiParam::new(I32).uext()); + sig.returns.push(ir::AbiParam::new(ir::types::I32).uext()); sig }); @@ -795,25 +787,10 @@ impl TableInfo { TableInfo { global } } - /// Load the table length. - pub fn load_length(&self, pos: &mut FuncCursor, addr: ir::Value) -> ir::Value { - pos.ins().load(ir::types::I32, ir::MemFlags::new(), addr, 0) - } - - /// Load the table base. - pub fn load_base(&self, pos: &mut FuncCursor, addr: ir::Value) -> ir::Value { - pos.ins().load( - native_pointer_type(), - ir::MemFlags::new(), - addr, - native_pointer_size(), - ) - } - /// Get the size in bytes of each table entry. pub fn entry_size(&self) -> i64 { // Each entry is an `wasm::FunctionTableElem` which consists of the code pointer and a new // VM context pointer. - native_pointer_size() as i64 * 2 + i64::from(native_pointer_size()) * 2 } } diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index a5ada9e3cd73..c24984bd03ab 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -13,6 +13,7 @@ #include "mozilla/DocumentStyleRootIterator.h" #include "mozilla/GeckoBindings.h" #include "mozilla/LayerAnimationInfo.h" +#include "mozilla/layers/AnimationInfo.h" #include "mozilla/ServoBindings.h" #include "mozilla/ServoStyleSetInlines.h" #include "mozilla/Unused.h" @@ -53,6 +54,8 @@ #include "nsAccessibilityService.h" #endif +using mozilla::layers::AnimationInfo; + using namespace mozilla::dom; using namespace mozilla::layers; diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index ccdfa5494c51..24103a85f349 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -10,6 +10,8 @@ #include "nscore.h" #include "DateTimeFormat.h" +#include "MediaManager.h" +#include "mozilla/dom/ServiceWorkerRegistrar.h" #include "nsAttrValue.h" #include "nsColorNames.h" #include "nsComputedDOMStyle.h" diff --git a/layout/forms/nsColorControlFrame.cpp b/layout/forms/nsColorControlFrame.cpp index 5ab6155b8bdc..ea343e2d7286 100644 --- a/layout/forms/nsColorControlFrame.cpp +++ b/layout/forms/nsColorControlFrame.cpp @@ -15,6 +15,7 @@ #include "mozilla/dom/HTMLInputElement.h" #include "nsIDocument.h" +using namespace mozilla; using mozilla::dom::Element; using mozilla::dom::HTMLInputElement; using mozilla::dom::CallerType; diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 70df41e355ef..8de374bff51a 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -8,6 +8,7 @@ #include "nsContainerFrame.h" #include "nsIFormControlFrame.h" +#include "nsIFrameInlines.h" #include "nsPresContext.h" #include "nsGkAtoms.h" #include "nsButtonFrameRenderer.h" diff --git a/layout/forms/nsLegendFrame.cpp b/layout/forms/nsLegendFrame.cpp index 23eb0e07e318..eb267ca07456 100644 --- a/layout/forms/nsLegendFrame.cpp +++ b/layout/forms/nsLegendFrame.cpp @@ -5,6 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsLegendFrame.h" + +#include "ComputedStyle.h" #include "nsIContent.h" #include "nsGenericHTMLElement.h" #include "nsAttrValueInlines.h" @@ -12,6 +14,9 @@ #include "nsGkAtoms.h" #include "nsStyleConsts.h" #include "nsCheckboxRadioFrame.h" +#include "WritingModes.h" + +using namespace mozilla; nsIFrame* NS_NewLegendFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) diff --git a/layout/generic/ScrollAnimationPhysics.h b/layout/generic/ScrollAnimationPhysics.h index 31bc24ba310e..04b3018649c6 100644 --- a/layout/generic/ScrollAnimationPhysics.h +++ b/layout/generic/ScrollAnimationPhysics.h @@ -9,6 +9,7 @@ #include "mozilla/TimeStamp.h" #include "nsPoint.h" +#include "Units.h" namespace mozilla { diff --git a/layout/inspector/InspectorUtils.cpp b/layout/inspector/InspectorUtils.cpp index 428cd02c1e72..7eec61daa3cc 100644 --- a/layout/inspector/InspectorUtils.cpp +++ b/layout/inspector/InspectorUtils.cpp @@ -9,6 +9,7 @@ #include "inLayoutUtils.h" +#include "gfxTextRun.h" #include "nsArray.h" #include "nsAutoPtr.h" #include "nsIServiceManager.h" diff --git a/layout/inspector/ServoStyleRuleMap.cpp b/layout/inspector/ServoStyleRuleMap.cpp index 5f4115be685b..d8b514323d4b 100644 --- a/layout/inspector/ServoStyleRuleMap.cpp +++ b/layout/inspector/ServoStyleRuleMap.cpp @@ -10,11 +10,15 @@ #include "mozilla/dom/CSSImportRule.h" #include "mozilla/dom/CSSRuleBinding.h" #include "mozilla/dom/CSSStyleRule.h" +#include "mozilla/dom/ShadowRoot.h" #include "mozilla/IntegerRange.h" #include "mozilla/ServoStyleSet.h" #include "mozilla/StyleSheetInlines.h" #include "nsDocument.h" #include "nsStyleSheetService.h" +#include "nsXBLPrototypeResources.h" + +using namespace mozilla::dom; namespace mozilla { diff --git a/layout/inspector/inDeepTreeWalker.cpp b/layout/inspector/inDeepTreeWalker.cpp index cf5966c59acc..12a4bcabb2d0 100644 --- a/layout/inspector/inDeepTreeWalker.cpp +++ b/layout/inspector/inDeepTreeWalker.cpp @@ -7,6 +7,8 @@ #include "inDeepTreeWalker.h" #include "inLayoutUtils.h" +#include "BindingStyleRule.h" +#include "InspectorUtils.h" #include "nsString.h" #include "nsIDocument.h" #include "nsServiceManagerUtils.h" @@ -16,6 +18,8 @@ #include "mozilla/dom/InspectorUtils.h" #include "mozilla/dom/NodeFilterBinding.h" +using mozilla::dom::InspectorUtils; + /***************************************************************************** * This implementation does not currently operaate according to the W3C spec. * In particular it does NOT handle DOM mutations during the walk. It also diff --git a/layout/mathml/nsMathMLOperators.cpp b/layout/mathml/nsMathMLOperators.cpp index dc075106b082..e47ebdc39416 100644 --- a/layout/mathml/nsMathMLOperators.cpp +++ b/layout/mathml/nsMathMLOperators.cpp @@ -8,6 +8,7 @@ #include "nsCOMPtr.h" #include "nsDataHashtable.h" #include "nsHashKeys.h" +#include "nsNetUtil.h" #include "nsTArray.h" #include "nsIPersistentProperties2.h" diff --git a/layout/mathml/nsMathMLmactionFrame.cpp b/layout/mathml/nsMathMLmactionFrame.cpp index 324b8c96f1dd..e14ddee1249e 100644 --- a/layout/mathml/nsMathMLmactionFrame.cpp +++ b/layout/mathml/nsMathMLmactionFrame.cpp @@ -16,6 +16,7 @@ #include "mozilla/gfx/2D.h" #include "mozilla/dom/Event.h" +using namespace mozilla; using mozilla::dom::Event; // diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp index c92b2243350c..0dcb70561802 100644 --- a/layout/mathml/nsMathMLmfencedFrame.cpp +++ b/layout/mathml/nsMathMLmfencedFrame.cpp @@ -11,6 +11,8 @@ using namespace mozilla; +using mozilla::gfx::DrawTarget; + // // -- surround content with a pair of fences // diff --git a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp index cf887f651a7c..e24d72dc9ff4 100644 --- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp +++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp @@ -11,7 +11,7 @@ #include "gfxContext.h" #include "gfxMathTable.h" -using mozilla::WritingMode; +using namespace mozilla; // // -- attach prescripts and tensor indices to a base - implementation diff --git a/layout/mathml/nsMathMLmoFrame.cpp b/layout/mathml/nsMathMLmoFrame.cpp index 52ca064c6c55..189e7052c9e3 100644 --- a/layout/mathml/nsMathMLmoFrame.cpp +++ b/layout/mathml/nsMathMLmoFrame.cpp @@ -12,6 +12,8 @@ #include "nsMathMLElement.h" #include +using namespace mozilla; + // // -- operator, fence, or separator - implementation // diff --git a/layout/mathml/nsMathMLmpaddedFrame.cpp b/layout/mathml/nsMathMLmpaddedFrame.cpp index aff70c8fed61..34ea45e1a469 100644 --- a/layout/mathml/nsMathMLmpaddedFrame.cpp +++ b/layout/mathml/nsMathMLmpaddedFrame.cpp @@ -11,6 +11,8 @@ #include "mozilla/TextUtils.h" #include +using namespace mozilla; + // // -- adjust space around content - implementation // diff --git a/layout/mathml/nsMathMLmrowFrame.cpp b/layout/mathml/nsMathMLmrowFrame.cpp index 64fac2554d1a..018ac1b1b4f1 100644 --- a/layout/mathml/nsMathMLmrowFrame.cpp +++ b/layout/mathml/nsMathMLmrowFrame.cpp @@ -7,6 +7,8 @@ #include "nsMathMLmrowFrame.h" #include "mozilla/gfx/2D.h" +using namespace mozilla; + // // -- horizontally group any number of subexpressions - implementation // diff --git a/layout/mathml/nsMathMLmspaceFrame.cpp b/layout/mathml/nsMathMLmspaceFrame.cpp index 06d986896e3f..63618048e21b 100644 --- a/layout/mathml/nsMathMLmspaceFrame.cpp +++ b/layout/mathml/nsMathMLmspaceFrame.cpp @@ -9,6 +9,7 @@ #include "mozilla/gfx/2D.h" #include +using namespace mozilla; // // -- space - implementation diff --git a/layout/mathml/nsMathMLmunderoverFrame.cpp b/layout/mathml/nsMathMLmunderoverFrame.cpp index f9c78a888b35..ef7a84900873 100644 --- a/layout/mathml/nsMathMLmunderoverFrame.cpp +++ b/layout/mathml/nsMathMLmunderoverFrame.cpp @@ -12,6 +12,8 @@ #include "gfxContext.h" #include "gfxMathTable.h" +using namespace mozilla; + // // -- attach an underscript-overscript pair to a base - implementation // -- attach an overscript to a base - implementation diff --git a/layout/mathml/nsMathMLsemanticsFrame.cpp b/layout/mathml/nsMathMLsemanticsFrame.cpp index 4e23c70dc88e..545170a11c9a 100644 --- a/layout/mathml/nsMathMLsemanticsFrame.cpp +++ b/layout/mathml/nsMathMLsemanticsFrame.cpp @@ -9,6 +9,8 @@ #include "nsMimeTypes.h" #include "mozilla/gfx/2D.h" +using namespace mozilla; + // // -- associate annotations with a MathML expression // diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 058e0d57ef8c..846eed140761 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -22,6 +22,8 @@ #include "mozilla/dom/HTMLCanvasElement.h" #include "mozilla/dom/KeyframeEffect.h" #include "mozilla/dom/Selection.h" +#include "mozilla/dom/ServiceWorkerRegistrar.h" +#include "mozilla/dom/ServiceWorkerRegistration.h" #include "mozilla/gfx/2D.h" #include "mozilla/layers/PLayerTransaction.h" #include "mozilla/ShapeUtils.h" @@ -32,6 +34,7 @@ #include "nsRegion.h" #include "nsStyleStructInlines.h" #include "nsStyleTransformMatrix.h" +#include "nsTransitionManager.h" #include "gfxMatrix.h" #include "gfxPrefs.h" #include "nsSVGIntegrationUtils.h" diff --git a/layout/printing/PrintTranslator.h b/layout/printing/PrintTranslator.h index 9ef079fcc877..f9f3ad4c3896 100644 --- a/layout/printing/PrintTranslator.h +++ b/layout/printing/PrintTranslator.h @@ -9,6 +9,7 @@ #include +#include "DrawEventRecorder.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/Filters.h" #include "mozilla/gfx/RecordedEvent.h" diff --git a/layout/printing/ipc/RemotePrintJobParent.h b/layout/printing/ipc/RemotePrintJobParent.h index df319ce7890f..1a2208543cbc 100644 --- a/layout/printing/ipc/RemotePrintJobParent.h +++ b/layout/printing/ipc/RemotePrintJobParent.h @@ -19,11 +19,12 @@ class nsDeviceContext; class nsIPrintSettings; class nsIWebProgressListener; -class PrintTranslator; namespace mozilla { namespace layout { +class PrintTranslator; + class RemotePrintJobParent final : public PRemotePrintJobParent { public: diff --git a/layout/printing/nsPrintData.cpp b/layout/printing/nsPrintData.cpp index 29c17ee48c51..935bda7ee7b0 100644 --- a/layout/printing/nsPrintData.cpp +++ b/layout/printing/nsPrintData.cpp @@ -8,6 +8,7 @@ #include "nsIStringBundle.h" #include "nsIServiceManager.h" +#include "nsIWidget.h" #include "nsPrintObject.h" #include "nsPrintPreviewListener.h" #include "nsIWebProgressListener.h" diff --git a/layout/printing/nsPrintJob.cpp b/layout/printing/nsPrintJob.cpp index dbbb829ec432..b85b83ff4931 100644 --- a/layout/printing/nsPrintJob.cpp +++ b/layout/printing/nsPrintJob.cpp @@ -137,7 +137,7 @@ using namespace mozilla::dom; #define DUMP_LAYOUT_LEVEL (static_cast(9)) #ifndef PR_PL -static mozilla::LazyLogModule gPrintingLog("printing") +static mozilla::LazyLogModule gPrintingLog("printing"); #define PR_PL(_p1) MOZ_LOG(gPrintingLog, mozilla::LogLevel::Debug, _p1); #endif diff --git a/layout/printing/nsPrintObject.cpp b/layout/printing/nsPrintObject.cpp index 30474d75ec4e..a628fc545a63 100644 --- a/layout/printing/nsPrintObject.cpp +++ b/layout/printing/nsPrintObject.cpp @@ -5,10 +5,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsPrintObject.h" + #include "nsIContentViewer.h" #include "nsContentUtils.h" // for nsAutoScriptBlocker #include "nsIInterfaceRequestorUtils.h" #include "nsPIDOMWindow.h" +#include "nsPresContext.h" #include "nsGkAtoms.h" #include "nsComponentManagerUtils.h" #include "nsIDocShellTreeItem.h" @@ -17,6 +19,10 @@ #include "nsDocShell.h" #include "mozilla/dom/BrowsingContext.h" +#include "mozilla/dom/Element.h" + +using mozilla::dom::BrowsingContext; +using mozilla::dom::Element; //--------------------------------------------------- //-- nsPrintObject Class Impl diff --git a/layout/style/CSSKeyframesRule.cpp b/layout/style/CSSKeyframesRule.cpp index 630da3705481..682f96257ff2 100644 --- a/layout/style/CSSKeyframesRule.cpp +++ b/layout/style/CSSKeyframesRule.cpp @@ -9,6 +9,7 @@ #include "mozilla/dom/CSSKeyframesRuleBinding.h" #include "mozilla/dom/CSSRuleList.h" #include "mozilla/ServoBindings.h" +#include "nsCOMArray.h" #include diff --git a/layout/style/CounterStyleManager.cpp b/layout/style/CounterStyleManager.cpp index b49cde10f350..d4f45de0cac9 100644 --- a/layout/style/CounterStyleManager.cpp +++ b/layout/style/CounterStyleManager.cpp @@ -12,6 +12,7 @@ #include "mozilla/MathAlgorithms.h" #include "mozilla/Types.h" #include "mozilla/WritingModes.h" +#include "nsPresContext.h" #include "nsString.h" #include "nsTArray.h" #include "nsTHashtable.h" diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index d8646c7de082..00dfaa76a686 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -20,6 +20,7 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/URLPreloader.h" #include "nsIRunnable.h" +#include "nsITimedChannel.h" #include "nsSyncLoadService.h" #include "nsCOMPtr.h" #include "nsString.h" diff --git a/layout/style/MappedDeclarations.cpp b/layout/style/MappedDeclarations.cpp index f8be2abdd6c8..db03524d9957 100644 --- a/layout/style/MappedDeclarations.cpp +++ b/layout/style/MappedDeclarations.cpp @@ -4,7 +4,11 @@ * 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/. */ -#include "mozilla/MappedDeclarations.h" +#include "MappedDeclarations.h" + +#include "nsAttrValue.h" +#include "nsIDocument.h" +#include "nsPresContext.h" namespace mozilla { diff --git a/layout/style/MediaList.cpp b/layout/style/MediaList.cpp index afdb134f151c..fa5c39cee8e6 100644 --- a/layout/style/MediaList.cpp +++ b/layout/style/MediaList.cpp @@ -13,6 +13,7 @@ #include "mozilla/ServoBindings.h" #include "mozilla/ServoStyleSet.h" #include "mozilla/StyleSheetInlines.h" +#include "nsPresContext.h" namespace mozilla { namespace dom { diff --git a/layout/style/ServoCSSParser.h b/layout/style/ServoCSSParser.h index 7cadfcd3528a..4c7afc918a2a 100644 --- a/layout/style/ServoCSSParser.h +++ b/layout/style/ServoCSSParser.h @@ -11,6 +11,7 @@ #include "mozilla/gfx/Types.h" #include "mozilla/RefPtr.h" +#include "mozilla/ServoStyleConsts.h" #include "mozilla/ServoTypes.h" #include "nsColor.h" #include "nsCSSPropertyID.h" diff --git a/layout/style/ServoCSSRuleList.cpp b/layout/style/ServoCSSRuleList.cpp index e38bd84929b1..b958f40def7f 100644 --- a/layout/style/ServoCSSRuleList.cpp +++ b/layout/style/ServoCSSRuleList.cpp @@ -22,6 +22,7 @@ #include "mozilla/IntegerRange.h" #include "mozilla/ServoBindings.h" #include "mozilla/StyleSheet.h" +#include "nsIDocument.h" using namespace mozilla::dom; diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 2c94c00135ff..983dd708f66b 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -10,6 +10,7 @@ #include "gfxPlatformFontList.h" #include "mozilla/AutoRestyleTimelineMarker.h" #include "mozilla/DocumentStyleRootIterator.h" +#include "mozilla/EffectCompositor.h" #include "mozilla/IntegerRange.h" #include "mozilla/LookAndFeel.h" #include "mozilla/ServoBindings.h" diff --git a/layout/style/nsDOMCSSValueList.cpp b/layout/style/nsDOMCSSValueList.cpp index 01db9d09fc51..dc302bfdfdd3 100644 --- a/layout/style/nsDOMCSSValueList.cpp +++ b/layout/style/nsDOMCSSValueList.cpp @@ -8,6 +8,7 @@ #include "nsDOMCSSValueList.h" #include "nsString.h" +#include "mozilla/ErrorResult.h" #include "mozilla/Move.h" using namespace mozilla; diff --git a/layout/svg/SVGFELeafFrame.cpp b/layout/svg/SVGFELeafFrame.cpp index c9d0a9d62b3c..33c671d80f53 100644 --- a/layout/svg/SVGFELeafFrame.cpp +++ b/layout/svg/SVGFELeafFrame.cpp @@ -5,12 +5,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Keep in (case-insensitive) order: +#include "ComputedStyle.h" #include "nsContainerFrame.h" #include "nsFrame.h" #include "nsGkAtoms.h" #include "SVGObserverUtils.h" #include "nsSVGFilters.h" +using namespace mozilla; + /* * This frame is used by filter primitive elements that don't * have special child elements that provide parameters. diff --git a/layout/svg/SVGFEUnstyledLeafFrame.cpp b/layout/svg/SVGFEUnstyledLeafFrame.cpp index 8d0e2de36a92..9507a4558782 100644 --- a/layout/svg/SVGFEUnstyledLeafFrame.cpp +++ b/layout/svg/SVGFEUnstyledLeafFrame.cpp @@ -11,6 +11,8 @@ #include "SVGObserverUtils.h" #include "nsSVGFilters.h" +using namespace mozilla; + class SVGFEUnstyledLeafFrame final : public nsFrame { friend nsIFrame* diff --git a/layout/svg/SVGObserverUtils.cpp b/layout/svg/SVGObserverUtils.cpp index 2a6c9156aa97..dd9a7eb3286a 100644 --- a/layout/svg/SVGObserverUtils.cpp +++ b/layout/svg/SVGObserverUtils.cpp @@ -13,6 +13,7 @@ #include "nsCSSFrameConstructor.h" #include "nsISupportsImpl.h" #include "nsSVGClipPathFrame.h" +#include "nsSVGMarkerFrame.h" #include "nsSVGPaintServerFrame.h" #include "nsSVGFilterFrame.h" #include "nsSVGMaskFrame.h" @@ -24,6 +25,7 @@ #include "ImageLoader.h" #include "mozilla/net/ReferrerPolicy.h" +using namespace mozilla; using namespace mozilla::dom; static already_AddRefed diff --git a/layout/svg/SVGViewFrame.cpp b/layout/svg/SVGViewFrame.cpp index 3a4ed6ce3015..62a82ab8ab7d 100644 --- a/layout/svg/SVGViewFrame.cpp +++ b/layout/svg/SVGViewFrame.cpp @@ -11,6 +11,7 @@ #include "mozilla/dom/SVGSVGElement.h" #include "mozilla/dom/SVGViewElement.h" +using namespace mozilla; using namespace mozilla::dom; /** diff --git a/layout/svg/nsCSSClipPathInstance.h b/layout/svg/nsCSSClipPathInstance.h index bc7381d84c8f..b808d324c762 100644 --- a/layout/svg/nsCSSClipPathInstance.h +++ b/layout/svg/nsCSSClipPathInstance.h @@ -7,6 +7,7 @@ #ifndef __NS_CSSCLIPPATHINSTANCE_H__ #define __NS_CSSCLIPPATHINSTANCE_H__ +#include "gfxPoint.h" #include "nsStyleStruct.h" #include "nsRect.h" #include "mozilla/gfx/2D.h" diff --git a/layout/svg/nsSVGGFrame.cpp b/layout/svg/nsSVGGFrame.cpp index 0bd782d8fe85..77523f592d1e 100644 --- a/layout/svg/nsSVGGFrame.cpp +++ b/layout/svg/nsSVGGFrame.cpp @@ -15,6 +15,7 @@ #include "nsSVGIntegrationUtils.h" #include "nsSVGUtils.h" +using namespace mozilla; using namespace mozilla::dom; //---------------------------------------------------------------------- diff --git a/layout/svg/nsSVGGenericContainerFrame.cpp b/layout/svg/nsSVGGenericContainerFrame.cpp index 951a65778cc7..ef309cb943b7 100644 --- a/layout/svg/nsSVGGenericContainerFrame.cpp +++ b/layout/svg/nsSVGGenericContainerFrame.cpp @@ -8,6 +8,8 @@ #include "nsSVGGenericContainerFrame.h" #include "nsSVGIntegrationUtils.h" +using namespace mozilla; + //---------------------------------------------------------------------- // nsSVGGenericContainerFrame Implementation diff --git a/layout/svg/nsSVGInnerSVGFrame.cpp b/layout/svg/nsSVGInnerSVGFrame.cpp index 5c551d1c7dc7..99d310d2ae57 100644 --- a/layout/svg/nsSVGInnerSVGFrame.cpp +++ b/layout/svg/nsSVGInnerSVGFrame.cpp @@ -7,6 +7,8 @@ // Main header first: #include "nsSVGInnerSVGFrame.h" +using namespace mozilla; + nsIFrame* NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) { diff --git a/layout/svg/nsSVGMarkerFrame.cpp b/layout/svg/nsSVGMarkerFrame.cpp index a8ea5c6f0cb2..568413df901a 100644 --- a/layout/svg/nsSVGMarkerFrame.cpp +++ b/layout/svg/nsSVGMarkerFrame.cpp @@ -14,6 +14,7 @@ #include "SVGGeometryElement.h" #include "SVGGeometryFrame.h" +using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::gfx; using namespace mozilla::image; diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index c9432157b4e0..be5891db939f 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -22,6 +22,7 @@ using namespace mozilla; using namespace mozilla::dom; +using namespace mozilla::gfx; using namespace mozilla::image; //---------------------------------------------------------------------- diff --git a/layout/svg/nsSVGStopFrame.cpp b/layout/svg/nsSVGStopFrame.cpp index 90d32372a353..24144020042c 100644 --- a/layout/svg/nsSVGStopFrame.cpp +++ b/layout/svg/nsSVGStopFrame.cpp @@ -11,6 +11,8 @@ #include "mozilla/ComputedStyle.h" #include "SVGObserverUtils.h" +using namespace mozilla; + // This is a very simple frame whose only purpose is to capture style change // events and propagate them to the parent. Most of the heavy lifting is done // within the nsSVGGradientFrame, which is the parent for this frame diff --git a/layout/svg/nsSVGSwitchFrame.cpp b/layout/svg/nsSVGSwitchFrame.cpp index 80232c55d69e..2d1ac288cc97 100644 --- a/layout/svg/nsSVGSwitchFrame.cpp +++ b/layout/svg/nsSVGSwitchFrame.cpp @@ -11,6 +11,7 @@ #include "mozilla/dom/SVGSwitchElement.h" #include "nsSVGUtils.h" +using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::image; diff --git a/layout/svg/nsSVGSymbolFrame.cpp b/layout/svg/nsSVGSymbolFrame.cpp index a81ccb0fcd22..746f170d116d 100644 --- a/layout/svg/nsSVGSymbolFrame.cpp +++ b/layout/svg/nsSVGSymbolFrame.cpp @@ -7,6 +7,8 @@ // Main header first: #include "nsSVGSymbolFrame.h" +using namespace mozilla; + nsIFrame* NS_NewSVGSymbolFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) { diff --git a/layout/tables/FixedTableLayoutStrategy.cpp b/layout/tables/FixedTableLayoutStrategy.cpp index 77c0db0c38d8..47a0c68b9148 100644 --- a/layout/tables/FixedTableLayoutStrategy.cpp +++ b/layout/tables/FixedTableLayoutStrategy.cpp @@ -10,11 +10,15 @@ */ #include "FixedTableLayoutStrategy.h" +#include "nsStyleConsts.h" #include "nsTableFrame.h" #include "nsTableColFrame.h" #include "nsTableCellFrame.h" +#include "WritingModes.h" #include +using namespace mozilla; + FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame *aTableFrame) : nsITableLayoutStrategy(nsITableLayoutStrategy::Fixed) , mTableFrame(aTableFrame) diff --git a/layout/tables/SpanningCellSorter.cpp b/layout/tables/SpanningCellSorter.cpp index 141211597b7b..2e732d3ce18e 100644 --- a/layout/tables/SpanningCellSorter.cpp +++ b/layout/tables/SpanningCellSorter.cpp @@ -13,6 +13,8 @@ #include "nsIPresShell.h" #include "mozilla/HashFunctions.h" +using namespace mozilla; + //#define DEBUG_SPANNING_CELL_SORTER SpanningCellSorter::SpanningCellSorter() diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index adf3206bd862..8eabca271b12 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -4,6 +4,10 @@ * 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/. */ +#include "nsTableFrame.h" + +#include "mozilla/gfx/2D.h" +#include "mozilla/gfx/Helpers.h" #include "mozilla/Likely.h" #include "mozilla/MathAlgorithms.h" #include "mozilla/IntegerRange.h" @@ -11,7 +15,6 @@ #include "gfxContext.h" #include "nsCOMPtr.h" -#include "nsTableFrame.h" #include "mozilla/ComputedStyle.h" #include "nsStyleConsts.h" #include "nsIContent.h" @@ -54,6 +57,11 @@ using namespace mozilla; using namespace mozilla::image; using namespace mozilla::layout; +using mozilla::gfx::AutoRestoreTransform; +using mozilla::gfx::DrawTarget; +using mozilla::gfx::Float; +using mozilla::gfx::ToDeviceColor; + /******************************************************************************** ** TableReflowInput ** ********************************************************************************/ diff --git a/layout/xul/grid/nsGridRowGroupFrame.cpp b/layout/xul/grid/nsGridRowGroupFrame.cpp index 5c8da5643e3e..b9c3e7a6dc9a 100644 --- a/layout/xul/grid/nsGridRowGroupFrame.cpp +++ b/layout/xul/grid/nsGridRowGroupFrame.cpp @@ -17,6 +17,8 @@ #include "nsBoxLayoutState.h" #include "nsGridLayout2.h" +using namespace mozilla; + already_AddRefed NS_NewGridRowGroupLayout(); nsIFrame* diff --git a/layout/xul/grid/nsGridRowLeafFrame.cpp b/layout/xul/grid/nsGridRowLeafFrame.cpp index db4d77264613..1d5747c4255a 100644 --- a/layout/xul/grid/nsGridRowLeafFrame.cpp +++ b/layout/xul/grid/nsGridRowLeafFrame.cpp @@ -17,6 +17,8 @@ #include "nsBoxLayoutState.h" #include "nsGridLayout2.h" +using namespace mozilla; + already_AddRefed NS_NewGridRowLeafLayout(); nsIFrame* diff --git a/layout/xul/nsButtonBoxFrame.cpp b/layout/xul/nsButtonBoxFrame.cpp index b05acbfbe44e..1232791181d0 100644 --- a/layout/xul/nsButtonBoxFrame.cpp +++ b/layout/xul/nsButtonBoxFrame.cpp @@ -22,7 +22,7 @@ #include "mozilla/TextEvents.h" using namespace mozilla; - +using namespace mozilla::dom; NS_IMPL_ISUPPORTS(nsButtonBoxFrame::nsButtonBoxListener, nsIDOMEventListener) diff --git a/layout/xul/nsDeckFrame.cpp b/layout/xul/nsDeckFrame.cpp index 922e6e394db8..072af197aa6e 100644 --- a/layout/xul/nsDeckFrame.cpp +++ b/layout/xul/nsDeckFrame.cpp @@ -33,6 +33,8 @@ #include "nsAccessibilityService.h" #endif +using namespace mozilla; + nsIFrame* NS_NewDeckFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) { diff --git a/layout/xul/nsDocElementBoxFrame.cpp b/layout/xul/nsDocElementBoxFrame.cpp index 15b144747a09..98cfc8a257e8 100644 --- a/layout/xul/nsDocElementBoxFrame.cpp +++ b/layout/xul/nsDocElementBoxFrame.cpp @@ -23,6 +23,7 @@ //#define DEBUG_REFLOW +using namespace mozilla; using namespace mozilla::dom; class nsDocElementBoxFrame final : public nsBoxFrame diff --git a/layout/xul/nsMenuBarListener.h b/layout/xul/nsMenuBarListener.h index 584f0edcabab..bea7b2755bac 100644 --- a/layout/xul/nsMenuBarListener.h +++ b/layout/xul/nsMenuBarListener.h @@ -8,6 +8,7 @@ #include "mozilla/Attributes.h" #include "mozilla/EventForwards.h" +#include "nsIContent.h" #include "nsIDOMEventListener.h" // X.h defines KeyPress diff --git a/layout/xul/nsMenuPopupFrame.h b/layout/xul/nsMenuPopupFrame.h index 8b6d72c13b06..4e72d7fdb915 100644 --- a/layout/xul/nsMenuPopupFrame.h +++ b/layout/xul/nsMenuPopupFrame.h @@ -14,6 +14,7 @@ #include "mozilla/Attributes.h" #include "mozilla/gfx/Types.h" #include "nsAtom.h" +#include "nsIDOMXULSelectCntrlEl.h" #include "nsGkAtoms.h" #include "nsCOMPtr.h" #include "nsMenuFrame.h" diff --git a/layout/xul/nsResizerFrame.h b/layout/xul/nsResizerFrame.h index 0e9ee8f89a2b..7759c6165632 100644 --- a/layout/xul/nsResizerFrame.h +++ b/layout/xul/nsResizerFrame.h @@ -15,6 +15,9 @@ class nsIBaseWindow; class nsResizerFrame final : public nsTitleBarFrame { protected: + typedef mozilla::LayoutDeviceIntPoint LayoutDeviceIntPoint; + typedef mozilla::LayoutDeviceIntRect LayoutDeviceIntRect; + struct Direction { int8_t mHorizontal; int8_t mVertical; diff --git a/layout/xul/nsSplitterFrame.cpp b/layout/xul/nsSplitterFrame.cpp index 7aa7c7bded65..ea83621d455e 100644 --- a/layout/xul/nsSplitterFrame.cpp +++ b/layout/xul/nsSplitterFrame.cpp @@ -40,6 +40,8 @@ using namespace mozilla; +using mozilla::dom::Event; + class nsSplitterInfo { public: nscoord min; diff --git a/layout/xul/tree/nsTreeColFrame.cpp b/layout/xul/tree/nsTreeColFrame.cpp index 576e818cf587..9d4fa96207b1 100644 --- a/layout/xul/tree/nsTreeColFrame.cpp +++ b/layout/xul/tree/nsTreeColFrame.cpp @@ -18,6 +18,8 @@ #include "nsTreeBodyFrame.h" #include "nsXULElement.h" +using namespace mozilla; + // // NS_NewTreeColFrame // diff --git a/layout/xul/tree/nsTreeColFrame.h b/layout/xul/tree/nsTreeColFrame.h index 870e415d0635..ea95bf9a52e5 100644 --- a/layout/xul/tree/nsTreeColFrame.h +++ b/layout/xul/tree/nsTreeColFrame.h @@ -5,12 +5,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/Attributes.h" +#include "mozilla/ComputedStyle.h" #include "nsBoxFrame.h" class nsITreeBoxObject; nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell, - ComputedStyle* aStyle); + mozilla::ComputedStyle* aStyle); class nsTreeColFrame final : public nsBoxFrame { diff --git a/layout/xul/tree/nsTreeColumns.cpp b/layout/xul/tree/nsTreeColumns.cpp index 4f9d9d9210f5..ec4b5b5d7019 100644 --- a/layout/xul/tree/nsTreeColumns.cpp +++ b/layout/xul/tree/nsTreeColumns.cpp @@ -18,6 +18,7 @@ #include "mozilla/dom/TreeColumnsBinding.h" using namespace mozilla; +using namespace mozilla::dom; // Column class that caches all the info about our column. nsTreeColumn::nsTreeColumn(nsTreeColumns* aColumns, dom::Element* aElement) diff --git a/layout/xul/tree/nsTreeContentView.cpp b/layout/xul/tree/nsTreeContentView.cpp index b0b0d3862787..ff8cea29366b 100644 --- a/layout/xul/tree/nsTreeContentView.cpp +++ b/layout/xul/tree/nsTreeContentView.cpp @@ -16,11 +16,13 @@ #include "nsTreeColumns.h" #include "mozilla/ErrorResult.h" #include "mozilla/dom/Element.h" +#include "mozilla/dom/TreeBoxObject.h" #include "mozilla/dom/TreeContentViewBinding.h" #include "nsServiceManagerUtils.h" #include "nsIDocument.h" using namespace mozilla; +using namespace mozilla::dom; // A content model view implementation for the tree. diff --git a/layout/xul/tree/nsTreeStyleCache.h b/layout/xul/tree/nsTreeStyleCache.h index a43404ad6341..be90e028a342 100644 --- a/layout/xul/tree/nsTreeStyleCache.h +++ b/layout/xul/tree/nsTreeStyleCache.h @@ -11,9 +11,12 @@ #include "mozilla/Attributes.h" #include "nsAutoPtr.h" #include "nsCOMArray.h" +#include "nsDataHashtable.h" #include "nsRefPtrHashtable.h" #include "mozilla/ComputedStyle.h" +class nsIContent; + class nsTreeStyleCache { public: diff --git a/testing/web-platform/meta/eventsource/format-data-before-final-empty-line.htm.ini b/testing/web-platform/meta/eventsource/format-data-before-final-empty-line.htm.ini deleted file mode 100644 index b4d3ac40dd96..000000000000 --- a/testing/web-platform/meta/eventsource/format-data-before-final-empty-line.htm.ini +++ /dev/null @@ -1,2 +0,0 @@ -[format-data-before-final-empty-line.htm] - disabled: 1086275 diff --git a/testing/web-platform/meta/eventsource/format-field-retry-bogus.htm.ini b/testing/web-platform/meta/eventsource/format-field-retry-bogus.htm.ini deleted file mode 100644 index d9a5d8c004d6..000000000000 --- a/testing/web-platform/meta/eventsource/format-field-retry-bogus.htm.ini +++ /dev/null @@ -1,2 +0,0 @@ -[format-field-retry-bogus.htm] - disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1006396 diff --git a/testing/web-platform/meta/eventsource/format-field-retry.htm.ini b/testing/web-platform/meta/eventsource/format-field-retry.htm.ini deleted file mode 100644 index 7f46eb404cb8..000000000000 --- a/testing/web-platform/meta/eventsource/format-field-retry.htm.ini +++ /dev/null @@ -1,2 +0,0 @@ -[format-field-retry.htm] - disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1006396 diff --git a/testing/web-platform/meta/workers/constructors/SharedWorker/connect-event.html.ini b/testing/web-platform/meta/workers/constructors/SharedWorker/connect-event.html.ini deleted file mode 100644 index 206758d17f7d..000000000000 --- a/testing/web-platform/meta/workers/constructors/SharedWorker/connect-event.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[connect-event.html] - [connect event] - expected: FAIL -