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

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

Issue 6973064: Merge 85971 - https://bugs.webkit.org/show_bug.cgi?id=60398 (<rdar://problem/9307696>) (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/platform/mac/fast/inline/nested-top-alignment-expected.txt ('k') | no next file » | 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 // and the root box's baseline. The value is negative if the child box' s baseline is above the 532 // and the root box's baseline. The value is negative if the child box' s baseline is above the
533 // root box's baseline, and it is positive if the child box's baseline i s below the root box's baseline. 533 // root box's baseline, and it is positive if the child box's baseline i s below the root box's baseline.
534 curr->setLogicalTop(rootBox->verticalPositionForBox(curr, verticalPositi onCache)); 534 curr->setLogicalTop(rootBox->verticalPositionForBox(curr, verticalPositi onCache));
535 535
536 int ascent = 0; 536 int ascent = 0;
537 int descent = 0; 537 int descent = 0;
538 rootBox->ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, a ffectsAscent, affectsDescent); 538 rootBox->ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, a ffectsAscent, affectsDescent);
539 539
540 int boxHeight = ascent + descent; 540 int boxHeight = ascent + descent;
541 if (curr->verticalAlign() == TOP) { 541 if (curr->verticalAlign() == TOP) {
542 if (maxPositionTop < ascent) 542 if (maxPositionTop < boxHeight)
543 maxPositionTop = boxHeight; 543 maxPositionTop = boxHeight;
544 } else if (curr->verticalAlign() == BOTTOM) { 544 } else if (curr->verticalAlign() == BOTTOM) {
545 if (maxPositionBottom < boxHeight) 545 if (maxPositionBottom < boxHeight)
546 maxPositionBottom = boxHeight; 546 maxPositionBottom = boxHeight;
547 } else if (!inlineFlowBox || strictMode || inlineFlowBox->hasTextChildre n() || (inlineFlowBox->descendantsHaveSameLineHeightAndBaseline() && inlineFlowB ox->hasTextDescendants()) 547 } else if (!inlineFlowBox || strictMode || inlineFlowBox->hasTextChildre n() || (inlineFlowBox->descendantsHaveSameLineHeightAndBaseline() && inlineFlowB ox->hasTextDescendants())
548 || inlineFlowBox->boxModelObject()->hasInlineDirectionBorders OrPadding()) { 548 || inlineFlowBox->boxModelObject()->hasInlineDirectionBorders OrPadding()) {
549 // Note that these values can be negative. Even though we only affe ct the maxAscent and maxDescent values 549 // Note that these values can be negative. Even though we only affe ct the maxAscent and maxDescent values
550 // if our box (excluding line-height) was above (for ascent) or belo w (for descent) the root baseline, once you factor in line-height 550 // if our box (excluding line-height) was above (for ascent) or belo w (for descent) the root baseline, once you factor in line-height
551 // the final box can end up being fully above or fully below the roo t box's baseline! This is ok, but what it 551 // the final box can end up being fully above or fully below the roo t box's baseline! This is ok, but what it
552 // means is that ascent and descent (including leading), can end up being negative. The setMaxAscent and 552 // means is that ascent and descent (including leading), can end up being negative. The setMaxAscent and
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 ASSERT(child->prevOnLine() == prev); 1442 ASSERT(child->prevOnLine() == prev);
1443 prev = child; 1443 prev = child;
1444 } 1444 }
1445 ASSERT(prev == m_lastChild); 1445 ASSERT(prev == m_lastChild);
1446 #endif 1446 #endif
1447 } 1447 }
1448 1448
1449 #endif 1449 #endif
1450 1450
1451 } // namespace WebCore 1451 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/mac/fast/inline/nested-top-alignment-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698