[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 11:19:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c843387ed63e2ad5a034904d2927f25b526f2692
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jul 19 14:06:01 2010 +0000
2010-07-19 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
CSS3 background: Number of layers should be determined by background-image element count
https://bugs.webkit.org/show_bug.cgi?id=41201
Manual test: css3-background-layer-count.html
Spec link:
http://www.w3.org/TR/css3-background/#layering
* manual-tests/css3-background-layer-count.html: Added.
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::fillUnsetProperties): Don't repeat
image properties, they determine the total number of layers.
(WebCore::FillLayer::cullEmptyLayers): Change culling logic
to discard all layers after the first one without an image set.
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::adjustBackgroundLayers): Call
fillUnsetProperties() before cullEmptyLayers()
(WebCore::InheritedFlags::adjustMaskLayers): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0298cea..86eb187 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,29 @@
Reviewed by Kenneth Rohde Christiansen.
+ CSS3 background: Number of layers should be determined by background-image element count
+ https://bugs.webkit.org/show_bug.cgi?id=41201
+
+ Manual test: css3-background-layer-count.html
+
+ Spec link:
+ http://www.w3.org/TR/css3-background/#layering
+
+ * manual-tests/css3-background-layer-count.html: Added.
+ * rendering/style/FillLayer.cpp:
+ (WebCore::FillLayer::fillUnsetProperties): Don't repeat
+ image properties, they determine the total number of layers.
+ (WebCore::FillLayer::cullEmptyLayers): Change culling logic
+ to discard all layers after the first one without an image set.
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::adjustBackgroundLayers): Call
+ fillUnsetProperties() before cullEmptyLayers()
+ (WebCore::InheritedFlags::adjustMaskLayers): Ditto.
+
+2010-07-19 Andreas Kling <andreas.kling at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
[Qt] Avoid QImage::pixel() in getImageData()
https://bugs.webkit.org/show_bug.cgi?id=42463
diff --git a/WebCore/manual-tests/css3-background-layer-count.html b/WebCore/manual-tests/css3-background-layer-count.html
new file mode 100644
index 0000000..fc21fd7
--- /dev/null
+++ b/WebCore/manual-tests/css3-background-layer-count.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS Test: Number of background properties greater than number of background images</title>
+ <style type="text/css">
+ div
+ {
+ margin: 10px;
+ width: 250px;
+ height: 250px;
+ border: thick solid black;
+ }
+ #test
+ {
+ background-image: url("resources/non-animated.gif"), url("resources/non-animated.gif"), url("resources/non-animated.gif");
+ background-position: right bottom, right top, left bottom, left center, right center;
+ background-repeat: no-repeat, no-repeat, repeat-x, repeat, repeat-y;
+ }
+ #reference
+ {
+ background-image: url("resources/non-animated.gif"), url("resources/non-animated.gif"), url("resources/non-animated.gif");
+ background-position: right bottom, right top, left bottom;
+ background-repeat: no-repeat, no-repeat, repeat-x;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if the contents of the black boxes look exactly the same.</p>
+ <table>
+ <td>
+ <div id="test"></div>
+ </td>
+ <td>
+ <div id="reference"></div>
+ </td>
+ </table>
+ </body>
+</html>
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 11db9e0..03dbcf1 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -872,8 +872,8 @@ public:
void adjustBackgroundLayers()
{
if (backgroundLayers()->next()) {
- accessBackgroundLayers()->cullEmptyLayers();
accessBackgroundLayers()->fillUnsetProperties();
+ accessBackgroundLayers()->cullEmptyLayers();
}
}
@@ -883,8 +883,8 @@ public:
void adjustMaskLayers()
{
if (maskLayers()->next()) {
- accessMaskLayers()->cullEmptyLayers();
accessMaskLayers()->fillUnsetProperties();
+ accessMaskLayers()->cullEmptyLayers();
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list