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

Side by Side Diff: Source/core/css/resolver/CSSToStyleMap.cpp

Issue 302643002: Remove zoom special casing of SVG when computing border-widths (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove method on CSSToStyleMap rendered unnecessary Created 6 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
« no previous file with comments | « Source/core/css/resolver/CSSToStyleMap.h ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 29 matching lines...) Expand all
40 #include "core/rendering/style/BorderImageLengthBox.h" 40 #include "core/rendering/style/BorderImageLengthBox.h"
41 #include "core/rendering/style/FillLayer.h" 41 #include "core/rendering/style/FillLayer.h"
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 const CSSToLengthConversionData& CSSToStyleMap::cssToLengthConversionData() cons t 45 const CSSToLengthConversionData& CSSToStyleMap::cssToLengthConversionData() cons t
46 { 46 {
47 return m_state.cssToLengthConversionData(); 47 return m_state.cssToLengthConversionData();
48 } 48 }
49 49
50 bool CSSToStyleMap::useSVGZoomRules() const
51 {
52 return m_state.useSVGZoomRules();
53 }
54
55 PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSVa lue* value) 50 PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSVa lue* value)
56 { 51 {
57 return m_elementStyleResources.styleImage(m_state.document(), m_state.docume nt().textLinkColors(), m_state.style()->color(), propertyId, value); 52 return m_elementStyleResources.styleImage(m_state.document(), m_state.docume nt().textLinkColors(), m_state.style()->color(), propertyId, value);
58 } 53 }
59 54
60 void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value) const 55 void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value) const
61 { 56 {
62 if (value->isInitialValue()) { 57 if (value->isInitialValue()) {
63 layer->setAttachment(FillLayer::initialFillAttachment(layer->type())); 58 layer->setAttachment(FillLayer::initialFillAttachment(layer->type()));
64 return; 59 return;
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 if (value.getValueID() != CSSValueAuto) 536 if (value.getValueID() != CSSValueAuto)
542 return value.computeLength<Length>(conversionData); 537 return value.computeLength<Length>(conversionData);
543 return Length(Auto); 538 return Length(Auto);
544 } 539 }
545 540
546 BorderImageLengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const 541 BorderImageLengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const
547 { 542 {
548 if (!value || !value->isPrimitiveValue()) 543 if (!value || !value->isPrimitiveValue())
549 return BorderImageLengthBox(Length(Auto)); 544 return BorderImageLengthBox(Length(Auto));
550 545
551 float zoom = useSVGZoomRules() ? 1.0f : cssToLengthConversionData().zoom();
552 Quad* slices = toCSSPrimitiveValue(value)->getQuadValue(); 546 Quad* slices = toCSSPrimitiveValue(value)->getQuadValue();
553 547
554 // Set up a border image length box to represent our image slices. 548 // Set up a border image length box to represent our image slices.
555 const CSSToLengthConversionData& conversionData = cssToLengthConversionData( ).copyWithAdjustedZoom(zoom);
556 return BorderImageLengthBox( 549 return BorderImageLengthBox(
557 toBorderImageLength(*slices->top(), conversionData), 550 toBorderImageLength(*slices->top(), cssToLengthConversionData()),
558 toBorderImageLength(*slices->right(), conversionData), 551 toBorderImageLength(*slices->right(), cssToLengthConversionData()),
559 toBorderImageLength(*slices->bottom(), conversionData), 552 toBorderImageLength(*slices->bottom(), cssToLengthConversionData()),
560 toBorderImageLength(*slices->left(), conversionData)); 553 toBorderImageLength(*slices->left(), cssToLengthConversionData()));
561 } 554 }
562 555
563 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima ge) const 556 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima ge) const
564 { 557 {
565 if (!value || !value->isPrimitiveValue()) 558 if (!value || !value->isPrimitiveValue())
566 return; 559 return;
567 560
568 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 561 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
569 Pair* pair = primitiveValue->getPairValue(); 562 Pair* pair = primitiveValue->getPairValue();
570 if (!pair || !pair->first() || !pair->second()) 563 if (!pair || !pair->first() || !pair->second())
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 verticalRule = SpaceImageRule; 595 verticalRule = SpaceImageRule;
603 break; 596 break;
604 default: // CSSValueRepeat 597 default: // CSSValueRepeat
605 verticalRule = RepeatImageRule; 598 verticalRule = RepeatImageRule;
606 break; 599 break;
607 } 600 }
608 image.setVerticalRule(verticalRule); 601 image.setVerticalRule(verticalRule);
609 } 602 }
610 603
611 }; 604 };
OLDNEW
« no previous file with comments | « Source/core/css/resolver/CSSToStyleMap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698