Changeset 126105 in webkit
- Timestamp:
- Aug 20, 2012 5:35:27 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126097 r126105 1 2012-08-20 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 * platform/chromium/css3/compositing/blend-mode-property-expected.txt : Added. 26 * platform/chromium/css3/compositing/blend-mode-property-parsing-expected.txt : Added. 27 1 28 2012-08-20 Brady Eidson <beidson@apple.com> 2 29 -
trunk/Source/WebCore/ChangeLog
r126103 r126105 1 2012-08-20 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-20 Kentaro Hara <haraken@chromium.org> 2 47 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r126072 r126105 214 214 CSSPropertyWebkitBackgroundOrigin, 215 215 CSSPropertyWebkitBackgroundSize, 216 #if ENABLE(CSS_COMPOSITING) 217 CSSPropertyWebkitBlendMode, 218 #endif 216 219 CSSPropertyWebkitBorderFit, 217 220 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
r126072 r126105 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: … … 2246 2258 return false; 2247 2259 } 2260 break; 2261 #endif 2262 #if ENABLE(CSS_COMPOSITING) 2263 case CSSPropertyWebkitBlendMode: 2264 validPrimitive = true; 2248 2265 break; 2249 2266 #endif -
trunk/Source/WebCore/css/CSSProperty.cpp
r126054 r126105 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
r126054 r126105 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
r126072 r126105 931 931 fine 932 932 933 #if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS933 #if (defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS) || (defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING) 934 934 // -webkit-filter 935 935 #if defined(ENABLE_CSS_SHADERS) && ENABLE_CSS_SHADERS -
trunk/Source/WebCore/css/StyleBuilder.cpp
r126072 r126105 2065 2065 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler()); 2066 2066 setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler()); 2067 #if ENABLE(CSS_COMPOSITING) 2068 setPropertyHandler(CSSPropertyWebkitBlendMode, ApplyPropertyDefault<BlendMode, &RenderStyle::blendMode, BlendMode, &RenderStyle::setBlendMode, BlendMode, &RenderStyle::initialBlendMode>::createHandler()); 2069 #endif 2067 2070 } 2068 2071 -
trunk/Source/WebCore/rendering/RenderLayer.h
r126032 r126105 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
r126032 r126105 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
r126032 r126105 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
r126054 r126105 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
r126054 r126105 982 982 #endif 983 983 984 #if ENABLE(CSS_COMPOSITING) 985 BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); } 986 void setBlendMode(BlendMode v) { rareNonInheritedData.access()->m_effectiveBlendMode = v; } 987 bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) == BlendModeNormal; } 988 #else 989 bool hasBlendMode() const { return false; } 990 #endif 991 984 992 #if USE(RTL_SCROLLBAR) 985 993 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); } … … 1714 1722 static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; } 1715 1723 #endif 1724 #if ENABLE(CSS_COMPOSITING) 1725 static BlendMode initialBlendMode() { return BlendModeNormal; } 1726 #endif 1716 1727 private: 1717 1728 void setVisitedLinkColor(const Color&); -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r126054 r126105 82 82 #endif 83 83 , m_hasAspectRatio(false) 84 #if ENABLE(CSS_COMPOSITING) 85 , m_effectiveBlendMode(RenderStyle::initialBlendMode()) 86 #endif 84 87 { 85 88 m_maskBoxImage.setMaskDefaults(); … … 156 159 #endif 157 160 , m_hasAspectRatio(o.m_hasAspectRatio) 161 #if ENABLE(CSS_COMPOSITING) 162 , m_effectiveBlendMode(RenderStyle::initialBlendMode()) 163 #endif 158 164 { 159 165 } … … 235 241 && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation 236 242 #endif 243 #if ENABLE(CSS_COMPOSITING) 244 && m_effectiveBlendMode == o.m_effectiveBlendMode 245 #endif 237 246 && m_hasAspectRatio == o.m_hasAspectRatio; 238 247 } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r126054 r126105 186 186 unsigned m_runningAcceleratedAnimation : 1; 187 187 #endif 188 188 189 unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified. 190 191 #if ENABLE(CSS_COMPOSITING) 192 unsigned m_effectiveBlendMode: 5; // EBlendMode 193 #endif 189 194 190 195 private:
Note: See TracChangeset
for help on using the changeset viewer.