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

Unified Diff: sky/engine/core/rendering/style/RenderStyle.cpp

Issue 684383002: Delete a ton more dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@writingmode1
Patch Set: Created 6 years, 2 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
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.h ('k') | sky/engine/platform/geometry/RoundedRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/style/RenderStyle.cpp
diff --git a/sky/engine/core/rendering/style/RenderStyle.cpp b/sky/engine/core/rendering/style/RenderStyle.cpp
index c9ae037d199242ec80b001046eb6b31ca4615720..d1e7d28e9a43c83f88cb906cecd407d3c8413ff6 100644
--- a/sky/engine/core/rendering/style/RenderStyle.cpp
+++ b/sky/engine/core/rendering/style/RenderStyle.cpp
@@ -786,19 +786,17 @@ RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool
if (hasBorderRadius()) {
RoundedRect::Radii radii = calcRadiiFor(surround->border, snappedBorderRect.size());
radii.scale(calcBorderRadiiConstraintScaleFor(borderRect, radii));
- roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
+ roundedRect.includeLogicalEdges(radii, includeLogicalLeftEdge, includeLogicalRightEdge);
}
return roundedRect;
}
RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
- bool horizontal = isHorizontalWritingMode();
-
- int leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
- int rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
- int topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
- int bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
+ int leftWidth = (includeLogicalLeftEdge) ? borderLeftWidth() : 0;
+ int rightWidth = (includeLogicalRightEdge) ? borderRightWidth() : 0;
+ int topWidth = borderTopWidth();
+ int bottomWidth = borderBottomWidth();
return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge);
}
@@ -816,7 +814,7 @@ RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
if (hasBorderRadius()) {
RoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii();
radii.shrink(topWidth, bottomWidth, leftWidth, rightWidth);
- roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
+ roundedRect.includeLogicalEdges(radii, includeLogicalLeftEdge, includeLogicalRightEdge);
}
return roundedRect;
}
@@ -1269,16 +1267,12 @@ const BorderValue& RenderStyle::borderAfter() const
const BorderValue& RenderStyle::borderStart() const
{
- if (isHorizontalWritingMode())
- return isLeftToRightDirection() ? borderLeft() : borderRight();
- return isLeftToRightDirection() ? borderTop() : borderBottom();
+ return isLeftToRightDirection() ? borderLeft() : borderRight();
}
const BorderValue& RenderStyle::borderEnd() const
{
- if (isHorizontalWritingMode())
- return isLeftToRightDirection() ? borderRight() : borderLeft();
- return isLeftToRightDirection() ? borderBottom() : borderTop();
+ return isLeftToRightDirection() ? borderRight() : borderLeft();
}
unsigned short RenderStyle::borderBeforeWidth() const
@@ -1295,46 +1289,28 @@ unsigned short RenderStyle::borderAfterWidth() const
unsigned short RenderStyle::borderStartWidth() const
{
- if (isHorizontalWritingMode())
- return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth();
- return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth();
+ return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth();
}
unsigned short RenderStyle::borderEndWidth() const
{
- if (isHorizontalWritingMode())
- return isLeftToRightDirection() ? borderRightWidth() : borderLeftWidth();
- return isLeftToRightDirection() ? borderBottomWidth() : borderTopWidth();
+ return isLeftToRightDirection() ? borderRightWidth() : borderLeftWidth();
}
void RenderStyle::setMarginStart(const Length& margin)
{
- if (isHorizontalWritingMode()) {
- if (isLeftToRightDirection())
- setMarginLeft(margin);
- else
- setMarginRight(margin);
- } else {
- if (isLeftToRightDirection())
- setMarginTop(margin);
- else
- setMarginBottom(margin);
- }
+ if (isLeftToRightDirection())
+ setMarginLeft(margin);
+ else
+ setMarginRight(margin);
}
void RenderStyle::setMarginEnd(const Length& margin)
{
- if (isHorizontalWritingMode()) {
- if (isLeftToRightDirection())
- setMarginRight(margin);
- else
- setMarginLeft(margin);
- } else {
- if (isLeftToRightDirection())
- setMarginBottom(margin);
- else
- setMarginTop(margin);
- }
+ if (isLeftToRightDirection())
+ setMarginRight(margin);
+ else
+ setMarginLeft(margin);
}
TextEmphasisMark RenderStyle::textEmphasisMark() const
@@ -1342,11 +1318,7 @@ TextEmphasisMark RenderStyle::textEmphasisMark() const
TextEmphasisMark mark = static_cast<TextEmphasisMark>(rareInheritedData->textEmphasisMark);
if (mark != TextEmphasisMarkAuto)
return mark;
-
- if (isHorizontalWritingMode())
- return TextEmphasisMarkDot;
-
- return TextEmphasisMarkSesame;
+ return TextEmphasisMarkDot;
}
Color RenderStyle::initialTapHighlightColor()
« no previous file with comments | « sky/engine/core/rendering/style/RenderStyle.h ('k') | sky/engine/platform/geometry/RoundedRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698