Skip to content
Permalink
Browse files
Makes getStyleProperty return a value for the overflow property when …
…overflow-x and overflow-y are equal.

WebCore:

2008-08-22  Timothy Hatcher  <timothy@apple.com>

        Makes getStyleProperty return a value for the overflow property
        when overflow-x and overflow-y are equal.

        https://bugs.webkit.org/show_bug.cgi?id=20485

        Reviewed by Dan Bernstein.

        Test: fast/css/overflow-property.html

        * css/CSSMutableStyleDeclaration.cpp:
        (WebCore::CSSMutableStyleDeclaration::getPropertyValue):

LayoutTests:

2008-08-22  Timothy Hatcher  <timothy@apple.com>

        Test for the tests the parsing and retrieval of the overflow,
        overflow-x and overflow-y properties

        https://bugs.webkit.org/show_bug.cgi?id=20485

        Reviewed by Dan Bernstein.

        * fast/css/overflow-property-expected.txt: Added.
        * fast/css/overflow-property.html: Added.

Canonical link: https://commits.webkit.org/28298@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
xeenon committed Aug 22, 2008
1 parent d8744ad commit 0b0f32d98398a0edf9ce86f3480be6b394bb0ba8
Showing 5 changed files with 131 additions and 0 deletions.
@@ -1,3 +1,15 @@
2008-08-22 Timothy Hatcher <timothy@apple.com>

Test for the tests the parsing and retrieval of the overflow,
overflow-x and overflow-y properties

https://bugs.webkit.org/show_bug.cgi?id=20485

Reviewed by Dan Bernstein.

* fast/css/overflow-property-expected.txt: Added.
* fast/css/overflow-property.html: Added.

2008-08-21 Simon Fraser <simon.fraser@apple.com>

Reviewed by Darin Adler
@@ -0,0 +1,32 @@
This tests the parsing and retrieval of the overflow, overflow-x and overflow-y properties.

PASS test0.style.overflow is "auto"
PASS test0.style.overflowX is "auto"
PASS test0.style.overflowY is "auto"
PASS test0.style.getPropertyShorthand('overflow-x') is "overflow"
PASS test0.style.getPropertyShorthand('overflow-y') is "overflow"
PASS test1.style.overflow is ""
PASS test1.style.overflowX is ""
PASS test1.style.overflowY is ""
PASS test2.style.overflow is "scroll"
PASS test2.style.overflowX is "scroll"
PASS test2.style.overflowY is "scroll"
PASS test3.style.overflow is ""
PASS test3.style.overflowX is "overlay"
PASS test3.style.overflowY is "hidden"
PASS test4.style.overflow is ""
PASS test4.style.overflowX is "auto"
PASS test4.style.overflowY is ""
PASS test5.style.overflow is ""
PASS test5.style.overflowX is ""
PASS test5.style.overflowY is "auto"
PASS test6.style.overflow is ""
PASS test6.style.overflowX is ""
PASS test6.style.overflowY is ""
PASS test7.style.overflow is ""
PASS test7.style.overflowX is ""
PASS test7.style.overflowY is ""
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,69 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description">This tests the parsing and retrieval of the overflow, overflow-x and overflow-y properties.</p>
<div id="console"></div>

<div id="tests_container">

<div id="test0" style="overflow: auto"></div>
<div id="test1" style="overflow: auto auto"></div>
<div id="test2" style="overflow-x: scroll; overflow-y: scroll"></div>
<div id="test3" style="overflow-x: overlay; overflow-y: hidden"></div>
<div id="test4" style="overflow-x: auto"></div>
<div id="test5" style="overflow-y: auto"></div>
<div id="test6" style="overflow: invalid"></div>
<div id="test7"></div>

</div>

<script>
var test0 = document.getElementById("test0");
var test1 = document.getElementById("test1");
var test2 = document.getElementById("test2");
var test3 = document.getElementById("test3");
var test4 = document.getElementById("test4");
var test5 = document.getElementById("test5");
var test6 = document.getElementById("test6");
var test7 = document.getElementById("test6");

shouldBeEqualToString("test0.style.overflow", "auto");
shouldBeEqualToString("test0.style.overflowX", "auto");
shouldBeEqualToString("test0.style.overflowY", "auto");
shouldBeEqualToString("test0.style.getPropertyShorthand('overflow-x')", "overflow");
shouldBeEqualToString("test0.style.getPropertyShorthand('overflow-y')", "overflow");
shouldBeEqualToString("test1.style.overflow", "");
shouldBeEqualToString("test1.style.overflowX", "");
shouldBeEqualToString("test1.style.overflowY", "");
shouldBeEqualToString("test2.style.overflow", "scroll");
shouldBeEqualToString("test2.style.overflowX", "scroll");
shouldBeEqualToString("test2.style.overflowY", "scroll");
shouldBeEqualToString("test3.style.overflow", "");
shouldBeEqualToString("test3.style.overflowX", "overlay");
shouldBeEqualToString("test3.style.overflowY", "hidden");
shouldBeEqualToString("test4.style.overflow", "");
shouldBeEqualToString("test4.style.overflowX", "auto");
shouldBeEqualToString("test4.style.overflowY", "");
shouldBeEqualToString("test5.style.overflow", "");
shouldBeEqualToString("test5.style.overflowX", "");
shouldBeEqualToString("test5.style.overflowY", "auto");
shouldBeEqualToString("test6.style.overflow", "");
shouldBeEqualToString("test6.style.overflowX", "");
shouldBeEqualToString("test6.style.overflowY", "");
shouldBeEqualToString("test7.style.overflow", "");
shouldBeEqualToString("test7.style.overflowX", "");
shouldBeEqualToString("test7.style.overflowY", "");

// clean up after ourselves
var tests_container = document.getElementById("tests_container");
tests_container.parentNode.removeChild(tests_container);

var successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
@@ -1,3 +1,17 @@
2008-08-22 Timothy Hatcher <timothy@apple.com>

Makes getStyleProperty return a value for the overflow property
when overflow-x and overflow-y are equal.

https://bugs.webkit.org/show_bug.cgi?id=20485

Reviewed by Dan Bernstein.

Test: fast/css/overflow-property.html

* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::getPropertyValue):

2008-08-22 Timothy Hatcher <timothy@apple.com>

Fixes a bug where while editing in the Inspector the
@@ -168,6 +168,10 @@ String CSSMutableStyleDeclaration::getPropertyValue(int propertyID) const
CSSPropertyMarginBottom, CSSPropertyMarginLeft };
return get4Values(properties);
}
case CSSPropertyOverflow: {
const int properties[2] = { CSSPropertyOverflowX, CSSPropertyOverflowY };
return getCommonValue(properties, 2);
}
case CSSPropertyPadding: {
const int properties[4] = { CSSPropertyPaddingTop, CSSPropertyPaddingRight,
CSSPropertyPaddingBottom, CSSPropertyPaddingLeft };

0 comments on commit 0b0f32d

Please sign in to comment.