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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1535 return cssValuePool().createIdentifierValue(CSSValueBold); | 1535 return cssValuePool().createIdentifierValue(CSSValueBold); |
| 1536 case FontWeight800: | 1536 case FontWeight800: |
| 1537 return cssValuePool().createIdentifierValue(CSSValue800); | 1537 return cssValuePool().createIdentifierValue(CSSValue800); |
| 1538 case FontWeight900: | 1538 case FontWeight900: |
| 1539 return cssValuePool().createIdentifierValue(CSSValue900); | 1539 return cssValuePool().createIdentifierValue(CSSValue900); |
| 1540 } | 1540 } |
| 1541 ASSERT_NOT_REACHED(); | 1541 ASSERT_NOT_REACHED(); |
| 1542 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1542 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 1543 } | 1543 } |
| 1544 | 1544 |
| 1545 static PassRefPtr<CSSValue> touchActionFlagsToCSSValue(int touchAction) | |
|
Rick Byers
2013/12/06 21:44:04
This should take a TouchAction. You could always
gnana
2013/12/10 18:24:37
Done.
| |
| 1546 { | |
| 1547 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | |
| 1548 if (touchAction & TouchActionNone) | |
| 1549 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | |
| 1550 if (touchAction & TouchActionAuto) | |
| 1551 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | |
| 1552 if (touchAction & TouchActionPanX) | |
|
Rick Byers
2013/12/06 21:44:04
We should probably ASSERT or otherwise reject the
gnana
2013/12/10 18:24:37
I m checking on this. i will update this in next p
Rick Byers
2013/12/10 21:57:14
Ok. Whatever the common error-handling pattern se
gnana
2013/12/11 14:02:53
Done.
| |
| 1553 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); | |
| 1554 if (touchAction & TouchActionPanY) | |
| 1555 list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); | |
| 1556 | |
| 1557 if (!list->length()) | |
| 1558 return cssValuePool().createIdentifierValue(CSSValueAuto); | |
| 1559 return list.release(); | |
| 1560 } | |
| 1561 | |
| 1545 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) | 1562 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) |
| 1546 { | 1563 { |
| 1547 // Some properties only depend on layout in certain conditions which | 1564 // Some properties only depend on layout in certain conditions which |
| 1548 // are specified in the main switch statement below. So we can avoid | 1565 // are specified in the main switch statement below. So we can avoid |
| 1549 // forcing layout in those conditions. The conditions in this switch | 1566 // forcing layout in those conditions. The conditions in this switch |
| 1550 // statement must remain in sync with the conditions in the main switch. | 1567 // statement must remain in sync with the conditions in the main switch. |
| 1551 // FIXME: Some of these cases could be narrowed down or optimized better. | 1568 // FIXME: Some of these cases could be narrowed down or optimized better. |
| 1552 switch (propertyID) { | 1569 switch (propertyID) { |
| 1553 case CSSPropertyBottom: | 1570 case CSSPropertyBottom: |
| 1554 case CSSPropertyGridDefinitionColumns: | 1571 case CSSPropertyGridDefinitionColumns: |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2309 return cssValuePool().createValue(style->textSecurity()); | 2326 return cssValuePool().createValue(style->textSecurity()); |
| 2310 case CSSPropertyWebkitTextStrokeColor: | 2327 case CSSPropertyWebkitTextStrokeColor: |
| 2311 return currentColorOrValidColor(*style, style->textStrokeColor()); | 2328 return currentColorOrValidColor(*style, style->textStrokeColor()); |
| 2312 case CSSPropertyWebkitTextStrokeWidth: | 2329 case CSSPropertyWebkitTextStrokeWidth: |
| 2313 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style); | 2330 return zoomAdjustedPixelValue(style->textStrokeWidth(), *style); |
| 2314 case CSSPropertyTextTransform: | 2331 case CSSPropertyTextTransform: |
| 2315 return cssValuePool().createValue(style->textTransform()); | 2332 return cssValuePool().createValue(style->textTransform()); |
| 2316 case CSSPropertyTop: | 2333 case CSSPropertyTop: |
| 2317 return valueForPositionOffset(*style, CSSPropertyTop, renderer, m_no de->document().renderView()); | 2334 return valueForPositionOffset(*style, CSSPropertyTop, renderer, m_no de->document().renderView()); |
| 2318 case CSSPropertyTouchAction: | 2335 case CSSPropertyTouchAction: |
| 2319 return cssValuePool().createValue(style->touchAction()); | 2336 return touchActionFlagsToCSSValue(style->touchAction()); |
| 2320 case CSSPropertyTouchActionDelay: | 2337 case CSSPropertyTouchActionDelay: |
| 2321 return cssValuePool().createValue(style->touchActionDelay()); | 2338 return cssValuePool().createValue(style->touchActionDelay()); |
| 2322 case CSSPropertyUnicodeBidi: | 2339 case CSSPropertyUnicodeBidi: |
| 2323 return cssValuePool().createValue(style->unicodeBidi()); | 2340 return cssValuePool().createValue(style->unicodeBidi()); |
| 2324 case CSSPropertyVerticalAlign: | 2341 case CSSPropertyVerticalAlign: |
| 2325 switch (style->verticalAlign()) { | 2342 switch (style->verticalAlign()) { |
| 2326 case BASELINE: | 2343 case BASELINE: |
| 2327 return cssValuePool().createIdentifierValue(CSSValueBaseline ); | 2344 return cssValuePool().createIdentifierValue(CSSValueBaseline ); |
| 2328 case MIDDLE: | 2345 case MIDDLE: |
| 2329 return cssValuePool().createIdentifierValue(CSSValueMiddle); | 2346 return cssValuePool().createIdentifierValue(CSSValueMiddle); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3230 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, | 3247 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, |
| 3231 CSSPropertyB ackgroundClip }; | 3248 CSSPropertyB ackgroundClip }; |
| 3232 | 3249 |
| 3233 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3250 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 3234 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); | 3251 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); |
| 3235 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); | 3252 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); |
| 3236 return list.release(); | 3253 return list.release(); |
| 3237 } | 3254 } |
| 3238 | 3255 |
| 3239 } // namespace WebCore | 3256 } // namespace WebCore |
| OLD | NEW |