[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
mitz at apple.com
mitz at apple.com
Wed Apr 7 23:07:10 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 6e9e6aeee6b136cb47fa28b008801e10c23be6d6
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 26 22:41:45 2009 +0000
background-size: X treated as background-size: X X, not background-size: X auto
https://bugs.webkit.org/show_bug.cgi?id=28440
Reviewed by Beth Dakin.
WebCore:
Updated fast/backgrounds/size/resources/parsing-background-size-values.js
and fast/backgrounds/size/resources/parsing-inherit.js
Reinstated -webkit-background-size and kept its behavior of filling in
the second value with the first one; and changed background-size to have
the behavior of filling in the second value with 'auto'.
* css/CSSComputedStyleDeclaration.cpp:
(computedProperties): Re-added CSSPropertyWebkitBackgroundSize.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Ditto.
(WebCore::CSSParser::parseFillSize): Adapted for the new parsing rule.
(WebCore::CSSParser::parseFillProperty): Re-added
CSSPropertyWebkitBackgroundSize.
(WebCore::cssPropertyID): Removed mapping of -webkit-background-size to
background-size.
* css/CSSParser.h:
* css/CSSPropertyNames.in: Re-added -webkit-background-size.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty): Re-added
CSSPropertyWebkitBackgroundSize.
LayoutTests:
* fast/backgrounds/size/parsing-background-size-values-expected.txt:
* fast/backgrounds/size/parsing-inherit-expected.txt:
* fast/backgrounds/size/resources/parsing-background-size-values.js:
(test):
* fast/backgrounds/size/resources/parsing-inherit.js:
* platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e0e2190..d5b166e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-26 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Beth Dakin.
+
+ background-size: X treated as background-size: X X, not background-size: X auto
+ https://bugs.webkit.org/show_bug.cgi?id=28440
+
+ * fast/backgrounds/size/parsing-background-size-values-expected.txt:
+ * fast/backgrounds/size/parsing-inherit-expected.txt:
+ * fast/backgrounds/size/resources/parsing-background-size-values.js:
+ (test):
+ * fast/backgrounds/size/resources/parsing-inherit.js:
+ * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
+ * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+
2009-10-26 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Geoffrey Garen.
diff --git a/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt b/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt
index 3f2a269..5969d19 100644
--- a/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt
+++ b/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt
@@ -12,12 +12,15 @@ PASS test("background-size: 50px auto;") is "50px "
PASS test("background-size: auto auto;") is " "
PASS test("background-size: 30% 20%;") is "30% 20%"
PASS test("background-size: 4em auto;") is "4em "
-PASS test("background-size: 5em ;") is "5em 5em"
+PASS test("background-size: 5em;") is "5em "
+PASS test("-webkit-background-size: 5em ;") is "5em 5em"
PASS test("background-size: 100 100 100;") is null
PASS test("background-size: coconut;") is null
PASS test("background-size: 100px,;") is null
-PASS test("background-size: 100px, 50%;") is "100px 100px, 50% 50%"
-PASS test("background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em 2em, 100px 50%"
+PASS test("background-size: 100px, 50%;") is "100px , 50% "
+PASS test("-webkit-background-size: 100px, 50%;") is "100px 100px, 50% 50%"
+PASS test("background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em , 100px 50%"
+PASS test("-webkit-background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em 2em, 100px 50%"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt b/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt
index 339066d..c90a14b 100644
--- a/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt
+++ b/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt
@@ -12,7 +12,8 @@ PASS test("background-size: 50px auto;") is "50px auto"
PASS test("background-size: auto auto;") is "auto auto"
PASS test("background-size: 30% 20%;") is "30% 20%"
PASS test("background-size: 4em auto;") is "64px auto"
-PASS test("background-size: 5em ;") is "80px 80px"
+PASS test("background-size: 5em ;") is "80px auto"
+PASS test("-webkit-background-size: 5em ;") is "80px 80px"
PASS test("background-size: 100 100 100;") is "auto auto"
PASS test("background-size: coconut;") is "auto auto"
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js b/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js
index dce3c00..e2fcf04 100644
--- a/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js
+++ b/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js
@@ -6,7 +6,7 @@ function test(value)
div.setAttribute("style", value);
document.body.appendChild(div);
- var result = div.style.getPropertyValue("background-size");
+ var result = div.style.getPropertyValue(value.substring(0, value.indexOf(":")));
document.body.removeChild(div);
return result;
}
@@ -20,13 +20,16 @@ shouldBe('test("background-size: 50px auto;")', '"50px "');
shouldBe('test("background-size: auto auto;")', '" "');
shouldBe('test("background-size: 30% 20%;")', '"30% 20%"');
shouldBe('test("background-size: 4em auto;")', '"4em "');
-shouldBe('test("background-size: 5em ;")', '"5em 5em"');
+shouldBe('test("background-size: 5em;")', '"5em "');
+shouldBe('test("-webkit-background-size: 5em ;")', '"5em 5em"');
shouldBe('test("background-size: 100 100 100;")', 'null');
shouldBe('test("background-size: coconut;")', 'null');
shouldBe('test("background-size: 100px,;")', 'null');
-shouldBe('test("background-size: 100px, 50%;")', '"100px 100px, 50% 50%"');
-shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em 2em, 100px 50%"');
+shouldBe('test("background-size: 100px, 50%;")', '"100px , 50% "');
+shouldBe('test("-webkit-background-size: 100px, 50%;")', '"100px 100px, 50% 50%"');
+shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em , 100px 50%"');
+shouldBe('test("-webkit-background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em 2em, 100px 50%"');
var successfullyParsed = true;
diff --git a/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js b/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js
index 1dacc31..66e71de 100644
--- a/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js
+++ b/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js
@@ -24,7 +24,8 @@ shouldBe('test("background-size: 50px auto;")', '"50px auto"');
shouldBe('test("background-size: auto auto;")', '"auto auto"');
shouldBe('test("background-size: 30% 20%;")', '"30% 20%"');
shouldBe('test("background-size: 4em auto;")', '"64px auto"');
-shouldBe('test("background-size: 5em ;")', '"80px 80px"');
+shouldBe('test("background-size: 5em ;")', '"80px auto"');
+shouldBe('test("-webkit-background-size: 5em ;")', '"80px 80px"');
shouldBe('test("background-size: 100 100 100;")', '"auto auto"');
shouldBe('test("background-size: coconut;")', '"auto auto"');
diff --git a/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt b/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
index db70179..5fddcd2 100644
--- a/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
+++ b/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
@@ -105,6 +105,7 @@ zoom: 1;
-webkit-background-clip: border-box;
-webkit-background-composite: source-over;
-webkit-background-origin: padding-box;
+-webkit-background-size: auto auto;
-webkit-border-fit: border;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-image: none;
diff --git a/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt b/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
index ca5ae06..09b1c92 100644
--- a/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
+++ b/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
@@ -104,6 +104,7 @@ Computed style of an element whose parent's 'display' value is 'none':
-webkit-background-clip: border-box
-webkit-background-composite: source-over
-webkit-background-origin: padding-box
+ -webkit-background-size: auto auto
-webkit-border-fit: border
-webkit-border-horizontal-spacing: 0px
-webkit-border-image: none
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 134a499..da50af4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2009-10-26 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Beth Dakin.
+
+ background-size: X treated as background-size: X X, not background-size: X auto
+ https://bugs.webkit.org/show_bug.cgi?id=28440
+
+ Updated fast/backgrounds/size/resources/parsing-background-size-values.js
+ and fast/backgrounds/size/resources/parsing-inherit.js
+
+ Reinstated -webkit-background-size and kept its behavior of filling in
+ the second value with the first one; and changed background-size to have
+ the behavior of filling in the second value with 'auto'.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (computedProperties): Re-added CSSPropertyWebkitBackgroundSize.
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue): Ditto.
+ (WebCore::CSSParser::parseFillSize): Adapted for the new parsing rule.
+ (WebCore::CSSParser::parseFillProperty): Re-added
+ CSSPropertyWebkitBackgroundSize.
+ (WebCore::cssPropertyID): Removed mapping of -webkit-background-size to
+ background-size.
+ * css/CSSParser.h:
+ * css/CSSPropertyNames.in: Re-added -webkit-background-size.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Re-added
+ CSSPropertyWebkitBackgroundSize.
+
2009-10-26 Laszlo Gombos <laszlo.1.gombos at nokia.com>
Reviewed by Eric Seidel.
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 793ef81..b8769f9 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -157,6 +157,7 @@ static const int computedProperties[] = {
CSSPropertyWebkitBackgroundClip,
CSSPropertyWebkitBackgroundComposite,
CSSPropertyWebkitBackgroundOrigin,
+ CSSPropertyWebkitBackgroundSize,
CSSPropertyWebkitBorderFit,
CSSPropertyWebkitBorderHorizontalSpacing,
CSSPropertyWebkitBorderImage,
@@ -679,7 +680,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (style->backgroundImage())
return style->backgroundImage()->cssValue();
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
- case CSSPropertyBackgroundSize: {
+ case CSSPropertyBackgroundSize:
+ case CSSPropertyWebkitBackgroundSize: {
EFillSizeType size = style->backgroundSizeType();
if (size == Contain)
return CSSPrimitiveValue::createIdentifier(CSSValueContain);
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 4299cf0..6024a5b 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -873,6 +873,7 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyBackgroundPositionX:
case CSSPropertyBackgroundPositionY:
case CSSPropertyBackgroundSize:
+ case CSSPropertyWebkitBackgroundSize:
case CSSPropertyBackgroundRepeat:
case CSSPropertyBackgroundRepeatX:
case CSSPropertyBackgroundRepeatY:
@@ -2329,7 +2330,7 @@ void CSSParser::parseFillRepeat(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& valu
}
}
-PassRefPtr<CSSValue> CSSParser::parseFillSize(bool& allowComma)
+PassRefPtr<CSSValue> CSSParser::parseFillSize(int propId, bool& allowComma)
{
allowComma = true;
CSSParserValue* value = m_valueList->current();
@@ -2338,7 +2339,7 @@ PassRefPtr<CSSValue> CSSParser::parseFillSize(bool& allowComma)
return CSSPrimitiveValue::createIdentifier(value->id);
RefPtr<CSSPrimitiveValue> parsedValue1;
-
+
if (value->id == CSSValueAuto)
parsedValue1 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN);
else {
@@ -2346,8 +2347,9 @@ PassRefPtr<CSSValue> CSSParser::parseFillSize(bool& allowComma)
return 0;
parsedValue1 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
}
-
- RefPtr<CSSPrimitiveValue> parsedValue2 = parsedValue1;
+
+ CSSPropertyID property = static_cast<CSSPropertyID>(propId);
+ RefPtr<CSSPrimitiveValue> parsedValue2;
if ((value = m_valueList->next())) {
if (value->id == CSSValueAuto)
parsedValue2 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN);
@@ -2359,7 +2361,13 @@ PassRefPtr<CSSValue> CSSParser::parseFillSize(bool& allowComma)
parsedValue2 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
}
}
-
+ if (!parsedValue2) {
+ if (property == CSSPropertyWebkitBackgroundSize || property == CSSPropertyWebkitMaskSize)
+ parsedValue2 = parsedValue1;
+ else
+ parsedValue2 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN);
+ }
+
return CSSPrimitiveValue::create(Pair::create(parsedValue1.release(), parsedValue2.release()));
}
@@ -2478,8 +2486,9 @@ bool CSSParser::parseFillProperty(int propId, int& propId1, int& propId2,
// parseFillRepeat advances the m_valueList pointer
break;
case CSSPropertyBackgroundSize:
+ case CSSPropertyWebkitBackgroundSize:
case CSSPropertyWebkitMaskSize: {
- currValue = parseFillSize(allowComma);
+ currValue = parseFillSize(propId, allowComma);
if (currValue)
m_valueList->next();
break;
@@ -5194,11 +5203,6 @@ static int cssPropertyID(const UChar* propertyName, unsigned length)
const char* const opacity = "opacity";
name = opacity;
length = strlen(opacity);
- } else if (strcmp(buffer, "-webkit-background-size") == 0) {
- // CSS Backgrounds/Borders. -webkit-background-size worked in Safari 4 and earlier.
- const char* const backgroundSize = "background-size";
- name = backgroundSize;
- length = strlen(backgroundSize);
} else if (hasPrefix(buffer + 7, length - 7, "-border-")) {
// -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax
// differs from border-radius, so it is remains as a distinct property.
diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h
index 1a156da..6d1bb32 100644
--- a/WebCore/css/CSSParser.h
+++ b/WebCore/css/CSSParser.h
@@ -83,7 +83,7 @@ namespace WebCore {
PassRefPtr<CSSValue> parseFillPositionXY(bool& xFound, bool& yFound);
void parseFillPosition(RefPtr<CSSValue>&, RefPtr<CSSValue>&);
void parseFillRepeat(RefPtr<CSSValue>&, RefPtr<CSSValue>&);
- PassRefPtr<CSSValue> parseFillSize(bool &allowComma);
+ PassRefPtr<CSSValue> parseFillSize(int propId, bool &allowComma);
bool parseFillProperty(int propId, int& propId1, int& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
bool parseFillShorthand(int propId, const int* properties, int numProperties, bool important);
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index 5ef6605..48a18e7 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -160,6 +160,10 @@ zoom
-webkit-background-clip
-webkit-background-composite
-webkit-background-origin
+# -webkit-background-size differs from background-size only in the interpretation of
+# a single value: -webkit-background-size: l; is equivalent to background-size: l l;
+# whereas background-size: l; is equivalent to background-size: l auto;
+-webkit-background-size
-webkit-binding
-webkit-border-fit
-webkit-border-horizontal-spacing
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 181e480..40627cf 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -2961,6 +2961,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
HANDLE_BACKGROUND_VALUE(origin, Origin, value)
return;
case CSSPropertyBackgroundSize:
+ case CSSPropertyWebkitBackgroundSize:
HANDLE_BACKGROUND_VALUE(size, Size, value)
return;
case CSSPropertyWebkitMaskAttachment:
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list