Skip to content

Commit 366abd1

Browse files
authored
Merge pull request #195 from mganss/devel
Consume '/' in background declaration (fixes #165)
2 parents a0297a2 + e3b416b commit 366abd1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/AngleSharp.Css.Tests/Declarations/CssBackgroundProperty.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,18 @@ public void CssBackgroundImageNotParsed_Issue66()
731731
var expected = "linear-gradient(0deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 1), rgba(248, 248, 248, 1), rgba(238, 238, 238, 1))";
732732
Assert.AreEqual(expected, property.Value);
733733
}
734+
735+
[Test]
736+
public void CssBackgroundPositionSlashSizeLegal()
737+
{
738+
var snippet = "background: center / cover";
739+
var property = ParseDeclaration(snippet);
740+
Assert.AreEqual("background", property.Name);
741+
Assert.IsFalse(property.IsImportant);
742+
Assert.IsFalse(property.IsInherited);
743+
Assert.IsTrue(property.HasValue);
744+
Assert.AreEqual("center / cover", property.Value);
745+
}
734746
}
735747
}
736748

src/AngleSharp.Css/Declarations/BackgroundDeclaration.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public ICssValue Convert(StringSource source)
126126

127127
if (c == Symbols.Solidus && size == null)
128128
{
129+
c = source.Next();
129130
c = source.SkipSpacesAndComments();
130131
size = source.ParseSize();
131132
c = source.SkipSpacesAndComments();
@@ -230,7 +231,7 @@ public ICssValue[] Split(ICssValue value)
230231

231232
return null;
232233
}
233-
234+
234235
private static ICssValue CreateLayers(CssListValue image, CssListValue attachment, CssListValue clip, CssListValue position, CssListValue origin, CssListValue repeat, CssListValue size)
235236
{
236237
var count = GetCount(image, attachment, clip, position, size, repeat, origin);

0 commit comments

Comments
 (0)