summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/style/FillLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/style/FillLayer.cpp')
-rw-r--r--WebCore/rendering/style/FillLayer.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/WebCore/rendering/style/FillLayer.cpp b/WebCore/rendering/style/FillLayer.cpp
index 59f3bb2..3469e97 100644
--- a/WebCore/rendering/style/FillLayer.cpp
+++ b/WebCore/rendering/style/FillLayer.cpp
@@ -129,17 +129,6 @@ bool FillLayer::operator==(const FillLayer& o) const
void FillLayer::fillUnsetProperties()
{
FillLayer* curr;
- for (curr = this; curr && curr->isImageSet(); curr = curr->next()) { }
- if (curr && curr != this) {
- // We need to fill in the remaining values with the pattern specified.
- for (FillLayer* pattern = this; curr; curr = curr->next()) {
- curr->m_image = pattern->m_image;
- pattern = pattern->next();
- if (pattern == curr || !pattern)
- pattern = this;
- }
- }
-
for (curr = this; curr && curr->isXPositionSet(); curr = curr->next()) { }
if (curr && curr != this) {
// We need to fill in the remaining values with the pattern specified.
@@ -243,15 +232,27 @@ void FillLayer::fillUnsetProperties()
void FillLayer::cullEmptyLayers()
{
+ // CSS3 background layering: the number of background layers is determined
+ // by the number of values in the 'background-image' property.
+ // http://www.w3.org/TR/css3-background/#layering
+
FillLayer* next;
for (FillLayer* p = this; p; p = next) {
next = p->m_next;
- if (next && !next->isImageSet() &&
- !next->isXPositionSet() && !next->isYPositionSet() &&
- !next->isAttachmentSet() && !next->isClipSet() &&
- !next->isCompositeSet() && !next->isOriginSet() &&
- !next->isRepeatXSet() && !next->isRepeatYSet()
- && !next->isSizeSet()) {
+ if (!next)
+ break;
+
+ bool anyAttributeSet = next->isXPositionSet()
+ || next->isYPositionSet()
+ || next->isAttachmentSet()
+ || next->isClipSet()
+ || next->isCompositeSet()
+ || next->isOriginSet()
+ || next->isRepeatXSet()
+ || next->isRepeatYSet()
+ || next->isSizeSet();
+
+ if (!next->isImageSet() || !anyAttributeSet) {
delete next;
p->m_next = 0;
break;