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

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: rename browser zoom to page zoom Created 6 years, 11 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 | « Source/core/rendering/svg/RenderSVGRoot.cpp ('k') | Source/platform/Length.h » ('j') | 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 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage()) 560 if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage())
561 return SVGRect(); 561 return SVGRect();
562 562
563 Length intrinsicWidth = this->intrinsicWidth(); 563 Length intrinsicWidth = this->intrinsicWidth();
564 Length intrinsicHeight = this->intrinsicHeight(); 564 Length intrinsicHeight = this->intrinsicHeight();
565 if (!intrinsicWidth.isFixed() || !intrinsicHeight.isFixed()) 565 if (!intrinsicWidth.isFixed() || !intrinsicHeight.isFixed())
566 return SVGRect(); 566 return SVGRect();
567 567
568 // If no viewBox is specified but non-relative width/height values, then we 568 // If no viewBox is specified but non-relative width/height values, then we
569 // should always synthesize a viewBox if we're embedded through a SVGImage. 569 // should always synthesize a viewBox if we're embedded through a SVGImage.
570 return SVGRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth, 0 , 0), floatValueForLength(intrinsicHeight, 0, 0))); 570 return SVGRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth, 0 ), floatValueForLength(intrinsicHeight, 0)));
571 } 571 }
572 572
573 FloatSize SVGSVGElement::currentViewportSize() const 573 FloatSize SVGSVGElement::currentViewportSize() const
574 { 574 {
575 Length intrinsicWidth = this->intrinsicWidth(); 575 Length intrinsicWidth = this->intrinsicWidth();
576 Length intrinsicHeight = this->intrinsicHeight(); 576 Length intrinsicHeight = this->intrinsicHeight();
577 if (intrinsicWidth.isFixed() && intrinsicHeight.isFixed()) 577 if (intrinsicWidth.isFixed() && intrinsicHeight.isFixed())
578 return FloatSize(floatValueForLength(intrinsicWidth, 0), floatValueForLe ngth(intrinsicHeight, 0)); 578 return FloatSize(floatValueForLength(intrinsicWidth, 0), floatValueForLe ngth(intrinsicHeight, 0));
579 579
580 if (!renderer()) 580 if (!renderer())
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 continue; 770 continue;
771 771
772 Element* element = toElement(node); 772 Element* element = toElement(node);
773 if (element->getIdAttribute() == id) 773 if (element->getIdAttribute() == id)
774 return element; 774 return element;
775 } 775 }
776 return 0; 776 return 0;
777 } 777 }
778 778
779 } 779 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.cpp ('k') | Source/platform/Length.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698