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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMeter.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix additional test Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 ASSERT(node()->shadowHost()); 46 ASSERT(node()->shadowHost());
47 return toHTMLMeterElement(node()->shadowHost()); 47 return toHTMLMeterElement(node()->shadowHost());
48 } 48 }
49 49
50 void LayoutMeter::updateLogicalWidth() 50 void LayoutMeter::updateLogicalWidth()
51 { 51 {
52 LayoutBox::updateLogicalWidth(); 52 LayoutBox::updateLogicalWidth();
53 53
54 IntSize frameSize = LayoutTheme::theme().meterSizeForBounds(*this, pixelSnap pedIntRect(frameRect())); 54 IntSize frameSize = LayoutTheme::theme().meterSizeForBounds(*this, pixelSnap pedIntRect(frameRect()));
55 setLogicalWidth(isHorizontalWritingMode() ? frameSize.width() : frameSize.he ight()); 55 setLogicalWidth(LayoutUnit(isHorizontalWritingMode() ? frameSize.width() : f rameSize.height()));
56 } 56 }
57 57
58 void LayoutMeter::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logi calTop, LogicalExtentComputedValues& computedValues) const 58 void LayoutMeter::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logi calTop, LogicalExtentComputedValues& computedValues) const
59 { 59 {
60 LayoutBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues); 60 LayoutBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
61 61
62 LayoutRect frame = frameRect(); 62 LayoutRect frame = frameRect();
63 if (isHorizontalWritingMode()) 63 if (isHorizontalWritingMode())
64 frame.setHeight(computedValues.m_extent); 64 frame.setHeight(computedValues.m_extent);
65 else 65 else
66 frame.setWidth(computedValues.m_extent); 66 frame.setWidth(computedValues.m_extent);
67 IntSize frameSize = LayoutTheme::theme().meterSizeForBounds(*this, pixelSnap pedIntRect(frame)); 67 IntSize frameSize = LayoutTheme::theme().meterSizeForBounds(*this, pixelSnap pedIntRect(frame));
68 computedValues.m_extent = isHorizontalWritingMode() ? frameSize.height() : f rameSize.width(); 68 computedValues.m_extent = LayoutUnit(isHorizontalWritingMode() ? frameSize.h eight() : frameSize.width());
69 } 69 }
70 70
71 void LayoutMeter::updateFromElement() 71 void LayoutMeter::updateFromElement()
72 { 72 {
73 setShouldDoFullPaintInvalidation(); 73 setShouldDoFullPaintInvalidation();
74 } 74 }
75 75
76 } // namespace blink 76 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698