Title: [129409] trunk/Source/WebCore
Revision
129409
Author
[email protected]
Date
2012-09-24 14:11:48 -0700 (Mon, 24 Sep 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129408 => 129409)


--- trunk/Source/WebCore/ChangeLog	2012-09-24 20:58:47 UTC (rev 129408)
+++ trunk/Source/WebCore/ChangeLog	2012-09-24 21:11:48 UTC (rev 129409)
@@ -1,3 +1,24 @@
+2012-09-24  Tony Chang  <[email protected]>
+
+        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  <[email protected]>
 
         Remove unbaked support for :scope pseudo-class.

Modified: trunk/Source/WebCore/rendering/RenderMeter.cpp (129408 => 129409)


--- trunk/Source/WebCore/rendering/RenderMeter.cpp	2012-09-24 20:58:47 UTC (rev 129408)
+++ trunk/Source/WebCore/rendering/RenderMeter.cpp	2012-09-24 21:11:48 UTC (rev 129409)
@@ -55,13 +55,22 @@
 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

Modified: trunk/Source/WebCore/rendering/RenderMeter.h (129408 => 129409)


--- trunk/Source/WebCore/rendering/RenderMeter.h	2012-09-24 20:58:47 UTC (rev 129408)
+++ trunk/Source/WebCore/rendering/RenderMeter.h	2012-09-24 21:11:48 UTC (rev 129409)
@@ -40,7 +40,7 @@
 
 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; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to