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

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: Update test and cleanup the patch Created 7 years, 2 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 | « LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-position-calc-expected.txt ('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 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 557
558 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value , const RenderStyle* style) 558 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value , const RenderStyle* style)
559 { 559 {
560 return cssValuePool().createValue(value / style->effectiveZoom(), CSSPrimiti veValue::CSS_NUMBER); 560 return cssValuePool().createValue(value / style->effectiveZoom(), CSSPrimiti veValue::CSS_NUMBER);
561 } 561 }
562 562
563 static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Lengt h& length, const RenderStyle* style) 563 static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength(const Lengt h& length, const RenderStyle* style)
564 { 564 {
565 if (length.isFixed()) 565 if (length.isFixed())
566 return zoomAdjustedPixelValue(length.value(), style); 566 return zoomAdjustedPixelValue(length.value(), style);
567 return cssValuePool().createValue(length); 567 return cssValuePool().createValue(length, style);
568 } 568 }
569 569
570 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection , const RenderStyle* style) 570 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection , const RenderStyle* style)
571 { 571 {
572 if (!reflection) 572 if (!reflection)
573 return cssValuePool().createIdentifierValue(CSSValueNone); 573 return cssValuePool().createIdentifierValue(CSSValueNone);
574 574
575 RefPtr<CSSPrimitiveValue> offset; 575 RefPtr<CSSPrimitiveValue> offset;
576 if (reflection->offset().isPercent()) 576 if (reflection->offset().isPercent())
577 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP rimitiveValue::CSS_PERCENTAGE); 577 offset = cssValuePool().createValue(reflection->offset().percent(), CSSP rimitiveValue::CSS_PERCENTAGE);
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
3238 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3238 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3239 CSSPropertyB ackgroundClip }; 3239 CSSPropertyB ackgroundClip };
3240 3240
3241 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3241 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3242 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3242 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3243 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3243 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3244 return list.release(); 3244 return list.release();
3245 } 3245 }
3246 3246
3247 } // namespace WebCore 3247 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-position-calc-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698