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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 23651010: Fix getComputedStyle background-position to output calc values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value , const RenderStyle* style) 556 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value , const RenderStyle* style)
557 { 557 {
558 return cssValuePool().createValue(value / style->effectiveZoom(), CSSPrimiti veValue::CSS_NUMBER); 558 return cssValuePool().createValue(value / style->effectiveZoom(), CSSPrimiti veValue::CSS_NUMBER);
559 } 559 }
560 560
561 static PassRefPtr<CSSValue> zoomAdjustedPixelValueForLength(const Length& length , const RenderStyle* style) 561 static PassRefPtr<CSSValue> zoomAdjustedPixelValueForLength(const Length& length , const RenderStyle* style)
562 { 562 {
563 if (length.isFixed()) 563 if (length.isFixed())
564 return zoomAdjustedPixelValue(length.value(), style); 564 return zoomAdjustedPixelValue(length.value(), style);
565 if (length.isCalculated())
566 return cssValuePool().createValue(length, style);
565 return cssValuePool().createValue(length); 567 return cssValuePool().createValue(length);
alancutter (OOO until 2018) 2013/10/08 11:20:08 The "if (length.isCalculated())" is not required h
566 } 568 }
567 569
568 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection , const RenderStyle* style) 570 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection , const RenderStyle* style)
569 { 571 {
570 if (!reflection) 572 if (!reflection)
571 return cssValuePool().createIdentifierValue(CSSValueNone); 573 return cssValuePool().createIdentifierValue(CSSValueNone);
572 574
573 RefPtr<CSSPrimitiveValue> offset; 575 RefPtr<CSSPrimitiveValue> offset;
574 if (reflection->offset().isPercent()) 576 if (reflection->offset().isPercent())
575 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP rimitiveValue::CSS_PERCENTAGE); 577 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP rimitiveValue::CSS_PERCENTAGE);
(...skipping 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3175 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3174 CSSPropertyB ackgroundClip }; 3176 CSSPropertyB ackgroundClip };
3175 3177
3176 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3178 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3177 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3179 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3178 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3180 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3179 return list.release(); 3181 return list.release();
3180 } 3182 }
3181 3183
3182 } // namespace WebCore 3184 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698