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

Unified Diff: sky/engine/core/rendering/InlineFlowBox.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/InlineBox.cpp ('k') | sky/engine/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/InlineFlowBox.cpp
diff --git a/sky/engine/core/rendering/InlineFlowBox.cpp b/sky/engine/core/rendering/InlineFlowBox.cpp
index 846c57fabd01d8627b003e5b51bbe01e0d19ef91..75ecaaa194fb3ae093b58750d185eeaefff4e99f 100644
--- a/sky/engine/core/rendering/InlineFlowBox.cpp
+++ b/sky/engine/core/rendering/InlineFlowBox.cpp
@@ -699,9 +699,6 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei
lineBottom = std::max<LayoutUnit>(lineBottom, pixelSnappedLogicalBottom());
lineBottomIncludingMargins = std::max(lineBottom, lineBottomIncludingMargins);
}
-
- if (renderer().style()->isFlippedLinesWritingMode())
- flipLinesInBlockDirection(lineTopIncludingMargins, lineBottomIncludingMargins);
}
}
@@ -754,8 +751,8 @@ inline void InlineFlowBox::addBoxShadowVisualOverflow(LayoutRect& logicalVisualO
// Similar to how glyph overflow works, if our lines are flipped, then it's actually the opposite shadow that applies, since
// the line is "upside down" in terms of block coordinates.
- LayoutUnit shadowLogicalTop = style->isFlippedLinesWritingMode() ? -boxShadowLogicalBottom : boxShadowLogicalTop;
- LayoutUnit shadowLogicalBottom = style->isFlippedLinesWritingMode() ? -boxShadowLogicalTop : boxShadowLogicalBottom;
+ LayoutUnit shadowLogicalTop = boxShadowLogicalTop;
+ LayoutUnit shadowLogicalBottom = boxShadowLogicalBottom;
LayoutUnit logicalTopVisualOverflow = std::min(pixelSnappedLogicalTop() + shadowLogicalTop, logicalVisualOverflow.y());
LayoutUnit logicalBottomVisualOverflow = std::max(pixelSnappedLogicalBottom() + shadowLogicalBottom, logicalVisualOverflow.maxY());
@@ -790,8 +787,8 @@ inline void InlineFlowBox::addBorderOutsetVisualOverflow(LayoutRect& logicalVisu
// Similar to how glyph overflow works, if our lines are flipped, then it's actually the opposite border that applies, since
// the line is "upside down" in terms of block coordinates. vertical-rl and horizontal-bt are the flipped line modes.
- LayoutUnit outsetLogicalTop = style->isFlippedLinesWritingMode() ? borderOutsetLogicalBottom : borderOutsetLogicalTop;
- LayoutUnit outsetLogicalBottom = style->isFlippedLinesWritingMode() ? borderOutsetLogicalTop : borderOutsetLogicalBottom;
+ LayoutUnit outsetLogicalTop = borderOutsetLogicalTop;
+ LayoutUnit outsetLogicalBottom = borderOutsetLogicalBottom;
LayoutUnit logicalTopVisualOverflow = std::min(pixelSnappedLogicalTop() - outsetLogicalTop, logicalVisualOverflow.y());
LayoutUnit logicalBottomVisualOverflow = std::max(pixelSnappedLogicalBottom() + outsetLogicalBottom, logicalVisualOverflow.maxY());
@@ -828,10 +825,9 @@ inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox* textBox, Glyp
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(textBox);
GlyphOverflow* glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->value.second;
- bool isFlippedLine = style->isFlippedLinesWritingMode();
- int topGlyphEdge = glyphOverflow ? (isFlippedLine ? glyphOverflow->bottom : glyphOverflow->top) : 0;
- int bottomGlyphEdge = glyphOverflow ? (isFlippedLine ? glyphOverflow->top : glyphOverflow->bottom) : 0;
+ int topGlyphEdge = glyphOverflow ? glyphOverflow->top : 0;
+ int bottomGlyphEdge = glyphOverflow ? glyphOverflow->bottom : 0;
int leftGlyphEdge = glyphOverflow ? glyphOverflow->left : 0;
int rightGlyphEdge = glyphOverflow ? glyphOverflow->right : 0;
@@ -844,7 +840,7 @@ inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox* textBox, Glyp
TextEmphasisPosition emphasisMarkPosition;
if (style->textEmphasisMark() != TextEmphasisMarkNone && textBox->getEmphasisMarkPosition(style, emphasisMarkPosition)) {
int emphasisMarkHeight = style->font().emphasisMarkHeight(style->textEmphasisMarkString());
- if ((emphasisMarkPosition == TextEmphasisPositionOver) == (!style->isFlippedLinesWritingMode()))
+ if (emphasisMarkPosition == TextEmphasisPositionOver)
topGlyphOverflow = std::min(topGlyphOverflow, -emphasisMarkHeight);
else
bottomGlyphOverflow = std::max(bottomGlyphOverflow, emphasisMarkHeight);
@@ -1432,13 +1428,8 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi
RenderStyle* style = curr->renderer().style(isFirstLineStyle());
TextEmphasisPosition emphasisMarkPosition;
if (style->textEmphasisMark() != TextEmphasisMarkNone && toInlineTextBox(curr)->getEmphasisMarkPosition(style, emphasisMarkPosition) && emphasisMarkPosition == TextEmphasisPositionOver) {
- if (!style->isFlippedLinesWritingMode()) {
- int topOfEmphasisMark = curr->logicalTop() - style->font().emphasisMarkHeight(style->textEmphasisMarkString());
- result = std::max(result, allowedPosition - topOfEmphasisMark);
- } else {
- int bottomOfEmphasisMark = curr->logicalBottom() + style->font().emphasisMarkHeight(style->textEmphasisMarkString());
- result = std::max(result, bottomOfEmphasisMark - allowedPosition);
- }
+ int topOfEmphasisMark = curr->logicalTop() - style->font().emphasisMarkHeight(style->textEmphasisMarkString());
+ result = std::max(result, allowedPosition - topOfEmphasisMark);
}
}
}
@@ -1458,13 +1449,8 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos
if (curr->isInlineTextBox()) {
RenderStyle* style = curr->renderer().style(isFirstLineStyle());
if (style->textEmphasisMark() != TextEmphasisMarkNone && style->textEmphasisPosition() == TextEmphasisPositionUnder) {
- if (!style->isFlippedLinesWritingMode()) {
- LayoutUnit bottomOfEmphasisMark = curr->logicalBottom() + style->font().emphasisMarkHeight(style->textEmphasisMarkString());
- result = std::max(result, bottomOfEmphasisMark - allowedPosition);
- } else {
- LayoutUnit topOfEmphasisMark = curr->logicalTop() - style->font().emphasisMarkHeight(style->textEmphasisMarkString());
- result = std::max(result, allowedPosition - topOfEmphasisMark);
- }
+ LayoutUnit bottomOfEmphasisMark = curr->logicalBottom() + style->font().emphasisMarkHeight(style->textEmphasisMarkString());
+ result = std::max(result, bottomOfEmphasisMark - allowedPosition);
}
}
}
« no previous file with comments | « sky/engine/core/rendering/InlineBox.cpp ('k') | sky/engine/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698