Changeset 63653 in webkit
- Timestamp:
- Jul 19, 2010 7:06:01 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63652 r63653 1 2010-07-19 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 CSS3 background: Number of layers should be determined by background-image element count 6 https://bugs.webkit.org/show_bug.cgi?id=41201 7 8 Manual test: css3-background-layer-count.html 9 10 Spec link: 11 http://www.w3.org/TR/css3-background/#layering 12 13 * manual-tests/css3-background-layer-count.html: Added. 14 * rendering/style/FillLayer.cpp: 15 (WebCore::FillLayer::fillUnsetProperties): Don't repeat 16 image properties, they determine the total number of layers. 17 (WebCore::FillLayer::cullEmptyLayers): Change culling logic 18 to discard all layers after the first one without an image set. 19 * rendering/style/RenderStyle.h: 20 (WebCore::InheritedFlags::adjustBackgroundLayers): Call 21 fillUnsetProperties() before cullEmptyLayers() 22 (WebCore::InheritedFlags::adjustMaskLayers): Ditto. 23 1 24 2010-07-19 Andreas Kling <andreas.kling@nokia.com> 2 25 -
trunk/WebCore/rendering/style/FillLayer.cpp
r63213 r63653 130 130 { 131 131 FillLayer* curr; 132 for (curr = this; curr && curr->isImageSet(); curr = curr->next()) { }133 if (curr && curr != this) {134 // We need to fill in the remaining values with the pattern specified.135 for (FillLayer* pattern = this; curr; curr = curr->next()) {136 curr->m_image = pattern->m_image;137 pattern = pattern->next();138 if (pattern == curr || !pattern)139 pattern = this;140 }141 }142 143 132 for (curr = this; curr && curr->isXPositionSet(); curr = curr->next()) { } 144 133 if (curr && curr != this) { … … 244 233 void FillLayer::cullEmptyLayers() 245 234 { 235 // CSS3 background layering: the number of background layers is determined 236 // by the number of values in the 'background-image' property. 237 // http://www.w3.org/TR/css3-background/#layering 238 246 239 FillLayer* next; 247 240 for (FillLayer* p = this; p; p = next) { 248 241 next = p->m_next; 249 if (next && !next->isImageSet() && 250 !next->isXPositionSet() && !next->isYPositionSet() && 251 !next->isAttachmentSet() && !next->isClipSet() && 252 !next->isCompositeSet() && !next->isOriginSet() && 253 !next->isRepeatXSet() && !next->isRepeatYSet() 254 && !next->isSizeSet()) { 242 if (!next) 243 break; 244 245 bool anyAttributeSet = next->isXPositionSet() 246 || next->isYPositionSet() 247 || next->isAttachmentSet() 248 || next->isClipSet() 249 || next->isCompositeSet() 250 || next->isOriginSet() 251 || next->isRepeatXSet() 252 || next->isRepeatYSet() 253 || next->isSizeSet(); 254 255 if (!next->isImageSet() || !anyAttributeSet) { 255 256 delete next; 256 257 p->m_next = 0; -
trunk/WebCore/rendering/style/RenderStyle.h
r62677 r63653 873 873 { 874 874 if (backgroundLayers()->next()) { 875 accessBackgroundLayers()->fillUnsetProperties(); 875 876 accessBackgroundLayers()->cullEmptyLayers(); 876 accessBackgroundLayers()->fillUnsetProperties();877 877 } 878 878 } … … 884 884 { 885 885 if (maskLayers()->next()) { 886 accessMaskLayers()->fillUnsetProperties(); 886 887 accessMaskLayers()->cullEmptyLayers(); 887 accessMaskLayers()->fillUnsetProperties();888 888 } 889 889 }
Note: See TracChangeset
for help on using the changeset viewer.