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

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

Issue 25154003: valueForBorderRadiusShorthand returns wrong values in some case. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed border-radius-interpolation.html 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2-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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 { 686 {
687 RefPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style, rende rer, renderView); 687 RefPtr<CSSValueList> list = valuesForBorderRadiusCorner(radius, style, rende rer, renderView);
688 if (list->item(0)->equals(*list->item(1))) 688 if (list->item(0)->equals(*list->item(1)))
689 return list->item(0); 689 return list->item(0);
690 return list.release(); 690 return list.release();
691 } 691 }
692 692
693 static PassRefPtr<CSSValueList> valueForBorderRadiusShorthand(const RenderStyle* style, RenderObject* renderer, RenderView* renderView) 693 static PassRefPtr<CSSValueList> valueForBorderRadiusShorthand(const RenderStyle* style, RenderObject* renderer, RenderView* renderView)
694 { 694 {
695 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 695 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
696
696 bool showHorizontalBottomLeft = style->borderTopRightRadius().width() != sty le->borderBottomLeftRadius().width(); 697 bool showHorizontalBottomLeft = style->borderTopRightRadius().width() != sty le->borderBottomLeftRadius().width();
697 bool showHorizontalBottomRight = style->borderBottomRightRadius().width() != style->borderTopLeftRadius().width(); 698 bool showHorizontalBottomRight = showHorizontalBottomLeft || (style->borderB ottomRightRadius().width() != style->borderTopLeftRadius().width());
698 bool showHorizontalTopRight = style->borderTopRightRadius().width() != style ->borderTopLeftRadius().width(); 699 bool showHorizontalTopRight = showHorizontalBottomRight || (style->borderTop RightRadius().width() != style->borderTopLeftRadius().width());
699 700
700 bool showVerticalBottomLeft = style->borderTopRightRadius().height() != styl e->borderBottomLeftRadius().height(); 701 bool showVerticalBottomLeft = style->borderTopRightRadius().height() != styl e->borderBottomLeftRadius().height();
701 bool showVerticalBottomRight = (style->borderBottomRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomLeft; 702 bool showVerticalBottomRight = showVerticalBottomLeft || (style->borderBotto mRightRadius().height() != style->borderTopLeftRadius().height());
702 bool showVerticalTopRight = (style->borderTopRightRadius().height() != style ->borderTopLeftRadius().height()) || showVerticalBottomRight; 703 bool showVerticalTopRight = showVerticalBottomRight || (style->borderTopRigh tRadius().height() != style->borderTopLeftRadius().height());
703 bool showVerticalTopLeft = (style->borderTopLeftRadius().width() != style->b orderTopLeftRadius().height()); 704 bool showVerticalTopLeft = (style->borderTopLeftRadius().width() != style->b orderTopLeftRadius().height());
704 705
705 RefPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style->bord erTopLeftRadius(), style, renderer, renderView); 706 RefPtr<CSSValueList> topLeftRadius = valuesForBorderRadiusCorner(style->bord erTopLeftRadius(), style, renderer, renderView);
706 RefPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style->bor derTopRightRadius(), style, renderer, renderView); 707 RefPtr<CSSValueList> topRightRadius = valuesForBorderRadiusCorner(style->bor derTopRightRadius(), style, renderer, renderView);
707 RefPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style-> borderBottomRightRadius(), style, renderer, renderView); 708 RefPtr<CSSValueList> bottomRightRadius = valuesForBorderRadiusCorner(style-> borderBottomRightRadius(), style, renderer, renderView);
708 RefPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style->b orderBottomLeftRadius(), style, renderer, renderView); 709 RefPtr<CSSValueList> bottomLeftRadius = valuesForBorderRadiusCorner(style->b orderBottomLeftRadius(), style, renderer, renderView);
709 710
710 RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated(); 711 RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated();
711 horizontalRadii->append(topLeftRadius->item(0)); 712 horizontalRadii->append(topLeftRadius->item(0));
712 if (showHorizontalTopRight) 713 if (showHorizontalTopRight)
(...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3196 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3196 CSSPropertyB ackgroundClip }; 3197 CSSPropertyB ackgroundClip };
3197 3198
3198 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3199 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3199 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3200 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3200 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3201 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3201 return list.release(); 3202 return list.release();
3202 } 3203 }
3203 3204
3204 } // namespace WebCore 3205 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698