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_
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;
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
);
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_