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

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

Issue 2854123004: Hoist layout update out of SVGGraphicsElement::GetBBox and overrides (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
3 * <zimmermann@kde.org> 3 * <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
5 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
6 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 6 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
7 * Copyright (C) 2012 University of Szeged 7 * Copyright (C) 2012 University of Szeged
8 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> 8 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 height_->CurrentValue()->IsRelative()) 669 height_->CurrentValue()->IsRelative())
670 return true; 670 return true;
671 671
672 if (!target_element_instance_) 672 if (!target_element_instance_)
673 return false; 673 return false;
674 674
675 return target_element_instance_->HasRelativeLengths(); 675 return target_element_instance_->HasRelativeLengths();
676 } 676 }
677 677
678 FloatRect SVGUseElement::GetBBox() { 678 FloatRect SVGUseElement::GetBBox() {
679 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 679 DCHECK(GetLayoutObject());
680
681 if (!GetLayoutObject())
682 return FloatRect();
683
684 LayoutSVGTransformableContainer& transformable_container = 680 LayoutSVGTransformableContainer& transformable_container =
685 ToLayoutSVGTransformableContainer(*GetLayoutObject()); 681 ToLayoutSVGTransformableContainer(*GetLayoutObject());
686 // Don't apply the additional translation if the oBB is invalid. 682 // Don't apply the additional translation if the oBB is invalid.
687 if (!transformable_container.IsObjectBoundingBoxValid()) 683 if (!transformable_container.IsObjectBoundingBoxValid())
688 return FloatRect(); 684 return FloatRect();
689 685
690 // TODO(fs): Preferably this would just use objectBoundingBox() (and hence 686 // TODO(fs): Preferably this would just use objectBoundingBox() (and hence
691 // don't need to override SVGGraphicsElement::getBBox at all) and be 687 // don't need to override SVGGraphicsElement::getBBox at all) and be
692 // correct without additional work. That will not work out ATM without 688 // correct without additional work. That will not work out ATM without
693 // additional quirks. The problem stems from including the additional 689 // additional quirks. The problem stems from including the additional
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 746
751 if (resource_) 747 if (resource_)
752 resource_->RemoveClient(this); 748 resource_->RemoveClient(this);
753 749
754 resource_ = resource; 750 resource_ = resource;
755 if (resource_) 751 if (resource_)
756 resource_->AddClient(this); 752 resource_->AddClient(this);
757 } 753 }
758 754
759 } // namespace blink 755 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698