OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #include "core/svg/SVGCursorElement.h" | 21 #include "core/svg/SVGCursorElement.h" |
22 | 22 |
23 #include "core/SVGNames.h" | 23 #include "core/SVGNames.h" |
24 #include "core/dom/StyleChangeReason.h" | 24 #include "core/dom/StyleChangeReason.h" |
25 #include "core/frame/UseCounter.h" | |
25 | 26 |
26 namespace blink { | 27 namespace blink { |
27 | 28 |
28 inline SVGCursorElement::SVGCursorElement(Document& document) | 29 inline SVGCursorElement::SVGCursorElement(Document& document) |
29 : SVGElement(SVGNames::cursorTag, document) | 30 : SVGElement(SVGNames::cursorTag, document) |
30 , SVGTests(this) | 31 , SVGTests(this) |
31 , SVGURIReference(this) | 32 , SVGURIReference(this) |
32 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVG LengthMode::Width))) | 33 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVG LengthMode::Width))) |
33 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVG LengthMode::Height))) | 34 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVG LengthMode::Height))) |
34 { | 35 { |
35 addToPropertyMap(m_x); | 36 addToPropertyMap(m_x); |
36 addToPropertyMap(m_y); | 37 addToPropertyMap(m_y); |
38 | |
39 UseCounter::count(document, UseCounter::SVGCursorElement); | |
37 } | 40 } |
38 | 41 |
39 DEFINE_NODE_FACTORY(SVGCursorElement) | 42 DEFINE_NODE_FACTORY(SVGCursorElement) |
40 | 43 |
41 SVGCursorElement::~SVGCursorElement() | 44 SVGCursorElement::~SVGCursorElement() |
42 { | 45 { |
43 } | 46 } |
44 | 47 |
45 void SVGCursorElement::addClient(SVGElement* element) | 48 void SVGCursorElement::addClient(SVGElement* element) |
46 { | 49 { |
50 UseCounter::count(document(), UseCounter::SVGCursorElementHasClient); | |
foolip
2016/09/28 14:57:01
If this is not reach, the whole element has no eff
fs
2016/09/28 15:03:01
That is correct, yes. Technically we still don't k
| |
51 | |
47 m_clients.add(element); | 52 m_clients.add(element); |
48 element->setCursorElement(this); | 53 element->setCursorElement(this); |
49 } | 54 } |
50 | 55 |
51 void SVGCursorElement::removeReferencedElement(SVGElement* element) | 56 void SVGCursorElement::removeReferencedElement(SVGElement* element) |
52 { | 57 { |
53 m_clients.remove(element); | 58 m_clients.remove(element); |
54 } | 59 } |
55 | 60 |
56 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) | 61 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) |
(...skipping 17 matching lines...) Expand all Loading... | |
74 { | 79 { |
75 visitor->trace(m_x); | 80 visitor->trace(m_x); |
76 visitor->trace(m_y); | 81 visitor->trace(m_y); |
77 visitor->trace(m_clients); | 82 visitor->trace(m_clients); |
78 SVGElement::trace(visitor); | 83 SVGElement::trace(visitor); |
79 SVGTests::trace(visitor); | 84 SVGTests::trace(visitor); |
80 SVGURIReference::trace(visitor); | 85 SVGURIReference::trace(visitor); |
81 } | 86 } |
82 | 87 |
83 } // namespace blink | 88 } // namespace blink |
OLD | NEW |