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

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

Issue 2878333002: Make ETextModify an enum class. (Closed)
Patch Set: 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return (element && element->IsInTopLayer()) || 130 return (element && element->IsInTopLayer()) ||
131 style.StyleType() == kPseudoIdBackdrop; 131 style.StyleType() == kPseudoIdBackdrop;
132 } 132 }
133 133
134 static bool LayoutParentStyleForcesZIndexToCreateStackingContext( 134 static bool LayoutParentStyleForcesZIndexToCreateStackingContext(
135 const ComputedStyle& layout_parent_style) { 135 const ComputedStyle& layout_parent_style) {
136 return layout_parent_style.IsDisplayFlexibleOrGridBox(); 136 return layout_parent_style.IsDisplayFlexibleOrGridBox();
137 } 137 }
138 138
139 void StyleAdjuster::AdjustStyleForEditing(ComputedStyle& style) { 139 void StyleAdjuster::AdjustStyleForEditing(ComputedStyle& style) {
140 if (style.UserModify() != READ_WRITE_PLAINTEXT_ONLY) 140 if (style.UserModify() != EUserModify::kReadWritePlaintextOnly)
141 return; 141 return;
142 // Collapsing whitespace is harmful in plain-text editing. 142 // Collapsing whitespace is harmful in plain-text editing.
143 if (style.WhiteSpace() == EWhiteSpace::kNormal) 143 if (style.WhiteSpace() == EWhiteSpace::kNormal)
144 style.SetWhiteSpace(EWhiteSpace::kPreWrap); 144 style.SetWhiteSpace(EWhiteSpace::kPreWrap);
145 else if (style.WhiteSpace() == EWhiteSpace::kNowrap) 145 else if (style.WhiteSpace() == EWhiteSpace::kNowrap)
146 style.SetWhiteSpace(EWhiteSpace::kPre); 146 style.SetWhiteSpace(EWhiteSpace::kPre);
147 else if (style.WhiteSpace() == EWhiteSpace::kPreLine) 147 else if (style.WhiteSpace() == EWhiteSpace::kPreLine)
148 style.SetWhiteSpace(EWhiteSpace::kPreWrap); 148 style.SetWhiteSpace(EWhiteSpace::kPreWrap);
149 } 149 }
150 150
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 // must track to properly handle document lifecycle in some cases. 517 // must track to properly handle document lifecycle in some cases.
518 // 518 //
519 // It is possible that this node is already in a sticky subtree (i.e. we have 519 // It is possible that this node is already in a sticky subtree (i.e. we have
520 // nested sticky nodes) - in that case the bit will already be set via 520 // nested sticky nodes) - in that case the bit will already be set via
521 // inheritance from the ancestor and there is no harm to setting it again. 521 // inheritance from the ancestor and there is no harm to setting it again.
522 if (style.GetPosition() == EPosition::kSticky) 522 if (style.GetPosition() == EPosition::kSticky)
523 style.SetSubtreeIsSticky(true); 523 style.SetSubtreeIsSticky(true);
524 } 524 }
525 525
526 } // namespace blink 526 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698