Bug 1890793: Assert CallArgs::newTarget is not gray. r=spidermonkey-reviewers,sfink...
[gecko.git] / dom / svg / SVGFragmentIdentifier.h
blob464412d1ed52657ccf0bc7552f236ccac60e4ca5
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_SVG_SVGFRAGMENTIDENTIFIER_H_
8 #define DOM_SVG_SVGFRAGMENTIDENTIFIER_H_
10 #include "nsString.h"
12 namespace mozilla {
14 namespace dom {
15 class Document;
16 class SVGSVGElement;
17 } // namespace dom
19 /**
20 * Implements support for parsing SVG fragment identifiers
21 * http://www.w3.org/TR/SVG/linking.html#SVGFragmentIdentifiers
23 class SVGFragmentIdentifier {
24 // To prevent the class being instantiated
25 SVGFragmentIdentifier() = delete;
27 public:
28 /**
29 * Process the SVG fragment identifier, if there is one.
30 * @return true if we found a valid svgView()-style fragment identifier,
31 * in which case further processing by the caller can stop. Otherwise return
32 * false as we may have an ordinary anchor which needs to be :target matched.
34 static bool ProcessFragmentIdentifier(dom::Document* aDocument,
35 const nsAString& aAnchorName);
37 private:
38 /**
39 * Parse an SVG ViewSpec and set applicable attributes on the root element.
40 * @return true if there is a valid ViewSpec
42 static bool ProcessSVGViewSpec(const nsAString& aViewSpec,
43 dom::SVGSVGElement* root);
46 } // namespace mozilla
48 #endif // DOM_SVG_SVGFRAGMENTIDENTIFIER_H_