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

Unified Diff: third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp b/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
index aeaaec38438c5f36f8e792f9ba3f26ab4d46a609..c6121a114d8a98ad30cf9eed69928a9001f79c69 100644
--- a/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
+++ b/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
@@ -107,23 +107,25 @@ bool StyleFetchedImageSet::UsesImageContainerSize() const {
return best_fit_image_->UsesImageContainerSize();
}
-void StyleFetchedImageSet::AddClient(LayoutObject* layout_object) {
- best_fit_image_->AddObserver(layout_object);
+void StyleFetchedImageSet::AddClient(ImageResourceObserver* observer) {
+ best_fit_image_->AddObserver(observer);
}
-void StyleFetchedImageSet::RemoveClient(LayoutObject* layout_object) {
- best_fit_image_->RemoveObserver(layout_object);
+void StyleFetchedImageSet::RemoveClient(ImageResourceObserver* observer) {
+ best_fit_image_->RemoveObserver(observer);
}
PassRefPtr<Image> StyleFetchedImageSet::GetImage(
- const LayoutObject& obj,
+ const ImageResourceObserver&,
+ const Document&,
+ const ComputedStyle& style,
const IntSize& container_size) const {
if (!best_fit_image_->GetImage()->IsSVGImage())
return best_fit_image_->GetImage();
return SVGImageForContainer::Create(ToSVGImage(best_fit_image_->GetImage()),
- container_size,
- obj.StyleRef().EffectiveZoom(), url_);
+ container_size, style.EffectiveZoom(),
+ url_);
}
bool StyleFetchedImageSet::KnownToBeOpaque(const Document&,

Powered by Google App Engine
This is Rietveld 408576698