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

Side by Side Diff: Source/core/svg/SVGSVGElement.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rebased.. Created 7 years 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) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage()) 562 if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage())
563 return SVGRect(); 563 return SVGRect();
564 564
565 Length intrinsicWidth = this->intrinsicWidth(); 565 Length intrinsicWidth = this->intrinsicWidth();
566 Length intrinsicHeight = this->intrinsicHeight(); 566 Length intrinsicHeight = this->intrinsicHeight();
567 if (!intrinsicWidth.isFixed() || !intrinsicHeight.isFixed()) 567 if (!intrinsicWidth.isFixed() || !intrinsicHeight.isFixed())
568 return SVGRect(); 568 return SVGRect();
569 569
570 // If no viewBox is specified but non-relative width/height values, then we 570 // If no viewBox is specified but non-relative width/height values, then we
571 // should always synthesize a viewBox if we're embedded through a SVGImage. 571 // should always synthesize a viewBox if we're embedded through a SVGImage.
572 return SVGRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth, 0 , 0), floatValueForLength(intrinsicHeight, 0, 0))); 572 return SVGRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth, 0 ), floatValueForLength(intrinsicHeight, 0)));
573 } 573 }
574 574
575 FloatSize SVGSVGElement::currentViewportSize() const 575 FloatSize SVGSVGElement::currentViewportSize() const
576 { 576 {
577 Length intrinsicWidth = this->intrinsicWidth(); 577 Length intrinsicWidth = this->intrinsicWidth();
578 Length intrinsicHeight = this->intrinsicHeight(); 578 Length intrinsicHeight = this->intrinsicHeight();
579 if (intrinsicWidth.isFixed() && intrinsicHeight.isFixed()) 579 if (intrinsicWidth.isFixed() && intrinsicHeight.isFixed())
580 return FloatSize(floatValueForLength(intrinsicWidth, 0), floatValueForLe ngth(intrinsicHeight, 0)); 580 return FloatSize(floatValueForLength(intrinsicWidth, 0), floatValueForLe ngth(intrinsicHeight, 0));
581 581
582 if (!renderer()) 582 if (!renderer())
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 continue; 772 continue;
773 773
774 Element* element = toElement(node); 774 Element* element = toElement(node);
775 if (element->getIdAttribute() == id) 775 if (element->getIdAttribute() == id)
776 return element; 776 return element;
777 } 777 }
778 return 0; 778 return 0;
779 } 779 }
780 780
781 } 781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698