From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- dom/svg/SVGTests.h | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'dom/svg/SVGTests.h') diff --git a/dom/svg/SVGTests.h b/dom/svg/SVGTests.h index 148c35fc5c..90991fd60d 100644 --- a/dom/svg/SVGTests.h +++ b/dom/svg/SVGTests.h @@ -13,13 +13,15 @@ class nsAttrValue; class nsAtom; +class nsIContent; class nsStaticAtom; namespace mozilla { namespace dom { class DOMSVGStringList; -} +class SVGSwitchElement; +} // namespace dom #define MOZILLA_DOMSVGTESTS_IID \ { \ @@ -42,26 +44,10 @@ class SVGTests : public nsISupports { using SVGStringList = mozilla::SVGStringList; /** - * Compare the language name(s) in a systemLanguage attribute to the - * user's language preferences, as defined in - * http://www.w3.org/TR/SVG11/struct.html#SystemLanguageAttribute - * We have a match if a language name in the users language preferences - * exactly equals one of the language names or exactly equals a prefix of - * one of the language names in the systemLanguage attribute. - * @returns 2 * the lowest index in the aAcceptLangs that matches + 1 - * if only the prefix matches, -2 if there's no systemLanguage attribute, - * or -1 if no indices match. - * XXX This algorithm is O(M*N). - */ - int32_t GetBestLanguagePreferenceRank(const nsAString& aAcceptLangs) const; - - /** - * Check whether the conditional processing attributes other than - * systemLanguage "return true" if they apply to and are specified - * on the given element. Returns true if this element should be - * rendered, false if it should not. + * Find the active switch child using BCP 47 rules. */ - bool PassesConditionalProcessingTestsIgnoringSystemLanguage() const; + static nsIContent* FindActiveSwitchChild( + const dom::SVGSwitchElement* aSwitch); /** * Check whether the conditional processing attributes requiredExtensions @@ -71,16 +57,6 @@ class SVGTests : public nsISupports { */ bool PassesConditionalProcessingTests() const; - /** - * Check whether the conditional processing attributes requiredExtensions - * and systemLanguage both "return true" if they apply to - * and are specified on the given element. Returns true if this element - * should be rendered, false if it should not. - * - * @param aAcceptLangs The value of the intl.accept_languages preference - */ - bool PassesConditionalProcessingTests(const nsAString& aAcceptLangs) const; - /** * Returns true if the attribute is one of the conditional processing * attributes. @@ -117,9 +93,17 @@ class SVGTests : public nsISupports { virtual ~SVGTests() = default; private: + /** + * Check whether the extensions processing attribute applies to and is + * specified on the given element. Returns true if this element should be + * rendered, false if it should not. + */ + bool PassesRequiredExtensionsTests() const; + enum { EXTENSIONS, LANGUAGE }; SVGStringList mStringListAttributes[2]; static nsStaticAtom* const sStringListNames[2]; + mutable Maybe mPassesConditionalProcessingTests = Some(true); }; NS_DEFINE_STATIC_IID_ACCESSOR(SVGTests, MOZILLA_DOMSVGTESTS_IID) -- cgit v1.2.3