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

Side by Side Diff: Source/core/rendering/InlineFlowBox.cpp

Issue 40733004: Replace compile flag with runtime check for text-underline-position (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Julien's review #2 (rebased) Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/InlineFlowBox.h ('k') | Source/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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 } 721 }
722 lineBottom = max<LayoutUnit>(lineBottom, pixelSnappedLogicalBottom() ); 722 lineBottom = max<LayoutUnit>(lineBottom, pixelSnappedLogicalBottom() );
723 lineBottomIncludingMargins = max(lineBottom, lineBottomIncludingMarg ins); 723 lineBottomIncludingMargins = max(lineBottom, lineBottomIncludingMarg ins);
724 } 724 }
725 725
726 if (renderer()->style()->isFlippedLinesWritingMode()) 726 if (renderer()->style()->isFlippedLinesWritingMode())
727 flipLinesInBlockDirection(lineTopIncludingMargins, lineBottomIncludi ngMargins); 727 flipLinesInBlockDirection(lineTopIncludingMargins, lineBottomIncludi ngMargins);
728 } 728 }
729 } 729 }
730 730
731 #if ENABLE(CSS3_TEXT)
732 void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop) const 731 void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop) const
733 { 732 {
734 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 733 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
735 if (curr->renderer()->isOutOfFlowPositioned()) 734 if (curr->renderer()->isOutOfFlowPositioned())
736 continue; // Positioned placeholders don't affect calculations. 735 continue; // Positioned placeholders don't affect calculations.
737 736
738 if (descendantsHaveSameLineHeightAndBaseline()) 737 if (descendantsHaveSameLineHeightAndBaseline())
739 continue; 738 continue;
740 739
741 maxLogicalTop = max<float>(maxLogicalTop, curr->y()); 740 maxLogicalTop = max<float>(maxLogicalTop, curr->y());
742 float localMaxLogicalTop = 0; 741 float localMaxLogicalTop = 0;
743 if (curr->isInlineFlowBox()) 742 if (curr->isInlineFlowBox())
744 toInlineFlowBox(curr)->computeMaxLogicalTop(localMaxLogicalTop); 743 toInlineFlowBox(curr)->computeMaxLogicalTop(localMaxLogicalTop);
745 maxLogicalTop = max<float>(maxLogicalTop, localMaxLogicalTop); 744 maxLogicalTop = max<float>(maxLogicalTop, localMaxLogicalTop);
746 } 745 }
747 } 746 }
748 #endif // CSS3_TEXT
749 747
750 void InlineFlowBox::flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lin eBottom) 748 void InlineFlowBox::flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lin eBottom)
751 { 749 {
752 // Flip the box on the line such that the top is now relative to the lineBot tom instead of the lineTop. 750 // Flip the box on the line such that the top is now relative to the lineBot tom instead of the lineTop.
753 setLogicalTop(lineBottom - (logicalTop() - lineTop) - logicalHeight()); 751 setLogicalTop(lineBottom - (logicalTop() - lineTop) - logicalHeight());
754 752
755 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 753 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
756 if (curr->renderer()->isOutOfFlowPositioned()) 754 if (curr->renderer()->isOutOfFlowPositioned())
757 continue; // Positioned placeholders aren't affected here. 755 continue; // Positioned placeholders aren't affected here.
758 756
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 ASSERT(child->prevOnLine() == prev); 1634 ASSERT(child->prevOnLine() == prev);
1637 prev = child; 1635 prev = child;
1638 } 1636 }
1639 ASSERT(prev == m_lastChild); 1637 ASSERT(prev == m_lastChild);
1640 #endif 1638 #endif
1641 } 1639 }
1642 1640
1643 #endif 1641 #endif
1644 1642
1645 } // namespace WebCore 1643 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/InlineFlowBox.h ('k') | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698