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

Side by Side Diff: sky/engine/core/rendering/InlineFlowBox.cpp

Issue 688213002: First pass at removing dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/rendering/InlineFlowBox.h ('k') | sky/engine/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 LayoutUnit newLogicalTop = curr->logicalTop(); 631 LayoutUnit newLogicalTop = curr->logicalTop();
632 LayoutUnit newLogicalTopIncludingMargins = newLogicalTop; 632 LayoutUnit newLogicalTopIncludingMargins = newLogicalTop;
633 LayoutUnit boxHeight = curr->logicalHeight(); 633 LayoutUnit boxHeight = curr->logicalHeight();
634 LayoutUnit boxHeightIncludingMargins = boxHeight; 634 LayoutUnit boxHeightIncludingMargins = boxHeight;
635 LayoutUnit borderPaddingHeight = 0; 635 LayoutUnit borderPaddingHeight = 0;
636 if (curr->isText() || curr->isInlineFlowBox()) { 636 if (curr->isText() || curr->isInlineFlowBox()) {
637 const FontMetrics& fontMetrics = curr->renderer().style(isFirstLineS tyle())->fontMetrics(); 637 const FontMetrics& fontMetrics = curr->renderer().style(isFirstLineS tyle())->fontMetrics();
638 newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics. ascent(baselineType); 638 newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics. ascent(baselineType);
639 if (curr->isInlineFlowBox()) { 639 if (curr->isInlineFlowBox()) {
640 RenderBoxModelObject& boxObject = toRenderBoxModelObject(curr->r enderer()); 640 RenderBoxModelObject& boxObject = toRenderBoxModelObject(curr->r enderer());
641 newLogicalTop -= boxObject.style(isFirstLineStyle())->isHorizont alWritingMode() ? boxObject.borderTop() + boxObject.paddingTop() : 641 newLogicalTop -= boxObject.borderTop() + boxObject.paddingTop();
642 boxObject.borderRight() + boxObject.paddingRight();
643 borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight(); 642 borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight();
644 } 643 }
645 newLogicalTopIncludingMargins = newLogicalTop; 644 newLogicalTopIncludingMargins = newLogicalTop;
646 } else { 645 } else {
647 RenderBox& box = toRenderBox(curr->renderer()); 646 RenderBox& box = toRenderBox(curr->renderer());
648 newLogicalTopIncludingMargins = newLogicalTop; 647 newLogicalTopIncludingMargins = newLogicalTop;
649 LayoutUnit overSideMargin = curr->isHorizontal() ? box.marginTop() : box.marginRight(); 648 LayoutUnit overSideMargin = curr->isHorizontal() ? box.marginTop() : box.marginRight();
650 LayoutUnit underSideMargin = curr->isHorizontal() ? box.marginBottom () : box.marginLeft(); 649 LayoutUnit underSideMargin = curr->isHorizontal() ? box.marginBottom () : box.marginLeft();
651 newLogicalTop += overSideMargin; 650 newLogicalTop += overSideMargin;
652 boxHeightIncludingMargins += overSideMargin + underSideMargin; 651 boxHeightIncludingMargins += overSideMargin + underSideMargin;
653 } 652 }
654 653
655 curr->setLogicalTop(newLogicalTop.toFloat()); 654 curr->setLogicalTop(newLogicalTop.toFloat());
656 655
657 if (childAffectsTopBottomPos) { 656 if (childAffectsTopBottomPos) {
658 if (curr->isInlineTextBox()) { 657 if (curr->isInlineTextBox()) {
659 TextEmphasisPosition emphasisMarkPosition; 658 TextEmphasisPosition emphasisMarkPosition;
660 if (toInlineTextBox(curr)->getEmphasisMarkPosition(curr->rendere r().style(isFirstLineStyle()), emphasisMarkPosition)) { 659 if (toInlineTextBox(curr)->getEmphasisMarkPosition(curr->rendere r().style(isFirstLineStyle()), emphasisMarkPosition)) {
661 bool emphasisMarkIsOver = emphasisMarkPosition == TextEmphas isPositionOver; 660 bool emphasisMarkIsOver = emphasisMarkPosition == TextEmphas isPositionOver;
662 if (emphasisMarkIsOver != curr->renderer().style(isFirstLine Style())->isFlippedLinesWritingMode()) 661 if (emphasisMarkIsOver)
663 hasAnnotationsBefore = true; 662 hasAnnotationsBefore = true;
664 else 663 else
665 hasAnnotationsAfter = true; 664 hasAnnotationsAfter = true;
666 } 665 }
667 } 666 }
668 667
669 if (!setLineTop) { 668 if (!setLineTop) {
670 setLineTop = true; 669 setLineTop = true;
671 lineTop = newLogicalTop; 670 lineTop = newLogicalTop;
672 lineTopIncludingMargins = std::min(lineTop, newLogicalTopIncludi ngMargins); 671 lineTopIncludingMargins = std::min(lineTop, newLogicalTopIncludi ngMargins);
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 ASSERT(child->prevOnLine() == prev); 1551 ASSERT(child->prevOnLine() == prev);
1553 prev = child; 1552 prev = child;
1554 } 1553 }
1555 ASSERT(prev == m_lastChild); 1554 ASSERT(prev == m_lastChild);
1556 #endif 1555 #endif
1557 } 1556 }
1558 1557
1559 #endif 1558 #endif
1560 1559
1561 } // namespace blink 1560 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/InlineFlowBox.h ('k') | sky/engine/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698