Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1540 return cssValuePool().createIdentifierValue(CSSValueBold); | 1540 return cssValuePool().createIdentifierValue(CSSValueBold); |
| 1541 case FontWeight800: | 1541 case FontWeight800: |
| 1542 return cssValuePool().createIdentifierValue(CSSValue800); | 1542 return cssValuePool().createIdentifierValue(CSSValue800); |
| 1543 case FontWeight900: | 1543 case FontWeight900: |
| 1544 return cssValuePool().createIdentifierValue(CSSValue900); | 1544 return cssValuePool().createIdentifierValue(CSSValue900); |
| 1545 } | 1545 } |
| 1546 ASSERT_NOT_REACHED(); | 1546 ASSERT_NOT_REACHED(); |
| 1547 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1547 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 static PassRefPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction touchAction) | |
| 1551 { | |
| 1552 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | |
| 1553 if (touchAction == TouchActionAuto) { | |
|
eseidel
2013/12/13 17:19:06
nit: most places in blink we drop the {} around si
gnana
2013/12/16 08:16:26
Done.
| |
| 1554 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | |
| 1555 } | |
| 1556 if (touchAction & TouchActionNone) { | |
| 1557 ASSERT(touchAction == TouchActionNone); | |
| 1558 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | |
| 1559 } | |
| 1560 if (touchAction & TouchActionPanX) { | |
| 1561 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); | |
| 1562 } | |
| 1563 if (touchAction & TouchActionPanY) { | |
| 1564 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); | |
| 1565 } | |
| 1566 ASSERT(list->length()); | |
| 1567 return list.release(); | |
| 1568 } | |
| 1569 | |
| 1550 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) | 1570 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) |
| 1551 { | 1571 { |
| 1552 // Some properties only depend on layout in certain conditions which | 1572 // Some properties only depend on layout in certain conditions which |
| 1553 // are specified in the main switch statement below. So we can avoid | 1573 // are specified in the main switch statement below. So we can avoid |
| 1554 // forcing layout in those conditions. The conditions in this switch | 1574 // forcing layout in those conditions. The conditions in this switch |
| 1555 // statement must remain in sync with the conditions in the main switch. | 1575 // statement must remain in sync with the conditions in the main switch. |
| 1556 // FIXME: Some of these cases could be narrowed down or optimized better. | 1576 // FIXME: Some of these cases could be narrowed down or optimized better. |
| 1557 switch (propertyID) { | 1577 switch (propertyID) { |
| 1558 case CSSPropertyBottom: | 1578 case CSSPropertyBottom: |
| 1559 case CSSPropertyGridDefinitionColumns: | 1579 case CSSPropertyGridDefinitionColumns: |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2314 return cssValuePool().createValue(style->textSecurity()); | 2334 return cssValuePool().createValue(style->textSecurity()); |
| 2315 case CSSPropertyWebkitTextStrokeColor: | 2335 case CSSPropertyWebkitTextStrokeColor: |
| 2316 return currentColorOrValidColor(*style, style->textStrokeColor()); | 2336 return currentColorOrValidColor(*style, style->textStrokeColor()); |
| 2317 case CSSPropertyWebkitTextStrokeWidth: | 2337 case CSSPropertyWebkitTextStrokeWidth: |
| 2318 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style); | 2338 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style); |
| 2319 case CSSPropertyTextTransform: | 2339 case CSSPropertyTextTransform: |
| 2320 return cssValuePool().createValue(style->textTransform()); | 2340 return cssValuePool().createValue(style->textTransform()); |
| 2321 case CSSPropertyTop: | 2341 case CSSPropertyTop: |
| 2322 return valueForPositionOffset(*style, CSSPropertyTop, renderer, m_no de->document().renderView()); | 2342 return valueForPositionOffset(*style, CSSPropertyTop, renderer, m_no de->document().renderView()); |
| 2323 case CSSPropertyTouchAction: | 2343 case CSSPropertyTouchAction: |
| 2324 return cssValuePool().createValue(style->touchAction()); | 2344 return touchActionFlagsToCSSValue(style->touchAction()); |
| 2325 case CSSPropertyTouchActionDelay: | 2345 case CSSPropertyTouchActionDelay: |
| 2326 return cssValuePool().createValue(style->touchActionDelay()); | 2346 return cssValuePool().createValue(style->touchActionDelay()); |
| 2327 case CSSPropertyUnicodeBidi: | 2347 case CSSPropertyUnicodeBidi: |
| 2328 return cssValuePool().createValue(style->unicodeBidi()); | 2348 return cssValuePool().createValue(style->unicodeBidi()); |
| 2329 case CSSPropertyVerticalAlign: | 2349 case CSSPropertyVerticalAlign: |
| 2330 switch (style->verticalAlign()) { | 2350 switch (style->verticalAlign()) { |
| 2331 case BASELINE: | 2351 case BASELINE: |
| 2332 return cssValuePool().createIdentifierValue(CSSValueBaseline ); | 2352 return cssValuePool().createIdentifierValue(CSSValueBaseline ); |
| 2333 case MIDDLE: | 2353 case MIDDLE: |
| 2334 return cssValuePool().createIdentifierValue(CSSValueMiddle); | 2354 return cssValuePool().createIdentifierValue(CSSValueMiddle); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3235 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, | 3255 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, |
| 3236 CSSPropertyB ackgroundClip }; | 3256 CSSPropertyB ackgroundClip }; |
| 3237 | 3257 |
| 3238 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3258 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 3239 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); | 3259 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); |
| 3240 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); | 3260 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); |
| 3241 return list.release(); | 3261 return list.release(); |
| 3242 } | 3262 } |
| 3243 | 3263 |
| 3244 } // namespace WebCore | 3264 } // namespace WebCore |
| OLD | NEW |