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

Side by Side Diff: Source/core/rendering/RenderImage.cpp

Issue 26390004: Rework SVG sizing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix mishap during rebase in svg.css Created 6 years, 8 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (!objectBounds.isEmpty()) { 582 if (!objectBounds.isEmpty()) {
583 screenArea = viewBounds; 583 screenArea = viewBounds;
584 screenArea.intersect(objectBounds); 584 screenArea.intersect(objectBounds);
585 } 585 }
586 586
587 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyImageR esourceVisibility(m_imageResource->cachedImage(), status, screenArea); 587 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyImageR esourceVisibility(m_imageResource->cachedImage(), status, screenArea);
588 588
589 return true; 589 return true;
590 } 590 }
591 591
592 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, dou ble& intrinsicRatio, bool& isPercentageIntrinsicSize) const 592 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, dou ble& intrinsicRatio) const
593 { 593 {
594 RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRat io, isPercentageIntrinsicSize); 594 RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRat io);
595 595
596 // Our intrinsicSize is empty if we're rendering generated images with relat ive width/height. Figure out the right intrinsic size to use. 596 // Our intrinsicSize is empty if we're rendering generated images with relat ive width/height. Figure out the right intrinsic size to use.
597 if (intrinsicSize.isEmpty() && (m_imageResource->imageHasRelativeWidth() || m_imageResource->imageHasRelativeHeight())) { 597 if (intrinsicSize.isEmpty() && (m_imageResource->imageHasRelativeWidth() || m_imageResource->imageHasRelativeHeight())) {
598 RenderObject* containingBlock = isOutOfFlowPositioned() ? container() : this->containingBlock(); 598 RenderObject* containingBlock = isOutOfFlowPositioned() ? container() : this->containingBlock();
599 if (containingBlock->isBox()) { 599 if (containingBlock->isBox()) {
600 RenderBox* box = toRenderBox(containingBlock); 600 RenderBox* box = toRenderBox(containingBlock);
601 intrinsicSize.setWidth(box->availableLogicalWidth().toFloat()); 601 intrinsicSize.setWidth(box->availableLogicalWidth().toFloat());
602 intrinsicSize.setHeight(box->availableLogicalHeight(IncludeMarginBor derPadding).toFloat()); 602 intrinsicSize.setHeight(box->availableLogicalHeight(IncludeMarginBor derPadding).toFloat());
603 } 603 }
604 } 604 }
(...skipping 18 matching lines...) Expand all
623 return 0; 623 return 0;
624 624
625 ImageResource* cachedImage = m_imageResource->cachedImage(); 625 ImageResource* cachedImage = m_imageResource->cachedImage();
626 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 626 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
627 return toSVGImage(cachedImage->image())->embeddedContentBox(); 627 return toSVGImage(cachedImage->image())->embeddedContentBox();
628 628
629 return 0; 629 return 0;
630 } 630 }
631 631
632 } // namespace WebCore 632 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698