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

Side by Side Diff: Source/core/layout/LayoutImage.cpp

Issue 1162793003: Add CSS image-orientation: from-image (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address even more review comments Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 { 71 {
72 } 72 }
73 73
74 void LayoutImage::willBeDestroyed() 74 void LayoutImage::willBeDestroyed()
75 { 75 {
76 ASSERT(m_imageResource); 76 ASSERT(m_imageResource);
77 m_imageResource->shutdown(); 77 m_imageResource->shutdown();
78 LayoutReplaced::willBeDestroyed(); 78 LayoutReplaced::willBeDestroyed();
79 } 79 }
80 80
81 void LayoutImage::styleDidChange(StyleDifference diff, const ComputedStyle* oldS tyle)
82 {
83 LayoutReplaced::styleDidChange(diff, oldStyle);
84
85 RespectImageOrientationEnum oldOrientation = oldStyle ? oldStyle->respectIma geOrientation() : ComputedStyle::initialRespectImageOrientation();
86 if (style() && style()->respectImageOrientation() != oldOrientation)
87 intrinsicSizeChanged();
88 }
89
81 void LayoutImage::setImageResource(PassOwnPtr<LayoutImageResource> imageResource ) 90 void LayoutImage::setImageResource(PassOwnPtr<LayoutImageResource> imageResource )
82 { 91 {
83 ASSERT(!m_imageResource); 92 ASSERT(!m_imageResource);
84 m_imageResource = imageResource; 93 m_imageResource = imageResource;
85 m_imageResource->initialize(this); 94 m_imageResource->initialize(this);
86 } 95 }
87 96
88 void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) 97 void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
89 { 98 {
90 if (documentBeingDestroyed()) 99 if (documentBeingDestroyed())
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 return nullptr; 362 return nullptr;
354 363
355 ImageResource* cachedImage = m_imageResource->cachedImage(); 364 ImageResource* cachedImage = m_imageResource->cachedImage();
356 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 365 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
357 return toSVGImage(cachedImage->image())->embeddedContentBox(); 366 return toSVGImage(cachedImage->image())->embeddedContentBox();
358 367
359 return nullptr; 368 return nullptr;
360 } 369 }
361 370
362 } // namespace blink 371 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698