Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 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 #ifndef SVGUseElement_h | 21 #ifndef SVGUseElement_h |
| 22 #define SVGUseElement_h | 22 #define SVGUseElement_h |
| 23 | 23 |
| 24 #include "core/events/EventSender.h" | 24 #include "core/events/EventSender.h" |
| 25 #include "core/fetch/DocumentResource.h" | 25 #include "core/fetch/DocumentResource.h" |
| 26 #include "core/svg/SVGAnimatedLength.h" | 26 #include "core/svg/SVGAnimatedLength.h" |
| 27 #include "core/svg/SVGGeometryElement.h" | |
| 27 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
| 28 #include "core/svg/SVGURIReference.h" | 29 #include "core/svg/SVGURIReference.h" |
| 29 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 30 | 31 |
| 31 namespace blink { | 32 namespace blink { |
| 32 | 33 |
| 33 typedef EventSender<SVGUseElement> SVGUseEventSender; | 34 typedef EventSender<SVGUseElement> SVGUseEventSender; |
| 34 | 35 |
| 35 class SVGUseElement final : public SVGGraphicsElement, | 36 class SVGUseElement final : public SVGGraphicsElement, |
| 36 public SVGURIReference, | 37 public SVGURIReference, |
| 37 public DocumentResourceClient { | 38 public DocumentResourceClient { |
| 38 DEFINE_WRAPPERTYPEINFO(); | 39 DEFINE_WRAPPERTYPEINFO(); |
| 39 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); | 40 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGUseElement); |
| 40 public: | 41 public: |
| 41 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); | 42 static PassRefPtrWillBeRawPtr<SVGUseElement> create(Document&); |
| 42 virtual ~SVGUseElement(); | 43 virtual ~SVGUseElement(); |
| 43 | 44 |
| 44 void invalidateShadowTree(); | 45 void invalidateShadowTree(); |
| 45 | 46 |
| 46 LayoutObject* layoutObjectClipChild() const; | 47 SVGGeometryElement* layoutObjectClipChild(Path&) const; |
|
pdr.
2015/06/09 05:15:58
Sadness... the original code is worse than I expec
hyunjunekim2
2015/06/10 14:00:42
I will try again for your advice.
| |
| 47 | 48 |
| 48 SVGAnimatedLength* x() const { return m_x.get(); } | 49 SVGAnimatedLength* x() const { return m_x.get(); } |
| 49 SVGAnimatedLength* y() const { return m_y.get(); } | 50 SVGAnimatedLength* y() const { return m_y.get(); } |
| 50 SVGAnimatedLength* width() const { return m_width.get(); } | 51 SVGAnimatedLength* width() const { return m_width.get(); } |
| 51 SVGAnimatedLength* height() const { return m_height.get(); } | 52 SVGAnimatedLength* height() const { return m_height.get(); } |
| 52 | 53 |
| 53 virtual void buildPendingResource() override; | 54 virtual void buildPendingResource() override; |
| 54 | 55 |
| 55 void dispatchPendingEvent(SVGUseEventSender*); | 56 void dispatchPendingEvent(SVGUseEventSender*); |
| 56 | 57 |
| 57 DECLARE_VIRTUAL_TRACE(); | 58 DECLARE_VIRTUAL_TRACE(); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 explicit SVGUseElement(Document&); | 61 explicit SVGUseElement(Document&); |
| 61 | 62 |
| 62 virtual bool isPresentationAttribute(const QualifiedName&) const override; | 63 virtual bool isPresentationAttribute(const QualifiedName&) const override; |
| 63 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override; | 64 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) override; |
| 64 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const o verride; | 65 virtual bool isPresentationAttributeWithSVGDOM(const QualifiedName&) const o verride; |
| 65 | 66 |
| 66 virtual bool isStructurallyExternal() const override { return !hrefString(). isNull() && isExternalURIReference(hrefString(), document()); } | 67 virtual bool isStructurallyExternal() const override { return !hrefString(). isNull() && isExternalURIReference(hrefString(), document()); } |
| 67 | 68 |
| 68 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 69 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 69 virtual void removedFrom(ContainerNode*) override; | 70 virtual void removedFrom(ContainerNode*) override; |
| 70 | 71 |
| 71 virtual void svgAttributeChanged(const QualifiedName&) override; | 72 virtual void svgAttributeChanged(const QualifiedName&) override; |
| 72 | 73 |
| 73 virtual LayoutObject* createLayoutObject(const ComputedStyle&) override; | 74 virtual LayoutObject* createLayoutObject(const ComputedStyle&) override; |
| 74 virtual void toClipPath(Path&) override; | |
| 75 | 75 |
| 76 void clearResourceReferences(); | 76 void clearResourceReferences(); |
| 77 void buildShadowAndInstanceTree(SVGElement* target); | 77 void buildShadowAndInstanceTree(SVGElement* target); |
| 78 | 78 |
| 79 void scheduleShadowTreeRecreation(); | 79 void scheduleShadowTreeRecreation(); |
| 80 virtual bool haveLoadedRequiredResources() override { return !isStructurally External() || m_haveFiredLoadEvent; } | 80 virtual bool haveLoadedRequiredResources() override { return !isStructurally External() || m_haveFiredLoadEvent; } |
| 81 | 81 |
| 82 virtual bool selfHasRelativeLengths() const override; | 82 virtual bool selfHasRelativeLengths() const override; |
| 83 | 83 |
| 84 // Instance tree handling | 84 // Instance tree handling |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 105 | 105 |
| 106 bool m_haveFiredLoadEvent; | 106 bool m_haveFiredLoadEvent; |
| 107 bool m_needsShadowTreeRecreation; | 107 bool m_needsShadowTreeRecreation; |
| 108 RefPtrWillBeMember<SVGElement> m_targetElementInstance; | 108 RefPtrWillBeMember<SVGElement> m_targetElementInstance; |
| 109 ResourcePtr<DocumentResource> m_resource; | 109 ResourcePtr<DocumentResource> m_resource; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace blink | 112 } // namespace blink |
| 113 | 113 |
| 114 #endif // SVGUseElement_h | 114 #endif // SVGUseElement_h |
| OLD | NEW |