[webkit-changes] cvs commit: WebCore/khtml/css css_valueimpl.cpp
Timothy
thatcher at opensource.apple.com
Tue Dec 13 16:40:57 PST 2005
thatcher 05/12/13 16:40:56
Modified: . ChangeLog
. ChangeLog
khtml/css css_valueimpl.cpp
Added: fast/dom css-shortHands-expected.checksum
css-shortHands-expected.png
css-shortHands-expected.txt css-shortHands.html
Log:
LayoutTests:
Reviewed by Hyatt.
Test case for our CSS shorthand serialization.
* fast/dom/css-shortHands-expected.checksum: Added.
* fast/dom/css-shortHands-expected.png: Added.
* fast/dom/css-shortHands-expected.txt: Added.
* fast/dom/css-shortHands.html: Added.
WebCore:
Reviewed by Dave Hyatt.
Test: fast/dom/css-shortHands.html
First cut at leaving off implicit values in shorthand properties.
Need to account for multipl backgrounds and "border" later.
* khtml/css/css_valueimpl.cpp:
(DOM::CSSMutableStyleDeclarationImpl::get4Values):
(DOM::CSSMutableStyleDeclarationImpl::getShortHandValue):
Revision Changes Path
1.150 +11 -0 LayoutTests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/LayoutTests/ChangeLog,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -r1.149 -r1.150
--- ChangeLog 13 Dec 2005 21:37:08 -0000 1.149
+++ ChangeLog 14 Dec 2005 00:40:51 -0000 1.150
@@ -1,3 +1,14 @@
+2005-12-13 Timothy Hatcher <timothy at apple.com>
+
+ Reviewed by Hyatt.
+
+ Test case for our CSS shorthand serialization.
+
+ * fast/dom/css-shortHands-expected.checksum: Added.
+ * fast/dom/css-shortHands-expected.png: Added.
+ * fast/dom/css-shortHands-expected.txt: Added.
+ * fast/dom/css-shortHands.html: Added.
+
2005-12-13 Anders Carlsson <andersca at mac.com>
Reviewed by Darin.
1.1 LayoutTests/fast/dom/css-shortHands-expected.checksum
Index: css-shortHands-expected.checksum
===================================================================
6f74d902253de3da4002005d2e89078c
1.1 LayoutTests/fast/dom/css-shortHands-expected.png
<<Binary file>>
1.1 LayoutTests/fast/dom/css-shortHands-expected.txt
Index: css-shortHands-expected.txt
===================================================================
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
RenderBlock {PRE} at (0,0) size 784x180
RenderText {TEXT} at (0,0) size 120x180
text run at (0,0) width 24: "1px"
text run at (0,15) width 56: "1px 2px"
text run at (0,30) width 88: "1px 2px 3px"
text run at (0,45) width 120: "1px 2px 3px 4px"
text run at (0,60) width 24: "1px"
text run at (0,75) width 56: "1px 2px"
text run at (0,90) width 88: "1px 2px 3px"
text run at (0,105) width 120: "1px 2px 3px 4px"
text run at (0,120) width 24: "red"
text run at (0,135) width 24: "red"
text run at (0,150) width 24: "red"
text run at (0,165) width 24: "red"
1.1 LayoutTests/fast/dom/css-shortHands.html
Index: css-shortHands.html
===================================================================
<html>
<head>
<style>
div { margin: 1px; }
div { margin: 1px 2px; }
div { margin: 1px 2px 3px; }
div { margin: 1px 2px 3px 4px; }
div { padding: 1px; }
div { padding: 1px 2px; }
div { padding: 1px 2px 3px; }
div { padding: 1px 2px 3px 4px; }
div { border-top: red; }
div { border-bottom: red; }
div { border-left: red; }
div { border-right: red; }
</style>
</head>
<body>
<pre id="result"></pre>
<script>
var styleSheet = document.styleSheets.item(0);
var s = "";
for (var i = 0; i < styleSheet.cssRules.length; i++) {
var rule = styleSheet.cssRules[i];
var prop = null;
if (i < 4) prop = "margin";
else if (i >= 4 && i < 8) prop = "padding";
else if (i == 8) prop = "border-top";
else if (i == 9) prop = "border-bottom";
else if (i == 10) prop = "border-left";
else if (i == 11) prop = "border-right";
s += rule.style.getPropertyValue(prop) + "\n";
}
document.getElementById("result").innerText = s;
</script>
</body>
</html>
1.524 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.523
retrieving revision 1.524
diff -u -r1.523 -r1.524
--- ChangeLog 13 Dec 2005 21:42:47 -0000 1.523
+++ ChangeLog 14 Dec 2005 00:40:52 -0000 1.524
@@ -1,3 +1,16 @@
+2005-12-13 Timothy Hatcher <timothy at apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Test: fast/dom/css-shortHands.html
+
+ First cut at leaving off implicit values in shorthand properties.
+ Need to account for multipl backgrounds and "border" later.
+
+ * khtml/css/css_valueimpl.cpp:
+ (DOM::CSSMutableStyleDeclarationImpl::get4Values):
+ (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue):
+
2005-12-13 Anders Carlsson <andersca at mac.com>
* ChangeLog: Add titles to the recent bugzilla bugs.
1.84 +20 -17 WebCore/khtml/css/css_valueimpl.cpp
Index: css_valueimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/css_valueimpl.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- css_valueimpl.cpp 7 Dec 2005 01:12:35 -0000 1.83
+++ css_valueimpl.cpp 14 Dec 2005 00:40:56 -0000 1.84
@@ -312,16 +312,17 @@
DOMString CSSMutableStyleDeclarationImpl::get4Values( const int* properties ) const
{
DOMString res;
- for ( int i = 0 ; i < 4 ; ++i ) {
- CSSValueImpl* value = getPropertyCSSValue( properties[i] );
- if ( !value ) { // apparently all 4 properties must be specified.
- return DOMString();
+ for (int i = 0; i < 4; ++i) {
+ if (!isPropertyImplicit(properties[i])) {
+ CSSValueImpl* value = getPropertyCSSValue(properties[i]);
+ if (!value) // apparently all 4 properties must be specified.
+ return DOMString();
+ value->ref();
+ if (!res.isNull())
+ res += " ";
+ res += value->cssText();
+ value->deref();
}
- value->ref();
- if ( i > 0 )
- res += " ";
- res += value->cssText();
- value->deref();
}
return res;
}
@@ -329,14 +330,16 @@
DOMString CSSMutableStyleDeclarationImpl::getShortHandValue( const int* properties, int number ) const
{
DOMString res;
- for ( int i = 0 ; i < number ; ++i ) {
- CSSValueImpl* value = getPropertyCSSValue( properties[i] );
- if ( value ) { // TODO provide default value if !value
- value->ref();
- if ( !res.isNull() )
- res += " ";
- res += value->cssText();
- value->deref();
+ for (int i = 0; i < number; ++i) {
+ if (!isPropertyImplicit(properties[i])) {
+ CSSValueImpl* value = getPropertyCSSValue(properties[i]);
+ if (value) { // TODO provide default value if !value
+ value->ref();
+ if (!res.isNull())
+ res += " ";
+ res += value->cssText();
+ value->deref();
+ }
}
}
return res;
More information about the webkit-changes
mailing list