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

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

Issue 2870983002: Update return value of getComputedStyle for sticky elements (Closed)
Patch Set: Update test with testharness.js Created 3 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/sticky/sticky-top-auto-get-computedstyle.html ('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. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
8 * Copyright (C) 2015 Google Inc. All rights reserved. 8 * Copyright (C) 2015 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 ->ContainingBlockLogicalWidthForContent() 217 ->ContainingBlockLogicalWidthForContent()
218 : ToLayoutBox(layout_object) 218 : ToLayoutBox(layout_object)
219 ->ContainingBlockLogicalHeightForGetComputedStyle(); 219 ->ContainingBlockLogicalHeightForGetComputedStyle();
220 return ZoomAdjustedPixelValue(ValueForLength(offset, containing_block_size), 220 return ZoomAdjustedPixelValue(ValueForLength(offset, containing_block_size),
221 style); 221 style);
222 } 222 }
223 223
224 if (offset.IsAuto() && layout_object) { 224 if (offset.IsAuto() && layout_object) {
225 // If the property applies to a positioned element and the resolved value of 225 // If the property applies to a positioned element and the resolved value of
226 // the display property is not none, the resolved value is the used value. 226 // the display property is not none, the resolved value is the used value.
227 if (layout_object->IsInFlowPositioned()) { 227 // Position offsets have special meaning for position sticky so we return
228 // auto when offset.isAuto() on a sticky position object:
229 // https://crbug.com/703816.
230 if (layout_object->IsRelPositioned()) {
228 // If e.g. left is auto and right is not auto, then left's computed value 231 // If e.g. left is auto and right is not auto, then left's computed value
229 // is negative right. So we get the opposite length unit and see if it is 232 // is negative right. So we get the opposite length unit and see if it is
230 // auto. 233 // auto.
231 if (opposite.IsAuto()) 234 if (opposite.IsAuto())
232 return CSSPrimitiveValue::Create(0, 235 return CSSPrimitiveValue::Create(0,
233 CSSPrimitiveValue::UnitType::kPixels); 236 CSSPrimitiveValue::UnitType::kPixels);
234 237
235 if (opposite.IsPercentOrCalc()) { 238 if (opposite.IsPercentOrCalc()) {
236 if (layout_object->IsBox()) { 239 if (layout_object->IsBox()) {
237 LayoutUnit containing_block_size = 240 LayoutUnit containing_block_size =
(...skipping 3507 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 case CSSPropertyAll: 3748 case CSSPropertyAll:
3746 return nullptr; 3749 return nullptr;
3747 default: 3750 default:
3748 break; 3751 break;
3749 } 3752 }
3750 NOTREACHED(); 3753 NOTREACHED();
3751 return nullptr; 3754 return nullptr;
3752 } 3755 }
3753 3756
3754 } // namespace blink 3757 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698