зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1260032 - drop support for altGlyph as a tspan. r=cam r=peterv (DOM Peer)
This commit is contained in:
Родитель
61b52e4aa3
Коммит
4236a89dfc
|
@ -1331,9 +1331,6 @@ GK_ATOM(percentage, "%")
|
|||
GK_ATOM(A, "A")
|
||||
GK_ATOM(alignment_baseline, "alignment-baseline")
|
||||
GK_ATOM(allowReorder, "allowReorder")
|
||||
GK_ATOM(altGlyph, "altGlyph")
|
||||
GK_ATOM(altGlyphDef, "altGlyphDef")
|
||||
GK_ATOM(altGlyphItem, "altGlyphItem")
|
||||
GK_ATOM(amplitude, "amplitude")
|
||||
GK_ATOM(animate, "animate")
|
||||
GK_ATOM(animateColor, "animateColor")
|
||||
|
|
|
@ -280,9 +280,6 @@ nsIAtom** const kURLAttributesHTML[] = {
|
|||
|
||||
nsIAtom** const kElementsSVG[] = {
|
||||
&nsGkAtoms::a, // a
|
||||
&nsGkAtoms::altGlyph, // altGlyph
|
||||
&nsGkAtoms::altGlyphDef, // altGlyphDef
|
||||
&nsGkAtoms::altGlyphItem, // altGlyphItem
|
||||
&nsGkAtoms::circle, // circle
|
||||
&nsGkAtoms::clipPath, // clipPath
|
||||
&nsGkAtoms::colorProfile, // color-profile
|
||||
|
|
|
@ -1,113 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/dom/SVGAltGlyphElement.h"
|
||||
#include "mozilla/dom/SVGAltGlyphElementBinding.h"
|
||||
|
||||
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(AltGlyph)
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
JSObject*
|
||||
SVGAltGlyphElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return SVGAltGlyphElementBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
nsSVGElement::StringInfo SVGAltGlyphElement::sStringInfo[1] =
|
||||
{
|
||||
{ &nsGkAtoms::href, kNameSpaceID_XLink, false }
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation
|
||||
|
||||
SVGAltGlyphElement::SVGAltGlyphElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
||||
: SVGAltGlyphElementBase(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
||||
nsSVGElement::EnumAttributesInfo
|
||||
SVGAltGlyphElement::GetEnumInfo()
|
||||
{
|
||||
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
|
||||
ArrayLength(sEnumInfo));
|
||||
}
|
||||
|
||||
nsSVGElement::LengthAttributesInfo
|
||||
SVGAltGlyphElement::GetLengthInfo()
|
||||
{
|
||||
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
|
||||
ArrayLength(sLengthInfo));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIDOMNode methods
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAltGlyphElement)
|
||||
|
||||
already_AddRefed<SVGAnimatedString>
|
||||
SVGAltGlyphElement::Href()
|
||||
{
|
||||
return mStringAttributes[HREF].ToDOMAnimatedString(this);
|
||||
}
|
||||
|
||||
void
|
||||
SVGAltGlyphElement::GetGlyphRef(nsAString & aGlyphRef)
|
||||
{
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef);
|
||||
}
|
||||
|
||||
void
|
||||
SVGAltGlyphElement::SetGlyphRef(const nsAString & aGlyphRef, ErrorResult& rv)
|
||||
{
|
||||
rv = SetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef, true);
|
||||
}
|
||||
|
||||
void
|
||||
SVGAltGlyphElement::GetFormat(nsAString & aFormat)
|
||||
{
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat);
|
||||
}
|
||||
|
||||
void
|
||||
SVGAltGlyphElement::SetFormat(const nsAString & aFormat, ErrorResult& rv)
|
||||
{
|
||||
rv = SetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat, true);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsIContent methods
|
||||
|
||||
NS_IMETHODIMP_(bool)
|
||||
SVGAltGlyphElement::IsAttributeMapped(const nsIAtom* name) const
|
||||
{
|
||||
static const MappedAttributeEntry* const map[] = {
|
||||
sColorMap,
|
||||
sFillStrokeMap,
|
||||
sFontSpecificationMap,
|
||||
sGraphicsMap,
|
||||
sTextContentElementsMap
|
||||
};
|
||||
|
||||
return FindAttributeDependence(name, map) ||
|
||||
SVGAltGlyphElementBase::IsAttributeMapped(name);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGElement overrides
|
||||
|
||||
nsSVGElement::StringAttributesInfo
|
||||
SVGAltGlyphElement::GetStringInfo()
|
||||
{
|
||||
return StringAttributesInfo(mStringAttributes, sStringInfo,
|
||||
ArrayLength(sStringInfo));
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -1,65 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_SVGAltGlyphElement_h
|
||||
#define mozilla_dom_SVGAltGlyphElement_h
|
||||
|
||||
#include "mozilla/dom/SVGTextPositioningElement.h"
|
||||
#include "nsSVGString.h"
|
||||
|
||||
nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult,
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
typedef SVGTextPositioningElement SVGAltGlyphElementBase;
|
||||
|
||||
class SVGAltGlyphElement final : public SVGAltGlyphElementBase
|
||||
{
|
||||
protected:
|
||||
friend nsresult (::NS_NewSVGAltGlyphElement(nsIContent **aResult,
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
||||
explicit SVGAltGlyphElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
||||
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
public:
|
||||
// nsIContent interface
|
||||
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
|
||||
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
|
||||
// WebIDL
|
||||
already_AddRefed<SVGAnimatedString> Href();
|
||||
void GetGlyphRef(nsAString & aGlyphRef);
|
||||
void SetGlyphRef(const nsAString & aGlyphRef, ErrorResult& rv);
|
||||
void GetFormat(nsAString & aFormat);
|
||||
void SetFormat(const nsAString & aFormat, ErrorResult& rv);
|
||||
|
||||
protected:
|
||||
|
||||
// nsSVGElement overrides
|
||||
virtual EnumAttributesInfo GetEnumInfo() override;
|
||||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { HREF };
|
||||
nsSVGString mStringAttributes[1];
|
||||
static StringInfo sStringInfo[1];
|
||||
|
||||
nsSVGEnum mEnumAttributes[1];
|
||||
virtual nsSVGEnum* EnumAttributes() override
|
||||
{ return mEnumAttributes; }
|
||||
|
||||
nsSVGLength2 mLengthAttributes[1];
|
||||
virtual nsSVGLength2* LengthAttributes() override
|
||||
{ return mLengthAttributes; }
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_SVGAltGlyphElement_h
|
|
@ -29,7 +29,6 @@
|
|||
******/
|
||||
|
||||
SVG_TAG(a, A)
|
||||
SVG_TAG(altGlyph, AltGlyph)
|
||||
SVG_TAG(animate, Animate)
|
||||
SVG_TAG(animateMotion, AnimateMotion)
|
||||
SVG_TAG(animateTransform, AnimateTransform)
|
||||
|
|
|
@ -19,7 +19,6 @@ EXPORTS += [
|
|||
EXPORTS.mozilla.dom += [
|
||||
'nsSVGAnimatedTransformList.h',
|
||||
'SVGAElement.h',
|
||||
'SVGAltGlyphElement.h',
|
||||
'SVGAngle.h',
|
||||
'SVGAnimatedAngle.h',
|
||||
'SVGAnimatedBoolean.h',
|
||||
|
@ -137,7 +136,6 @@ UNIFIED_SOURCES += [
|
|||
'nsSVGTransform.cpp',
|
||||
'nsSVGViewBox.cpp',
|
||||
'SVGAElement.cpp',
|
||||
'SVGAltGlyphElement.cpp',
|
||||
'SVGAngle.cpp',
|
||||
'SVGAnimatedAngle.cpp',
|
||||
'SVGAnimatedBoolean.cpp',
|
||||
|
|
|
@ -32,9 +32,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=589640
|
|||
<!-- NOTE: This test relies on the ids being the same as the element names -->
|
||||
<svg id="svg1">
|
||||
<a id="a" />
|
||||
<altGlyph id="altGlyph" />
|
||||
<altGlyphDef id="altGlyphDef" />
|
||||
<altGlyphItem id="altGlyphItem" />
|
||||
<animate id="animate" />
|
||||
<animateColor id="animateColor" />
|
||||
<animateMotion id="animateMotion" />
|
||||
|
|
|
@ -1058,8 +1058,6 @@ var interfaceNamesInGlobalScope =
|
|||
"SubtleCrypto",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"SVGAElement",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"SVGAltGlyphElement",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"SVGAngle",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* 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/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.w3.org/TR/SVG2/
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
interface SVGAltGlyphElement : SVGTextPositioningElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString glyphRef;
|
||||
[SetterThrows]
|
||||
attribute DOMString format;
|
||||
};
|
||||
|
||||
SVGAltGlyphElement implements SVGURIReference;
|
||||
|
|
@ -423,7 +423,6 @@ WEBIDL_FILES = [
|
|||
'StyleSheetList.webidl',
|
||||
'SubtleCrypto.webidl',
|
||||
'SVGAElement.webidl',
|
||||
'SVGAltGlyphElement.webidl',
|
||||
'SVGAngle.webidl',
|
||||
'SVGAnimatedAngle.webidl',
|
||||
'SVGAnimatedBoolean.webidl',
|
||||
|
|
|
@ -5373,7 +5373,6 @@ nsCSSFrameConstructor::FindSVGData(Element* aElement,
|
|||
return &sTSpanData;
|
||||
}
|
||||
} else if (aTag == nsGkAtoms::tspan ||
|
||||
aTag == nsGkAtoms::altGlyph ||
|
||||
aTag == nsGkAtoms::a) {
|
||||
return &sTSpanData;
|
||||
}
|
||||
|
@ -5386,7 +5385,6 @@ nsCSSFrameConstructor::FindSVGData(Element* aElement,
|
|||
nsCSSAnonBoxes::mozSVGText);
|
||||
return &sTextData;
|
||||
} else if (aTag == nsGkAtoms::tspan ||
|
||||
aTag == nsGkAtoms::altGlyph ||
|
||||
aTag == nsGkAtoms::textPath) {
|
||||
return &sSuppressData;
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
font-family="monospace" font-size="20" xml:space="preserve">
|
||||
|
||||
<title>Reference to check that that altGlyph falls back to tspan behaviour</title>
|
||||
|
||||
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=456286 -->
|
||||
|
||||
<text><tspan x="20" y="20" rotate="90">T</tspan>EST1</text>
|
||||
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 464 B |
|
@ -1,14 +0,0 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
font-family="monospace" font-size="20" xml:space="preserve">
|
||||
|
||||
<title>Testcase to check that altGlyph falls back to tspan behaviour</title>
|
||||
|
||||
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=456286 -->
|
||||
|
||||
<text><altGlyph x="20" y="20" rotate="90">T</altGlyph>EST1</text>
|
||||
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 464 B |
|
@ -1,9 +1,9 @@
|
|||
// Any copyright is dedicated to the Public Domain.
|
||||
// http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
// These are all of the SVG 1.1 element names, except for container elements,
|
||||
// These are all of the SVG 1.1 and Filter Effects element names, except for container and deprecated elements,
|
||||
// with the addition of an "UNKNOWN" element in the SVG namespace.
|
||||
var es = 'altGlyph altGlyphDef altGlyphItem animate animateColor animateMotion animateTransform circle color-profile cursor desc ellipse feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence filter font font-face font-face-format font-face-name font-face-src font-face-uri glyph glyphRef hkern image line linearGradient metadata missing-glyph mpath path polygon polyline radialGradient rect script set stop style text textPath title tref tspan use view vkern UNKNOWN'.split(' ');
|
||||
var es = 'animate animateMotion animateTransform circle color-profile cursor desc ellipse feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence filter image line linearGradient metadata mpath path polygon polyline radialGradient rect script set stop style text textPath title tspan use view UNKNOWN'.split(' ');
|
||||
var colwidth = 200;
|
||||
var size = 40;
|
||||
var rows = 14;
|
||||
|
|
|
@ -25,7 +25,6 @@ include moz-only/reftest.list
|
|||
# svg-integration tests (using svg effects in e.g. HTML)
|
||||
include svg-integration/reftest.list
|
||||
|
||||
== altGlyph-01.svg altGlyph-01-ref.svg
|
||||
== baseline-middle-01.svg pass.svg
|
||||
== border-radius-01.html pass.svg
|
||||
== cssComment-in-attribute-01.svg cssComment-in-attribute-01-ref.svg
|
||||
|
|
|
@ -230,8 +230,7 @@ IsTextContentElement(nsIContent* aContent)
|
|||
}
|
||||
|
||||
if (aContent->IsAnyOfSVGElements(nsGkAtoms::a,
|
||||
nsGkAtoms::tspan,
|
||||
nsGkAtoms::altGlyph)) {
|
||||
nsGkAtoms::tspan)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче