https://bugs.webkit.org/show_bug.cgi?id=97475
Reviewed by Ojan Vafai.
Using RenderMeter::computeLogicalHeight is part of bug 96804.
Also fix some code to be vertical writing mode aware. This doesn't actually cause
a behavioral difference because we use percentage heights/widths which don't depend on
updateLogicalWidth or computeLogicalHeight. You can still see bugs if you try to set
the min-width on a <meter> node in a vertical writing mode.
No new tests, no behavioral changes.
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::updateLogicalWidth): Make vertical writing mode aware.
(WebCore::RenderMeter::computeLogicalHeight): Switch from updateLogicalHeight and make vertical writing mode aware.
* rendering/RenderMeter.h:
(RenderMeter):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129409
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-09-24 Tony Chang <tony@chromium.org>
+
+ Replace RenderMeter::updateLogicalHeight to RenderMeter::computeLogicalHeight
+ https://bugs.webkit.org/show_bug.cgi?id=97475
+
+ Reviewed by Ojan Vafai.
+
+ Using RenderMeter::computeLogicalHeight is part of bug 96804.
+ Also fix some code to be vertical writing mode aware. This doesn't actually cause
+ a behavioral difference because we use percentage heights/widths which don't depend on
+ updateLogicalWidth or computeLogicalHeight. You can still see bugs if you try to set
+ the min-width on a <meter> node in a vertical writing mode.
+
+ No new tests, no behavioral changes.
+
+ * rendering/RenderMeter.cpp:
+ (WebCore::RenderMeter::updateLogicalWidth): Make vertical writing mode aware.
+ (WebCore::RenderMeter::computeLogicalHeight): Switch from updateLogicalHeight and make vertical writing mode aware.
+ * rendering/RenderMeter.h:
+ (RenderMeter):
+
2012-09-24 Dimitri Glazkov <dglazkov@chromium.org>
Remove unbaked support for :scope pseudo-class.
void RenderMeter::updateLogicalWidth()
{
RenderBox::updateLogicalWidth();
- setWidth(theme()->meterSizeForBounds(this, pixelSnappedIntRect(frameRect())).width());
+
+ IntSize frameSize = theme()->meterSizeForBounds(this, pixelSnappedIntRect(frameRect()));
+ setLogicalWidth(isHorizontalWritingMode() ? frameSize.width() : frameSize.height());
}
-void RenderMeter::updateLogicalHeight()
+void RenderMeter::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
{
- RenderBox::updateLogicalHeight();
- setHeight(theme()->meterSizeForBounds(this, pixelSnappedIntRect(frameRect())).height());
+ RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
+
+ LayoutRect frame = frameRect();
+ if (isHorizontalWritingMode())
+ frame.setHeight(computedValues.m_extent);
+ else
+ frame.setWidth(computedValues.m_extent);
+ IntSize frameSize = theme()->meterSizeForBounds(this, pixelSnappedIntRect(frame));
+ computedValues.m_extent = isHorizontalWritingMode() ? frameSize.height() : frameSize.width();
}
double RenderMeter::valueRatio() const
private:
virtual void updateLogicalWidth() OVERRIDE;
- virtual void updateLogicalHeight() OVERRIDE;
+ virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE;
virtual const char* renderName() const { return "RenderMeter"; }
virtual bool isMeter() const { return true; }