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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 11 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 | « Source/core/rendering/RenderView.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('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, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 verticalPosition -= (renderer->lineHeight(firstLine, lineDirecti on) - renderer->baselinePosition(baselineType(), firstLine, lineDirection)); 884 verticalPosition -= (renderer->lineHeight(firstLine, lineDirecti on) - renderer->baselinePosition(baselineType(), firstLine, lineDirection));
885 } else if (verticalAlign == BASELINE_MIDDLE) 885 } else if (verticalAlign == BASELINE_MIDDLE)
886 verticalPosition += -renderer->lineHeight(firstLine, lineDirection) / 2 + renderer->baselinePosition(baselineType(), firstLine, lineDirection); 886 verticalPosition += -renderer->lineHeight(firstLine, lineDirection) / 2 + renderer->baselinePosition(baselineType(), firstLine, lineDirection);
887 else if (verticalAlign == LENGTH) { 887 else if (verticalAlign == LENGTH) {
888 LayoutUnit lineHeight; 888 LayoutUnit lineHeight;
889 //Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align : 'Percentages: refer to the 'line-height' of the element itself'. 889 //Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align : 'Percentages: refer to the 'line-height' of the element itself'.
890 if (renderer->style()->verticalAlignLength().isPercent()) 890 if (renderer->style()->verticalAlignLength().isPercent())
891 lineHeight = renderer->style()->computedLineHeight(); 891 lineHeight = renderer->style()->computedLineHeight();
892 else 892 else
893 lineHeight = renderer->lineHeight(firstLine, lineDirection); 893 lineHeight = renderer->lineHeight(firstLine, lineDirection);
894 verticalPosition -= valueForLength(renderer->style()->verticalAlignL ength(), lineHeight, renderer->view()); 894 verticalPosition -= valueForLength(renderer->style()->verticalAlignL ength(), lineHeight);
895 } 895 }
896 } 896 }
897 897
898 // Store the cached value. 898 // Store the cached value.
899 if (isRenderInline && !firstLine) 899 if (isRenderInline && !firstLine)
900 verticalPositionCache.set(renderer, baselineType(), verticalPosition); 900 verticalPositionCache.set(renderer, baselineType(), verticalPosition);
901 901
902 return verticalPosition; 902 return verticalPosition;
903 } 903 }
904 904
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 } 989 }
990 990
991 #ifndef NDEBUG 991 #ifndef NDEBUG
992 const char* RootInlineBox::boxName() const 992 const char* RootInlineBox::boxName() const
993 { 993 {
994 return "RootInlineBox"; 994 return "RootInlineBox";
995 } 995 }
996 #endif 996 #endif
997 997
998 } // namespace WebCore 998 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderView.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698