Title: [121132] trunk
- Revision
- 121132
- Author
- [email protected]
- Date
- 2012-06-24 20:16:07 -0700 (Sun, 24 Jun 2012)
Log Message
CSS3 calc: transitions starting and ending with a calc _expression_ move to end state
https://bugs.webkit.org/show_bug.cgi?id=89738
Reviewed by Tony Chang.
Source/WebCore:
The equality operator for CalculationValue was not working as expected. The
equality operator for OwnPtr is private, as OwnPtrs should always be different.
The OwnPtrs ended up getting cast to bool before being compared, and the
comparison was always returning true.
The comparison between OwnPtrs has been removed. It doesn't add value to compare
the raw pointers either, since OwnPtrs should always be unique. We cannot
ASSERT the uniqueness though, as it is legitimate to compare a CalculationValue
to itself.
Test: css3/calc/transition-start-end-with-calc.html
* platform/CalculationValue.h:
(WebCore::CalculationValue::operator==):
LayoutTests:
* css3/calc/transition-start-end-with-calc-expected.txt: Added.
* css3/calc/transition-start-end-with-calc.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (121131 => 121132)
--- trunk/LayoutTests/ChangeLog 2012-06-25 02:25:43 UTC (rev 121131)
+++ trunk/LayoutTests/ChangeLog 2012-06-25 03:16:07 UTC (rev 121132)
@@ -1,3 +1,13 @@
+2012-06-24 Mike Lawther <[email protected]>
+
+ CSS3 calc: transitions starting and ending with a calc _expression_ move to end state
+ https://bugs.webkit.org/show_bug.cgi?id=89738
+
+ Reviewed by Tony Chang.
+
+ * css3/calc/transition-start-end-with-calc-expected.txt: Added.
+ * css3/calc/transition-start-end-with-calc.html: Added.
+
2012-06-21 Kent Tamura <[email protected]>
Selected option is not restored correctly
Added: trunk/LayoutTests/css3/calc/transition-start-end-with-calc-expected.txt (0 => 121132)
--- trunk/LayoutTests/css3/calc/transition-start-end-with-calc-expected.txt (rev 0)
+++ trunk/LayoutTests/css3/calc/transition-start-end-with-calc-expected.txt 2012-06-25 03:16:07 UTC (rev 121132)
@@ -0,0 +1,4 @@
+This tests that transitions beginning and ending with calc() expressions move to the final state.
+PASS - "width" property for "rect" element at 0.0s was: 51
+PASS - "width" property for "rect" element at 1s saw something close to: 400
+
Added: trunk/LayoutTests/css3/calc/transition-start-end-with-calc.html (0 => 121132)
--- trunk/LayoutTests/css3/calc/transition-start-end-with-calc.html (rev 0)
+++ trunk/LayoutTests/css3/calc/transition-start-end-with-calc.html 2012-06-25 03:16:07 UTC (rev 121132)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<style>
+#rect {
+ background-color: green;
+ height: 100px;
+ -webkit-transition: all 1s;
+ -moz-transition: all 1s;
+ width: -webkit-calc(10% + 1px);
+ width: -moz-calc(10% + 1px);
+}
+#rect.go {
+ width: -webkit-calc(100% - 100px);
+ width: -moz-calc(100% - 100px);
+}
+</style>
+
+This tests that transitions beginning and ending with calc() expressions move to the final state.
+<div style="width:500px; border: 1px solid black;">
+ <div id="rect"></div>
+</div>
+<div id="result"></div>
+
+<script src=""
+<script>
+const expectedValues = [
+ // [time, element-id, property, expected-value, tolerance]
+ [1.0, 'rect', 'width', 400, 0],
+];
+
+function setupTest()
+{
+ var expectedStartWidth = 51; // (10% + 1px) where 100% = 500px
+ var rect = document.getElementById("rect");
+ var width = rect.offsetWidth;
+ if (width == expectedStartWidth)
+ rect.innerHTML += 'PASS - "width" property for "rect" element at 0.0s was: ' + width;
+ else
+ rect.innerHTML += 'FAIL - "width" property for "rect" element at 0.0s expected: ' + expectedStartWidth + 'but saw: ' + width;
+
+ rect.className = "go";
+}
+
+runTransitionTest(expectedValues, setupTest, true, false /* pixel test */);
+
+</script>
Modified: trunk/Source/WebCore/ChangeLog (121131 => 121132)
--- trunk/Source/WebCore/ChangeLog 2012-06-25 02:25:43 UTC (rev 121131)
+++ trunk/Source/WebCore/ChangeLog 2012-06-25 03:16:07 UTC (rev 121132)
@@ -1,3 +1,25 @@
+2012-06-24 Mike Lawther <[email protected]>
+
+ CSS3 calc: transitions starting and ending with a calc _expression_ move to end state
+ https://bugs.webkit.org/show_bug.cgi?id=89738
+
+ Reviewed by Tony Chang.
+
+ The equality operator for CalculationValue was not working as expected. The
+ equality operator for OwnPtr is private, as OwnPtrs should always be different.
+ The OwnPtrs ended up getting cast to bool before being compared, and the
+ comparison was always returning true.
+
+ The comparison between OwnPtrs has been removed. It doesn't add value to compare
+ the raw pointers either, since OwnPtrs should always be unique. We cannot
+ ASSERT the uniqueness though, as it is legitimate to compare a CalculationValue
+ to itself.
+
+ Test: css3/calc/transition-start-end-with-calc.html
+
+ * platform/CalculationValue.h:
+ (WebCore::CalculationValue::operator==):
+
2012-06-24 MORITA Hajime <[email protected]>
NodeRenderingContext::AttachingPhase is redundant.
Modified: trunk/Source/WebCore/platform/CalculationValue.h (121131 => 121132)
--- trunk/Source/WebCore/platform/CalculationValue.h 2012-06-25 02:25:43 UTC (rev 121131)
+++ trunk/Source/WebCore/platform/CalculationValue.h 2012-06-25 03:16:07 UTC (rev 121132)
@@ -86,7 +86,7 @@
bool operator==(const CalculationValue& o) const
{
- return m_value == o.m_value || *(m_value.get()) == *(o.m_value.get());
+ return *(m_value.get()) == *(o.m_value.get());
}
private:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes