Commit 870d0e29 authored by rwlbuis's avatar rwlbuis

Reviewed by Hyatt.

        http://bugs.webkit.org/show_bug.cgi?id=15025
        Background repeat css property is not inherited from parent if unspecified

        Don't let invalid url specification in background shorthand make
        the entire shorthand invalid.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a1d9e7b3
2007-09-23 Rob Buis <buis@kde.org>
Reviewed by Hyatt.
Testcase for:
http://bugs.webkit.org/show_bug.cgi?id=15025
Background repeat css property is not inherited from parent if unspecified
* fast/css/background-shorthand-invalid-url-expected.checksum: Added.
* fast/css/background-shorthand-invalid-url-expected.png: Added.
* fast/css/background-shorthand-invalid-url-expected.txt: Added.
* fast/css/background-shorthand-invalid-url.html: Added.
2007-09-22 Adam Roben <aroben@apple.com>
Test for Bug 15251: REGRESSION: <input type=range> doesn't respond to form.reset() or setting input.value
1c20e22fdccbe8b3d577b4e24f7ed933
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x186
RenderBlock {HTML} at (0,0) size 800x186
RenderBody {BODY} at (8,21) size 784x149
RenderBlock {H1} at (0,0) size 784x37
RenderText {#text} at (0,0) size 572x37
text run at (0,0) width 572: "The background image should not repeat."
RenderBlock {DIV} at (0,58) size 784x91
RenderBlock {UL} at (0,0) size 784x91
RenderListItem {LI} at (40,0) size 744x91 [border: (1px solid #FF0000)]
RenderBlock {SPAN} at (1,1) size 304x89 [border: (2px solid #008000)]
RenderListMarker at (-18,2) size 7x18: bullet
RenderText {#text} at (2,2) size 4x18
text run at (2,2) width 4: " "
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Bug</title>
<style>
#top_news span.img_cont { display:block; height:85px; width:300px; background: url("") no-repeat center left; }
</style>
</head>
<body>
<h1>The background image should not repeat.</h1>
<div id="top_news">
<ul>
<li style="border: 1px solid red;">
<span style="background-image: url(../media/resources/apple_logo_half_size.png); border: 2px solid green;" class="img_cont">&nbsp;</span>
</li>
</ul>
</div>
</body>
</html>
2007-09-23 Rob Buis <buis@kde.org>
Reviewed by Hyatt.
http://bugs.webkit.org/show_bug.cgi?id=15025
Background repeat css property is not inherited from parent if unspecified
Don't let invalid url specification in background shorthand make
the entire shorthand invalid.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseBackgroundImage):
(WebCore::CSSParser::parseBackgroundProperty):
* css/CSSParser.h:
2007-09-22 Adam Roben <aroben@apple.com>
Fix Bug 15251: REGRESSION: <input type=range> doesn't respond to form.reset() or setting input.value
......@@ -1780,17 +1780,20 @@ CSSValue* CSSParser::parseBackgroundColor()
return parseColor();
}
CSSValue* CSSParser::parseBackgroundImage()
bool CSSParser::parseBackgroundImage(CSSValue*& value)
{
if (valueList->current()->id == CSS_VAL_NONE)
return new CSSImageValue();
if (valueList->current()->id == CSS_VAL_NONE) {
value = new CSSImageValue();
return true;
}
if (valueList->current()->unit == CSSPrimitiveValue::CSS_URI) {
String uri = parseURL(domString(valueList->current()->string));
if (!uri.isEmpty())
return new CSSImageValue(String(KURL(styleElement->baseURL().deprecatedString(), uri.deprecatedString()).url()),
value = new CSSImageValue(String(KURL(styleElement->baseURL().deprecatedString(), uri.deprecatedString()).url()),
styleElement);
return true;
}
return 0;
return false;
}
CSSValue* CSSParser::parseBackgroundPositionXY(bool& xFound, bool& yFound)
......@@ -1926,8 +1929,7 @@ bool CSSParser::parseBackgroundProperty(int propId, int& propId1, int& propId2,
goto failed;
valueList->next();
allowComma = false;
}
else {
} else {
switch (propId) {
case CSS_PROP_BACKGROUND_ATTACHMENT:
if (val->id == CSS_VAL_SCROLL || val->id == CSS_VAL_FIXED) {
......@@ -1941,8 +1943,7 @@ bool CSSParser::parseBackgroundProperty(int propId, int& propId1, int& propId2,
valueList->next();
break;
case CSS_PROP_BACKGROUND_IMAGE:
currValue = parseBackgroundImage();
if (currValue)
if (parseBackgroundImage(currValue))
valueList->next();
break;
case CSS_PROP__WEBKIT_BACKGROUND_CLIP:
......@@ -1988,7 +1989,6 @@ bool CSSParser::parseBackgroundProperty(int propId, int& propId1, int& propId2,
valueList->next();
break;
}
if (!currValue)
goto failed;
......@@ -2022,7 +2022,7 @@ bool CSSParser::parseBackgroundProperty(int propId, int& propId1, int& propId2,
if (inShorthand())
break;
}
if (values && values->length()) {
retValue1 = values;
if (values2 && values2->length())
......
......@@ -136,7 +136,7 @@ namespace WebCore {
bool parseContent(int propId, bool important);
CSSValue* parseBackgroundColor();
CSSValue* parseBackgroundImage();
bool parseBackgroundImage(CSSValue*&);
CSSValue* parseBackgroundPositionXY(bool& xFound, bool& yFound);
void parseBackgroundPosition(CSSValue*&, CSSValue*&);
CSSValue* parseBackgroundSize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment