Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 723373006: Add CSS parsing support for the scroll-blocks-on property (in place of touch-action-delay) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Apply CR feedback Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 CSSPropertyPaddingRight, 168 CSSPropertyPaddingRight,
169 CSSPropertyPaddingTop, 169 CSSPropertyPaddingTop,
170 CSSPropertyPageBreakAfter, 170 CSSPropertyPageBreakAfter,
171 CSSPropertyPageBreakBefore, 171 CSSPropertyPageBreakBefore,
172 CSSPropertyPageBreakInside, 172 CSSPropertyPageBreakInside,
173 CSSPropertyPointerEvents, 173 CSSPropertyPointerEvents,
174 CSSPropertyPosition, 174 CSSPropertyPosition,
175 CSSPropertyResize, 175 CSSPropertyResize,
176 CSSPropertyRight, 176 CSSPropertyRight,
177 CSSPropertyScrollBehavior, 177 CSSPropertyScrollBehavior,
178 CSSPropertyScrollBlocksOn,
178 CSSPropertySpeak, 179 CSSPropertySpeak,
179 CSSPropertyTableLayout, 180 CSSPropertyTableLayout,
180 CSSPropertyTabSize, 181 CSSPropertyTabSize,
181 CSSPropertyTextAlign, 182 CSSPropertyTextAlign,
182 CSSPropertyTextAlignLast, 183 CSSPropertyTextAlignLast,
183 CSSPropertyTextDecoration, 184 CSSPropertyTextDecoration,
184 CSSPropertyTextDecorationLine, 185 CSSPropertyTextDecorationLine,
185 CSSPropertyTextDecorationStyle, 186 CSSPropertyTextDecorationStyle,
186 CSSPropertyTextDecorationColor, 187 CSSPropertyTextDecorationColor,
187 CSSPropertyTextJustify, 188 CSSPropertyTextJustify,
188 CSSPropertyTextUnderlinePosition, 189 CSSPropertyTextUnderlinePosition,
189 CSSPropertyTextIndent, 190 CSSPropertyTextIndent,
190 CSSPropertyTextRendering, 191 CSSPropertyTextRendering,
191 CSSPropertyTextShadow, 192 CSSPropertyTextShadow,
192 CSSPropertyTextOverflow, 193 CSSPropertyTextOverflow,
193 CSSPropertyTextTransform, 194 CSSPropertyTextTransform,
194 CSSPropertyTop, 195 CSSPropertyTop,
195 CSSPropertyTouchAction, 196 CSSPropertyTouchAction,
196 CSSPropertyTouchActionDelay,
197 CSSPropertyTransitionDelay, 197 CSSPropertyTransitionDelay,
198 CSSPropertyTransitionDuration, 198 CSSPropertyTransitionDuration,
199 CSSPropertyTransitionProperty, 199 CSSPropertyTransitionProperty,
200 CSSPropertyTransitionTimingFunction, 200 CSSPropertyTransitionTimingFunction,
201 CSSPropertyUnicodeBidi, 201 CSSPropertyUnicodeBidi,
202 CSSPropertyVerticalAlign, 202 CSSPropertyVerticalAlign,
203 CSSPropertyVisibility, 203 CSSPropertyVisibility,
204 CSSPropertyWhiteSpace, 204 CSSPropertyWhiteSpace,
205 CSSPropertyWidows, 205 CSSPropertyWidows,
206 CSSPropertyWidth, 206 CSSPropertyWidth,
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 } else { 1460 } else {
1461 if (touchAction & TouchActionPanX) 1461 if (touchAction & TouchActionPanX)
1462 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); 1462 list->append(cssValuePool().createIdentifierValue(CSSValuePanX));
1463 if (touchAction & TouchActionPanY) 1463 if (touchAction & TouchActionPanY)
1464 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); 1464 list->append(cssValuePool().createIdentifierValue(CSSValuePanY));
1465 } 1465 }
1466 ASSERT(list->length()); 1466 ASSERT(list->length());
1467 return list.release(); 1467 return list.release();
1468 } 1468 }
1469 1469
1470 static PassRefPtrWillBeRawPtr<CSSValue> scrollBlocksOnFlagsToCSSValue(ScrollBloc ksOn scrollBlocksOn)
1471 {
1472 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
1473
1474 if (scrollBlocksOn == ScrollBlocksOnNone)
1475 return cssValuePool().createIdentifierValue(CSSValueNone);
1476
1477 if (scrollBlocksOn & ScrollBlocksOnStartTouch)
1478 list->append(cssValuePool().createIdentifierValue(CSSValueStartTouch));
1479 if (scrollBlocksOn & ScrollBlocksOnWheelEvent)
1480 list->append(cssValuePool().createIdentifierValue(CSSValueWheelEvent));
1481 if (scrollBlocksOn & ScrollBlocksOnScrollEvent)
1482 list->append(cssValuePool().createIdentifierValue(CSSValueScrollEvent));
1483 ASSERT(list->length());
1484 return list.release();
1485 }
1486
1470 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) 1487 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer)
1471 { 1488 {
1472 // Some properties only depend on layout in certain conditions which 1489 // Some properties only depend on layout in certain conditions which
1473 // are specified in the main switch statement below. So we can avoid 1490 // are specified in the main switch statement below. So we can avoid
1474 // forcing layout in those conditions. The conditions in this switch 1491 // forcing layout in those conditions. The conditions in this switch
1475 // statement must remain in sync with the conditions in the main switch. 1492 // statement must remain in sync with the conditions in the main switch.
1476 // FIXME: Some of these cases could be narrowed down or optimized better. 1493 // FIXME: Some of these cases could be narrowed down or optimized better.
1477 switch (propertyID) { 1494 switch (propertyID) {
1478 case CSSPropertyBottom: 1495 case CSSPropertyBottom:
1479 case CSSPropertyGridTemplateColumns: 1496 case CSSPropertyGridTemplateColumns:
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 return cssValuePool().createValue(style->pageBreakInside()); 2186 return cssValuePool().createValue(style->pageBreakInside());
2170 } 2187 }
2171 case CSSPropertyPosition: 2188 case CSSPropertyPosition:
2172 return cssValuePool().createValue(style->position()); 2189 return cssValuePool().createValue(style->position());
2173 case CSSPropertyRight: 2190 case CSSPropertyRight:
2174 return valueForPositionOffset(*style, CSSPropertyRight, renderer); 2191 return valueForPositionOffset(*style, CSSPropertyRight, renderer);
2175 case CSSPropertyWebkitRubyPosition: 2192 case CSSPropertyWebkitRubyPosition:
2176 return cssValuePool().createValue(style->rubyPosition()); 2193 return cssValuePool().createValue(style->rubyPosition());
2177 case CSSPropertyScrollBehavior: 2194 case CSSPropertyScrollBehavior:
2178 return cssValuePool().createValue(style->scrollBehavior()); 2195 return cssValuePool().createValue(style->scrollBehavior());
2196 case CSSPropertyScrollBlocksOn:
2197 return scrollBlocksOnFlagsToCSSValue(style->scrollBlocksOn());
2179 case CSSPropertyTableLayout: 2198 case CSSPropertyTableLayout:
2180 return cssValuePool().createValue(style->tableLayout()); 2199 return cssValuePool().createValue(style->tableLayout());
2181 case CSSPropertyTextAlign: 2200 case CSSPropertyTextAlign:
2182 return cssValuePool().createValue(style->textAlign()); 2201 return cssValuePool().createValue(style->textAlign());
2183 case CSSPropertyTextAlignLast: 2202 case CSSPropertyTextAlignLast:
2184 return cssValuePool().createValue(style->textAlignLast()); 2203 return cssValuePool().createValue(style->textAlignLast());
2185 case CSSPropertyTextDecoration: 2204 case CSSPropertyTextDecoration:
2186 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()) 2205 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled())
2187 return valuesForShorthandProperty(textDecorationShorthand()); 2206 return valuesForShorthandProperty(textDecorationShorthand());
2188 // Fall through. 2207 // Fall through.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 case CSSPropertyWebkitTextStrokeColor: 2273 case CSSPropertyWebkitTextStrokeColor:
2255 return currentColorOrValidColor(*style, style->textStrokeColor()); 2274 return currentColorOrValidColor(*style, style->textStrokeColor());
2256 case CSSPropertyWebkitTextStrokeWidth: 2275 case CSSPropertyWebkitTextStrokeWidth:
2257 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style); 2276 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style);
2258 case CSSPropertyTextTransform: 2277 case CSSPropertyTextTransform:
2259 return cssValuePool().createValue(style->textTransform()); 2278 return cssValuePool().createValue(style->textTransform());
2260 case CSSPropertyTop: 2279 case CSSPropertyTop:
2261 return valueForPositionOffset(*style, CSSPropertyTop, renderer); 2280 return valueForPositionOffset(*style, CSSPropertyTop, renderer);
2262 case CSSPropertyTouchAction: 2281 case CSSPropertyTouchAction:
2263 return touchActionFlagsToCSSValue(style->touchAction()); 2282 return touchActionFlagsToCSSValue(style->touchAction());
2264 case CSSPropertyTouchActionDelay:
2265 return cssValuePool().createValue(style->touchActionDelay());
2266 case CSSPropertyUnicodeBidi: 2283 case CSSPropertyUnicodeBidi:
2267 return cssValuePool().createValue(style->unicodeBidi()); 2284 return cssValuePool().createValue(style->unicodeBidi());
2268 case CSSPropertyVerticalAlign: 2285 case CSSPropertyVerticalAlign:
2269 switch (style->verticalAlign()) { 2286 switch (style->verticalAlign()) {
2270 case BASELINE: 2287 case BASELINE:
2271 return cssValuePool().createIdentifierValue(CSSValueBaseline ); 2288 return cssValuePool().createIdentifierValue(CSSValueBaseline );
2272 case MIDDLE: 2289 case MIDDLE:
2273 return cssValuePool().createIdentifierValue(CSSValueMiddle); 2290 return cssValuePool().createIdentifierValue(CSSValueMiddle);
2274 case SUB: 2291 case SUB:
2275 return cssValuePool().createIdentifierValue(CSSValueSub); 2292 return cssValuePool().createIdentifierValue(CSSValueSub);
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 return list.release(); 3016 return list.release();
3000 } 3017 }
3001 3018
3002 void CSSComputedStyleDeclaration::trace(Visitor* visitor) 3019 void CSSComputedStyleDeclaration::trace(Visitor* visitor)
3003 { 3020 {
3004 visitor->trace(m_node); 3021 visitor->trace(m_node);
3005 CSSStyleDeclaration::trace(visitor); 3022 CSSStyleDeclaration::trace(visitor);
3006 } 3023 }
3007 3024
3008 } // namespace blink 3025 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/webexposed/css-properties-as-js-properties-expected.txt ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698