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

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

Issue 2667493002: Changed EPosition to an enum class and renamed its members (Closed)
Patch Set: Rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
index 1a2332842c907f5238174e1501ef830e89dc71bf..291b8c727d87bf5be3c24bfac9a91e1c6f4eb798 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -155,7 +155,7 @@ static void adjustStyleForFirstLetter(ComputedStyle& style) {
style.setDisplay(style.isFloating() ? EDisplay::Block : EDisplay::Inline);
// CSS2 says first-letter can't be positioned.
- style.setPosition(StaticPosition);
+ style.setPosition(EPosition::kStatic);
}
void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style,
@@ -223,7 +223,7 @@ static void adjustStyleForHTMLElement(ComputedStyle& style,
// Frames and framesets never honor position:relative or position:absolute.
// This is necessary to fix a crash where a site tries to position these
// objects. They also never honor display.
- style.setPosition(StaticPosition);
+ style.setPosition(EPosition::kStatic);
style.setDisplay(EDisplay::Block);
return;
}
@@ -239,7 +239,7 @@ static void adjustStyleForHTMLElement(ComputedStyle& style,
if (isHTMLRTElement(element)) {
// Ruby text does not support float or position. This might change with
// evolution of the specification.
- style.setPosition(StaticPosition);
+ style.setPosition(EPosition::kStatic);
style.setFloating(EFloat::kNone);
return;
}
@@ -336,16 +336,16 @@ static void adjustStyleForDisplay(ComputedStyle& style,
style.display() == EDisplay::TableRowGroup ||
style.display() == EDisplay::TableFooterGroup ||
style.display() == EDisplay::TableRow) &&
- style.position() == RelativePosition)
- style.setPosition(StaticPosition);
+ style.position() == EPosition::kRelative)
+ style.setPosition(EPosition::kStatic);
// Cannot support position: sticky for table columns and column groups because
// current code is only doing background painting through columns / column
// groups.
if ((style.display() == EDisplay::TableColumnGroup ||
style.display() == EDisplay::TableColumn) &&
- style.position() == StickyPosition)
- style.setPosition(StaticPosition);
+ style.position() == EPosition::kSticky)
+ style.setPosition(EPosition::kStatic);
// writing-mode does not apply to table row groups, table column groups, table
// rows, and table columns.
@@ -394,9 +394,10 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
// Per the spec, position 'static' and 'relative' in the top layer compute
// to 'absolute'.
- if (isInTopLayer(element, style) && (style.position() == StaticPosition ||
- style.position() == RelativePosition))
- style.setPosition(AbsolutePosition);
+ if (isInTopLayer(element, style) &&
+ (style.position() == EPosition::kStatic ||
+ style.position() == EPosition::kRelative))
+ style.setPosition(EPosition::kAbsolute);
// Absolute/fixed positioned elements, floating elements and the document
// element need block-like outside display.
@@ -423,7 +424,7 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
style.setHasCompositorProxy(true);
// Make sure our z-index value is only applied if the object is positioned.
- if (style.position() == StaticPosition &&
+ if (style.position() == EPosition::kStatic &&
!parentStyleForcesZIndexToCreateStackingContext(parentStyle)) {
style.setIsStackingContext(false);
// TODO(alancutter): Avoid altering z-index here.

Powered by Google App Engine
This is Rietveld 408576698