Reviewed by Hyatt.
- test for <rdar://problem/
4701494> REGRESSION: Scrollbar on EPSN widget doesn't scroll (also affects Widgets widget, web inspector)
* fast/css/computed-style-negative-top-expected.txt: Added.
* fast/css/computed-style-negative-top.html: Added.
WebCore:
Reviewed by Hyatt.
- fix <rdar://problem/
4701494> REGRESSION: Scrollbar on EPSN widget doesn't scroll (also affects Widgets widget, web inspector)
The bug was that we would return "none" for computed style properties when they were
exactly "-1px".
Test: fast/css/computed-style-negative-top.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForLength): Moved special case for "undefined length" out of here.
(WebCore::valueForMaxLength): Moved it into here.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use valueForMaxLength
only for max-height and max-width.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16108
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-08-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Hyatt.
+
+ - test for <rdar://problem/4701494> REGRESSION: Scrollbar on EPSN widget doesn't scroll (also affects Widgets widget, web inspector)
+
+ * fast/css/computed-style-negative-top-expected.txt: Added.
+ * fast/css/computed-style-negative-top.html: Added.
+
2006-08-28 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
--- /dev/null
+Test succeeded! Top is -1px.
--- /dev/null
+<div id="test" style="position:relative; top:-1px"></div>
+<script>
+var style = document.defaultView.getComputedStyle(document.getElementById("test"));
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+if (style.top == "-1px")
+ document.write("Test succeeded! Top is " + style.top + ".");
+else
+ document.write("Test failed! Top is " + style.top + ".");
+</script>
+2006-08-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Hyatt.
+
+ - fix <rdar://problem/4701494> REGRESSION: Scrollbar on EPSN widget doesn't scroll (also affects Widgets widget, web inspector)
+
+ The bug was that we would return "none" for computed style properties when they were
+ exactly "-1px".
+
+ Test: fast/css/computed-style-negative-top.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::valueForLength): Moved special case for "undefined length" out of here.
+ (WebCore::valueForMaxLength): Moved it into here.
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use valueForMaxLength
+ only for max-height and max-width.
+
2006-08-29 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by eseidel.
case Auto:
return new CSSPrimitiveValue(CSS_VAL_AUTO);
case WebCore::Fixed:
- if (length.value() == undefinedLength)
- return new CSSPrimitiveValue(CSS_VAL_NONE);
return new CSSPrimitiveValue(length.value(), CSSPrimitiveValue::CSS_PX);
case Intrinsic:
return new CSSPrimitiveValue(CSS_VAL_INTRINSIC);
return new CSSPrimitiveValue(CSS_VAL_AUTO);
}
+// Handles special value for "none".
+static CSSValue* valueForMaxLength(const Length& length)
+{
+ if (length.isFixed() && length.value() == undefinedLength)
+ return new CSSPrimitiveValue(CSS_VAL_NONE);
+ return valueForLength(length);
+}
+
static CSSValue *valueForBorderStyle(EBorderStyle style)
{
switch (style) {
ASSERT_NOT_REACHED();
return 0;
case CSS_PROP_MAX_HEIGHT:
- return valueForLength(style->maxHeight());
+ return valueForMaxLength(style->maxHeight());
case CSS_PROP_MAX_WIDTH:
- return valueForLength(style->maxWidth());
+ return valueForMaxLength(style->maxWidth());
case CSS_PROP_MIN_HEIGHT:
return valueForLength(style->minHeight());
case CSS_PROP_MIN_WIDTH: