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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1988813002: getComputedStyle should handle over-constrained properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test case Created 4 years, 7 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 | « third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-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 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 default: 240 default:
241 ASSERT_NOT_REACHED(); 241 ASSERT_NOT_REACHED();
242 } 242 }
243 return zoomAdjustedPixelValue(position, style); 243 return zoomAdjustedPixelValue(position, style);
244 } 244 }
245 } 245 }
246 246
247 if (offset.isAuto()) 247 if (offset.isAuto())
248 return cssValuePool().createIdentifierValue(CSSValueAuto); 248 return cssValuePool().createIdentifierValue(CSSValueAuto);
249 249
250 if (layoutObject) {
251 if (!offset.isAuto() && layoutObject->isInFlowPositioned()) {
rune 2016/05/18 21:41:07 offset is not auto at this point, so no need to ch
Deokjin Kim 2016/05/18 23:29:55 You're right. It's typo. I intended to use opposit
mstensho (USE GERRIT) 2016/05/19 05:57:52 No tests failed because of the typo? Then I think
Deokjin Kim 2016/05/19 12:57:24 I added 1 more test case(fast/css/getComputedStyle
252 LayoutBlock* container = layoutObject->containingBlock();
253 bool ltr = container->style()->isLeftToRightDirection();
254 if ((propertyID == CSSPropertyLeft && !ltr) || (propertyID == CSSPro pertyRight && ltr) || (propertyID == CSSPropertyBottom))
255 return zoomAdjustedPixelValue(-opposite.pixels(), style);
256 }
257 }
250 return zoomAdjustedPixelValueForLength(offset, style); 258 return zoomAdjustedPixelValueForLength(offset, style);
251 } 259 }
252 260
253 static CSSBorderImageSliceValue* valueForNinePieceImageSlice(const NinePieceImag e& image) 261 static CSSBorderImageSliceValue* valueForNinePieceImageSlice(const NinePieceImag e& image)
254 { 262 {
255 // Create the slices. 263 // Create the slices.
256 CSSPrimitiveValue* top = nullptr; 264 CSSPrimitiveValue* top = nullptr;
257 CSSPrimitiveValue* right = nullptr; 265 CSSPrimitiveValue* right = nullptr;
258 CSSPrimitiveValue* bottom = nullptr; 266 CSSPrimitiveValue* bottom = nullptr;
259 CSSPrimitiveValue* left = nullptr; 267 CSSPrimitiveValue* left = nullptr;
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 case CSSPropertyAll: 3008 case CSSPropertyAll:
3001 return nullptr; 3009 return nullptr;
3002 default: 3010 default:
3003 break; 3011 break;
3004 } 3012 }
3005 ASSERT_NOT_REACHED(); 3013 ASSERT_NOT_REACHED();
3006 return nullptr; 3014 return nullptr;
3007 } 3015 }
3008 3016
3009 } // namespace blink 3017 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-over-constrained-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698