nsSVGFeatures.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. * This file contains code to help implement the Conditional Processing
  7. * section of the SVG specification (i.e. the <switch> element and the
  8. * requiredFeatures, requiredExtensions and systemLanguage attributes).
  9. *
  10. * http://www.w3.org/TR/SVG11/struct.html#ConditionalProcessing
  11. */
  12. #include "nsSVGFeatures.h"
  13. #include "nsIContent.h"
  14. #include "nsIDocument.h"
  15. #include "nsNameSpaceManager.h"
  16. #include "mozilla/Preferences.h"
  17. using namespace mozilla;
  18. /*static*/ bool
  19. nsSVGFeatures::HasExtension(const nsAString& aExtension, const bool aIsInChrome)
  20. {
  21. #define SVG_SUPPORTED_EXTENSION(str) if (aExtension.EqualsLiteral(str)) return true;
  22. SVG_SUPPORTED_EXTENSION("http://www.w3.org/1999/xhtml")
  23. nsNameSpaceManager* nameSpaceManager = nsNameSpaceManager::GetInstance();
  24. if (aIsInChrome || !nameSpaceManager->mMathMLDisabled) {
  25. SVG_SUPPORTED_EXTENSION("http://www.w3.org/1998/Math/MathML")
  26. }
  27. #undef SVG_SUPPORTED_EXTENSION
  28. return false;
  29. }