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