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

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

Issue 2825343003: Clean compositing inputs for location APIs for sticky-affected elements. (Closed)
Patch Set: Add test for sticky subtrees 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 svg_style.SetBaselineShift(BS_SUB); 959 svg_style.SetBaselineShift(BS_SUB);
960 return; 960 return;
961 case CSSValueSuper: 961 case CSSValueSuper:
962 svg_style.SetBaselineShift(BS_SUPER); 962 svg_style.SetBaselineShift(BS_SUPER);
963 return; 963 return;
964 default: 964 default:
965 NOTREACHED(); 965 NOTREACHED();
966 } 966 }
967 } 967 }
968 968
969 void StyleBuilderFunctions::applyInitialCSSPropertyPosition(
970 StyleResolverState& state) {
971 state.Style()->SetPosition(ComputedStyle::InitialPosition());
972 state.Style()->SetIsInStickySubtree(state.ParentStyle()->IsInStickySubtree());
fs 2017/04/29 09:59:06 Do you even need this? Your bit should essentially
smcgruer 2017/05/01 20:15:15 Done.
973 }
974
969 void StyleBuilderFunctions::applyInheritCSSPropertyPosition( 975 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(
970 StyleResolverState& state) { 976 StyleResolverState& state) {
971 if (!state.ParentNode()->IsDocumentNode()) 977 if (!state.ParentNode()->IsDocumentNode())
972 state.Style()->SetPosition(state.ParentStyle()->GetPosition()); 978 state.Style()->SetPosition(state.ParentStyle()->GetPosition());
979 state.Style()->SetIsInStickySubtree(state.ParentStyle()->IsInStickySubtree());
fs 2017/04/29 09:59:06 Ditto.
smcgruer 2017/05/01 20:15:15 Done.
980 }
981
982 void StyleBuilderFunctions::applyValueCSSPropertyPosition(
983 StyleResolverState& state,
984 const CSSValue& value) {
985 EPosition position = ToCSSIdentifierValue(value).ConvertTo<EPosition>();
986 state.Style()->SetPosition(position);
987 state.Style()->SetIsInStickySubtree(position == EPosition::kSticky ||
fs 2017/04/29 12:10:31 Thinking about it some more, maybe this should rat
smcgruer 2017/05/01 20:15:15 Done. Based on my tests it appears to work, so I a
fs 2017/05/01 21:19:33 Yes, since the flag is part of (rare) inherited, a
988 state.ParentStyle()->IsInStickySubtree());
973 } 989 }
974 990
975 void StyleBuilderFunctions::applyInitialCSSPropertyCaretColor( 991 void StyleBuilderFunctions::applyInitialCSSPropertyCaretColor(
976 StyleResolverState& state) { 992 StyleResolverState& state) {
977 StyleAutoColor color = StyleAutoColor::AutoColor(); 993 StyleAutoColor color = StyleAutoColor::AutoColor();
978 if (state.ApplyPropertyToRegularStyle()) 994 if (state.ApplyPropertyToRegularStyle())
979 state.Style()->SetCaretColor(color); 995 state.Style()->SetCaretColor(color);
980 if (state.ApplyPropertyToVisitedLinkStyle()) 996 if (state.ApplyPropertyToVisitedLinkStyle())
981 state.Style()->SetVisitedLinkCaretColor(color); 997 state.Style()->SetVisitedLinkCaretColor(color);
982 } 998 }
(...skipping 14 matching lines...) Expand all
997 state.Style()->SetCaretColor( 1013 state.Style()->SetCaretColor(
998 StyleBuilderConverter::ConvertStyleAutoColor(state, value)); 1014 StyleBuilderConverter::ConvertStyleAutoColor(state, value));
999 } 1015 }
1000 if (state.ApplyPropertyToVisitedLinkStyle()) { 1016 if (state.ApplyPropertyToVisitedLinkStyle()) {
1001 state.Style()->SetVisitedLinkCaretColor( 1017 state.Style()->SetVisitedLinkCaretColor(
1002 StyleBuilderConverter::ConvertStyleAutoColor(state, value, true)); 1018 StyleBuilderConverter::ConvertStyleAutoColor(state, value, true));
1003 } 1019 }
1004 } 1020 }
1005 1021
1006 } // namespace blink 1022 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698