Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: Source/core/svg/SVGDocument.cpp

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 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,
(...skipping 21 matching lines...) Expand all
32 #include "core/svg/SVGZoomAndPan.h" 32 #include "core/svg/SVGZoomAndPan.h"
33 #include "core/svg/SVGZoomEvent.h" 33 #include "core/svg/SVGZoomEvent.h"
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 SVGDocument::SVGDocument(const DocumentInit& initializer) 37 SVGDocument::SVGDocument(const DocumentInit& initializer)
38 : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass) 38 : XMLDocument(initializer, XMLDocumentClass | SVGDocumentClass)
39 { 39 {
40 } 40 }
41 41
42 SVGSVGElement* SVGDocument::rootElement(const Document* document) 42 SVGSVGElement* SVGDocument::rootElement(const Document& document)
43 { 43 {
44 Element* elem = document->documentElement(); 44 Element* elem = document.documentElement();
45 if (elem && elem->hasTagName(SVGNames::svgTag)) 45 if (elem && elem->hasTagName(SVGNames::svgTag))
46 return toSVGSVGElement(elem); 46 return toSVGSVGElement(elem);
47 47
48 return 0; 48 return 0;
49 } 49 }
50 50
51 SVGSVGElement* SVGDocument::rootElement() const 51 SVGSVGElement* SVGDocument::rootElement() const
52 { 52 {
53 return rootElement(this); 53 return rootElement(*this);
54 } 54 }
55 55
56 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale) 56 void SVGDocument::dispatchZoomEvent(float prevScale, float newScale)
57 { 57 {
58 RefPtr<SVGZoomEvent> event = SVGZoomEvent::create(); 58 RefPtr<SVGZoomEvent> event = SVGZoomEvent::create();
59 event->initEvent(EventTypeNames::zoom, true, false); 59 event->initEvent(EventTypeNames::zoom, true, false);
60 event->setPreviousScale(prevScale); 60 event->setPreviousScale(prevScale);
61 event->setNewScale(newScale); 61 event->setNewScale(newScale);
62 rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION); 62 rootElement()->dispatchEvent(event.release(), IGNORE_EXCEPTION);
63 } 63 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 renderer()->repaint(); 97 renderer()->repaint();
98 } 98 }
99 } 99 }
100 100
101 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() 101 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren()
102 { 102 {
103 return create(DocumentInit(url())); 103 return create(DocumentInit(url()));
104 } 104 }
105 105
106 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698