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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 FetchRequest request(ResourceRequest(ownerDocument()->completeURL(hrefString ())), localName()); 80 FetchRequest request(ResourceRequest(ownerDocument()->completeURL(hrefString ())), localName());
81 m_cachedImage = ImageResource::fetch(request, document().fetcher()); 81 m_cachedImage = ImageResource::fetch(request, document().fetcher());
82 82
83 if (m_cachedImage) 83 if (m_cachedImage)
84 m_cachedImage->addClient(this); 84 m_cachedImage->addClient(this);
85 } 85 }
86 86
87 void SVGFEImageElement::buildPendingResource() 87 void SVGFEImageElement::buildPendingResource()
88 { 88 {
89 clearResourceReferences(); 89 clearResourceReferences();
90 if (!inShadowIncludingDocument()) 90 if (!isConnected())
91 return; 91 return;
92 92
93 AtomicString id; 93 AtomicString id;
94 Element* target = SVGURIReference::targetElementFromIRIString(hrefString(), treeScope(), &id); 94 Element* target = SVGURIReference::targetElementFromIRIString(hrefString(), treeScope(), &id);
95 if (!target) { 95 if (!target) {
96 if (id.isEmpty()) { 96 if (id.isEmpty()) {
97 fetchImageResource(); 97 fetchImageResource();
98 } else { 98 } else {
99 document().accessSVGExtensions().addPendingResource(id, this); 99 document().accessSVGExtensions().addPendingResource(id, this);
100 ASSERT(hasPendingResources()); 100 ASSERT(hasPendingResources());
(...skipping 27 matching lines...) Expand all
128 Node::InsertionNotificationRequest SVGFEImageElement::insertedInto(ContainerNode * rootParent) 128 Node::InsertionNotificationRequest SVGFEImageElement::insertedInto(ContainerNode * rootParent)
129 { 129 {
130 SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent); 130 SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent);
131 buildPendingResource(); 131 buildPendingResource();
132 return InsertionDone; 132 return InsertionDone;
133 } 133 }
134 134
135 void SVGFEImageElement::removedFrom(ContainerNode* rootParent) 135 void SVGFEImageElement::removedFrom(ContainerNode* rootParent)
136 { 136 {
137 SVGFilterPrimitiveStandardAttributes::removedFrom(rootParent); 137 SVGFilterPrimitiveStandardAttributes::removedFrom(rootParent);
138 if (rootParent->inShadowIncludingDocument()) 138 if (rootParent->isConnected())
139 clearResourceReferences(); 139 clearResourceReferences();
140 } 140 }
141 141
142 void SVGFEImageElement::notifyFinished(Resource*) 142 void SVGFEImageElement::notifyFinished(Resource*)
143 { 143 {
144 if (!inShadowIncludingDocument()) 144 if (!isConnected())
145 return; 145 return;
146 146
147 Element* parent = parentElement(); 147 Element* parent = parentElement();
148 if (!parent || !isSVGFilterElement(parent) || !parent->layoutObject()) 148 if (!parent || !isSVGFilterElement(parent) || !parent->layoutObject())
149 return; 149 return;
150 150
151 if (LayoutObject* layoutObject = this->layoutObject()) 151 if (LayoutObject* layoutObject = this->layoutObject())
152 markForLayoutAndParentResourceInvalidation(layoutObject); 152 markForLayoutAndParentResourceInvalidation(layoutObject);
153 } 153 }
154 154
155 FilterEffect* SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter) 155 FilterEffect* SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter)
156 { 156 {
157 if (m_cachedImage) { 157 if (m_cachedImage) {
158 // Don't use the broken image icon on image loading errors. 158 // Don't use the broken image icon on image loading errors.
159 RefPtr<Image> image = m_cachedImage->errorOccurred() ? 159 RefPtr<Image> image = m_cachedImage->errorOccurred() ?
160 nullptr : m_cachedImage->getImage(); 160 nullptr : m_cachedImage->getImage();
161 return FEImage::createWithImage(filter, image, m_preserveAspectRatio->cu rrentValue()); 161 return FEImage::createWithImage(filter, image, m_preserveAspectRatio->cu rrentValue());
162 } 162 }
163 163
164 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue()); 164 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue());
165 } 165 }
166 166
167 } // namespace blink 167 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698