Changeset 125989 in webkit
- Timestamp:
- Aug 19, 2012 8:33:41 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125988 r125989 1 2012-08-19 Rik Cabanier <cabanier@adobe.com> 2 3 parse CSS attribute -webkit-blend-mode 4 https://bugs.webkit.org/show_bug.cgi?id=94024 5 6 Reviewed by Dirk Schulze. 7 8 Added parsing and general CSS handling of -webkit-blend-mode per http://www.w3.org/TR/2012/WD-compositing-20120816/ 9 10 * css3/compositing: Added. 11 * css3/compositing/blend-mode-property-expected.txt: Added. 12 * css3/compositing/blend-mode-property-parsing-expected.txt: Added. 13 * css3/compositing/blend-mode-property-parsing-invalid-expected.txt: Added. 14 * css3/compositing/blend-mode-property-parsing-invalid.html: Added. 15 * css3/compositing/blend-mode-property-parsing.html: Added. 16 * css3/compositing/blend-mode-property.html: Added. 17 * css3/compositing/script-tests: Added. 18 * css3/compositing/script-tests/blend-mode-property-parsing-invalid.js: Added. 19 (testInvalidFilterRule): 20 * css3/compositing/script-tests/blend-mode-property-parsing.js: Added. 21 (jsWrapperClass): 22 (shouldBeType): 23 (testFilterRule): 24 * css3/compositing/script-tests/blend-mode-property.js: Added. 25 1 26 2012-08-19 MORITA Hajime <morrita@google.com> 2 27 -
trunk/Source/WebCore/ChangeLog
r125988 r125989 1 2012-08-19 Rik Cabanier <cabanier@adobe.com> 2 3 parse CSS attribute -webkit-blend-mode 4 https://bugs.webkit.org/show_bug.cgi?id=94024 5 6 Reviewed by Dirk Schulze. 7 8 Added parsing and general CSS handling of -webkit-blend-mode per http://www.w3.org/TR/2012/WD-compositing-20120816/ 9 10 Tests: css3/compositing/blend-mode-property-parsing-invalid.html 11 css3/compositing/blend-mode-property-parsing.html 12 css3/compositing/blend-mode-property.html 13 14 * css/CSSComputedStyleDeclaration.cpp: 15 (WebCore): 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 17 * css/CSSParser.cpp: 18 (WebCore::isValidKeywordPropertyAndValue): 19 (WebCore::isKeywordPropertyID): 20 (WebCore::CSSParser::parseValue): 21 * css/CSSProperty.cpp: 22 (WebCore::CSSProperty::isInheritedProperty): 23 * css/CSSPropertyNames.in: 24 * css/CSSValueKeywords.in: 25 * css/StyleBuilder.cpp: 26 (WebCore::StyleBuilder::StyleBuilder): 27 * rendering/RenderLayer.h: 28 (RenderLayer): 29 * rendering/RenderLayerBacking.cpp: 30 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): 31 (WebCore): 32 (WebCore::RenderLayerBacking::updateLayerBlendMode): 33 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 34 (WebCore::RenderLayerBacking::setBlendMode): 35 * rendering/RenderLayerBacking.h: 36 (RenderLayerBacking): 37 * rendering/style/RenderStyle.cpp: 38 (WebCore::RenderStyle::diff): 39 * rendering/style/RenderStyle.h: 40 * rendering/style/StyleRareNonInheritedData.cpp: 41 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 42 (WebCore::StyleRareNonInheritedData::operator==): 43 * rendering/style/StyleRareNonInheritedData.h: 44 (StyleRareNonInheritedData): 45 1 46 2012-08-19 MORITA Hajime <morrita@google.com> 2 47 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r125934 r125989 213 213 CSSPropertyWebkitBackgroundOrigin, 214 214 CSSPropertyWebkitBackgroundSize, 215 #if ENABLE(CSS_COMPOSITING) 216 CSSPropertyWebkitBlendMode, 217 #endif 215 218 CSSPropertyWebkitBorderFit, 216 219 CSSPropertyWebkitBorderHorizontalSpacing, … … 2425 2428 return valueForFilter(style.get()); 2426 2429 #endif 2430 #if ENABLE(CSS_COMPOSITING) 2431 case CSSPropertyWebkitBlendMode: 2432 return cssValuePool().createValue(style->blendMode()); 2433 #endif 2427 2434 case CSSPropertyBackground: 2428 2435 return getBackgroundShorthandValue(); -
trunk/Source/WebCore/css/CSSParser.cpp
r125845 r125989 675 675 return true; 676 676 break; 677 #if ENABLE(CSS_COMPOSITING) 678 case CSSPropertyWebkitBlendMode: 679 if (valueID == CSSValueNormal || valueID == CSSValueMultiply || valueID == CSSValueScreen || valueID == CSSValueOverlay 680 || valueID == CSSValueDarken || valueID == CSSValueLighten || valueID == CSSValueColorDodge || valueID == CSSValueColorBurn 681 || valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference || valueID == CSSValueExclusion 682 || valueID == CSSValueHue || valueID == CSSValueSaturation || valueID == CSSValueColor || valueID == CSSValueLuminosity) 683 return true; 684 break; 685 #endif 677 686 case CSSPropertyWebkitBorderFit: 678 687 if (valueID == CSSValueBorder || valueID == CSSValueLines) … … 919 928 case CSSPropertyVisibility: 920 929 case CSSPropertyWebkitAppearance: 930 #if ENABLE(CSS_COMPOSITING) 931 case CSSPropertyWebkitBlendMode: 932 #endif 921 933 case CSSPropertyWebkitBackfaceVisibility: 922 934 case CSSPropertyWebkitBorderAfterStyle: … … 2256 2268 return false; 2257 2269 } 2270 break; 2271 #endif 2272 #if ENABLE(CSS_COMPOSITING) 2273 case CSSPropertyWebkitBlendMode: 2274 validPrimitive = true; 2258 2275 break; 2259 2276 #endif -
trunk/Source/WebCore/css/CSSProperty.cpp
r125934 r125989 570 570 case CSSPropertyWebkitFilter: 571 571 #endif 572 #if ENABLE(CSS_COMPOSITING) 573 case CSSPropertyWebkitBlendMode: 574 #endif 572 575 #if ENABLE(CSS3_FLEXBOX) 573 576 case CSSPropertyWebkitAlignContent: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r125716 r125989 267 267 -webkit-filter 268 268 #endif 269 #if defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING 270 -webkit-blend-mode 271 #endif 269 272 #if defined(ENABLE_CSS3_FLEXBOX) && ENABLE_CSS3_FLEXBOX 270 273 -webkit-align-content -
trunk/Source/WebCore/css/CSSValueKeywords.in
r124820 r125989 927 927 fine 928 928 929 #if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS929 #if (defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS) || (defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING) 930 930 // -webkit-filter 931 931 #if defined(ENABLE_CSS_SHADERS) && ENABLE_CSS_SHADERS -
trunk/Source/WebCore/css/StyleBuilder.cpp
r125925 r125989 2094 2094 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler()); 2095 2095 setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler()); 2096 #if ENABLE(CSS_COMPOSITING) 2097 setPropertyHandler(CSSPropertyWebkitBlendMode, ApplyPropertyDefault<BlendMode, &RenderStyle::blendMode, BlendMode, &RenderStyle::setBlendMode, BlendMode, &RenderStyle::initialBlendMode>::createHandler()); 2098 #endif 2096 2099 } 2097 2100 -
trunk/Source/WebCore/rendering/RenderLayer.h
r125794 r125989 398 398 399 399 void updateTransform(); 400 401 #if ENABLE(CSS_COMPOSITING) 402 void updateBlendMode(); 403 #endif 400 404 401 405 const LayoutSize& relativePositionOffset() const { return m_relativeOffset; } … … 932 936 #endif 933 937 938 #if ENABLE(CSS_COMPOSITING) 939 BlendMode m_blendMode; 940 #endif 941 934 942 RenderBoxModelObject* m_renderer; 935 943 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r125794 r125989 205 205 updateLayerFilters(renderer()->style()); 206 206 #endif 207 #if ENABLE(CSS_COMPOSITING) 208 updateLayerBlendMode(renderer()->style()); 209 #endif 207 210 } 208 211 … … 240 243 { 241 244 m_canCompositeFilters = m_graphicsLayer->setFilters(style->filter()); 245 } 246 #endif 247 248 #if ENABLE(CSS_COMPOSITING) 249 void RenderLayerBacking::updateLayerBlendMode(const RenderStyle*) 250 { 242 251 } 243 252 #endif … … 452 461 #if ENABLE(CSS_FILTERS) 453 462 updateLayerFilters(renderer()->style()); 463 #endif 464 465 #if ENABLE(CSS_COMPOSITING) 466 updateLayerBlendMode(renderer()->style()); 454 467 #endif 455 468 … … 1184 1197 } 1185 1198 1199 #if ENABLE(CSS_COMPOSITING) 1200 void RenderLayerBacking::setBlendMode(BlendMode) 1201 { 1202 } 1203 #endif 1204 1186 1205 void RenderLayerBacking::setContentsNeedDisplay() 1187 1206 { -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r122354 r125989 166 166 String nameForLayer() const; 167 167 168 #if ENABLE(CSS_COMPOSITING) 169 void setBlendMode(BlendMode); 170 #endif 171 168 172 private: 169 173 void createPrimaryGraphicsLayer(); … … 197 201 void updateLayerFilters(const RenderStyle*); 198 202 #endif 199 203 #if ENABLE(CSS_COMPOSITING) 204 void updateLayerBlendMode(const RenderStyle*); 205 #endif 200 206 // Return the opacity value that this layer should use for compositing. 201 207 float compositingOpacity(float rendererOpacity) const; -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r125925 r125989 613 613 return StyleDifferenceRepaintLayer; 614 614 } 615 616 #if ENABLE(CSS_COMPOSITING) 617 if (rareNonInheritedData->m_effectiveBlendMode != other->rareNonInheritedData->m_effectiveBlendMode) 618 return StyleDifferenceRepaintLayer; 619 #endif 615 620 616 621 if (rareNonInheritedData->opacity != other->rareNonInheritedData->opacity) { -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r125925 r125989 979 979 #endif 980 980 981 #if ENABLE(CSS_COMPOSITING) 982 BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); } 983 void setBlendMode(BlendMode v) { rareNonInheritedData.access()->m_effectiveBlendMode = v; } 984 bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) == BlendModeNormal; } 985 #else 986 bool hasBlendMode() const { return false; } 987 #endif 988 981 989 #if USE(RTL_SCROLLBAR) 982 990 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); } … … 1705 1713 static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; } 1706 1714 #endif 1715 #if ENABLE(CSS_COMPOSITING) 1716 static BlendMode initialBlendMode() { return BlendModeNormal; } 1717 #endif 1707 1718 private: 1708 1719 void setVisitedLinkColor(const Color&); -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r124884 r125989 79 79 #endif 80 80 , m_hasAspectRatio(false) 81 #if ENABLE(CSS_COMPOSITING) 82 , m_effectiveBlendMode(RenderStyle::initialBlendMode()) 83 #endif 81 84 { 82 85 m_maskBoxImage.setMaskDefaults(); … … 150 153 #endif 151 154 , m_hasAspectRatio(o.m_hasAspectRatio) 155 #if ENABLE(CSS_COMPOSITING) 156 , m_effectiveBlendMode(RenderStyle::initialBlendMode()) 157 #endif 152 158 { 153 159 } … … 226 232 && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation 227 233 #endif 234 #if ENABLE(CSS_COMPOSITING) 235 && m_effectiveBlendMode == o.m_effectiveBlendMode 236 #endif 228 237 && m_hasAspectRatio == o.m_hasAspectRatio; 229 238 } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r124452 r125989 183 183 unsigned m_runningAcceleratedAnimation : 1; 184 184 #endif 185 185 186 unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified. 187 188 #if ENABLE(CSS_COMPOSITING) 189 unsigned m_effectiveBlendMode: 5; // EBlendMode 190 #endif 186 191 187 192 private:
Note: See TracChangeset
for help on using the changeset viewer.