diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /WebCore/rendering/style | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebCore/rendering/style')
-rw-r--r-- | WebCore/rendering/style/FillLayer.cpp | 35 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.h | 4 |
2 files changed, 20 insertions, 19 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; diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 782508e..58af7cf 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -876,8 +876,8 @@ public: void adjustBackgroundLayers() { if (backgroundLayers()->next()) { - accessBackgroundLayers()->cullEmptyLayers(); accessBackgroundLayers()->fillUnsetProperties(); + accessBackgroundLayers()->cullEmptyLayers(); } } @@ -887,8 +887,8 @@ public: void adjustMaskLayers() { if (maskLayers()->next()) { - accessMaskLayers()->cullEmptyLayers(); accessMaskLayers()->fillUnsetProperties(); + accessMaskLayers()->cullEmptyLayers(); } } |