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

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: Improved check 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 bool hadStyle = (oldStyle != 0);
Noel Gordon 2015/06/12 16:21:04 Remove hadStyle, doesn't really say anymore that o
rwlbuis 2015/06/15 17:21:51 Done.
86 RespectImageOrientationEnum oldOrientation = hadStyle ? oldStyle->respectIma geOrientation() : ComputedStyle::initialRespectImageOrientation();
87 if (style() && style()->respectImageOrientation() != oldOrientation)
88 intrinsicSizeChanged();
Noel Gordon 2015/06/12 16:21:04 Devious and I love it.
rwlbuis 2015/06/15 17:21:51 Thanks :)
89 }
90
81 void LayoutImage::setImageResource(PassOwnPtr<LayoutImageResource> imageResource ) 91 void LayoutImage::setImageResource(PassOwnPtr<LayoutImageResource> imageResource )
82 { 92 {
83 ASSERT(!m_imageResource); 93 ASSERT(!m_imageResource);
84 m_imageResource = imageResource; 94 m_imageResource = imageResource;
85 m_imageResource->initialize(this); 95 m_imageResource->initialize(this);
86 } 96 }
87 97
88 void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) 98 void LayoutImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
89 { 99 {
90 if (documentBeingDestroyed()) 100 if (documentBeingDestroyed())
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 return nullptr; 363 return nullptr;
354 364
355 ImageResource* cachedImage = m_imageResource->cachedImage(); 365 ImageResource* cachedImage = m_imageResource->cachedImage();
356 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 366 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
357 return toSVGImage(cachedImage->image())->embeddedContentBox(); 367 return toSVGImage(cachedImage->image())->embeddedContentBox();
358 368
359 return nullptr; 369 return nullptr;
360 } 370 }
361 371
362 } // namespace blink 372 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698