OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2114 return false; | 2114 return false; |
2115 | 2115 |
2116 trackSizes.append(trackSize); | 2116 trackSizes.append(trackSize); |
2117 } | 2117 } |
2118 return true; | 2118 return true; |
2119 } | 2119 } |
2120 | 2120 |
2121 | 2121 |
2122 static bool createGridPosition(CSSValue* value, GridPosition& position) | 2122 static bool createGridPosition(CSSValue* value, GridPosition& position) |
2123 { | 2123 { |
2124 // For now, we only accept: <integer> | 'auto' | 2124 // For now, we only accept: 'auto' | <integer> | span && <integer>? |
2125 if (!value->isPrimitiveValue()) | 2125 if (value->isPrimitiveValue()) { |
2126 return false; | 2126 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(valu
e); |
| 2127 if (primitiveValue->getIdent() == CSSValueAuto) |
| 2128 return true; |
2127 | 2129 |
2128 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); | 2130 if (primitiveValue->getIdent() == CSSValueSpan) { |
2129 if (primitiveValue->getIdent() == CSSValueAuto) | 2131 // If the <integer> is omitted, it defaults to '1'. |
| 2132 position.setSpanPosition(1); |
| 2133 return true; |
| 2134 } |
| 2135 |
| 2136 ASSERT(primitiveValue->isNumber()); |
| 2137 position.setIntegerPosition(primitiveValue->getIntValue()); |
2130 return true; | 2138 return true; |
| 2139 } |
2131 | 2140 |
2132 ASSERT_WITH_SECURITY_IMPLICATION(primitiveValue->isNumber()); | 2141 ASSERT_WITH_SECURITY_IMPLICATION(value->isValueList()); |
2133 position.setIntegerPosition(primitiveValue->getIntValue()); | 2142 CSSValueList* values = static_cast<CSSValueList*>(value); |
| 2143 ASSERT(values->length() == 2); |
| 2144 ASSERT_WITH_SECURITY_IMPLICATION(values->itemWithoutBoundsCheck(1)->isPrimit
iveValue()); |
| 2145 CSSPrimitiveValue* numericValue = static_cast<CSSPrimitiveValue*>(values->it
emWithoutBoundsCheck(1)); |
| 2146 ASSERT(numericValue->isNumber()); |
| 2147 position.setSpanPosition(numericValue->getIntValue()); |
2134 return true; | 2148 return true; |
2135 } | 2149 } |
2136 | 2150 |
2137 static bool hasVariableReference(CSSValue* value) | 2151 static bool hasVariableReference(CSSValue* value) |
2138 { | 2152 { |
2139 if (value->isPrimitiveValue()) { | 2153 if (value->isPrimitiveValue()) { |
2140 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(valu
e); | 2154 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(valu
e); |
2141 return primitiveValue->hasVariableReference(); | 2155 return primitiveValue->hasVariableReference(); |
2142 } | 2156 } |
2143 | 2157 |
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4439 info.addMember(m_state, "state"); | 4453 info.addMember(m_state, "state"); |
4440 | 4454 |
4441 // FIXME: move this to a place where it would be called only once? | 4455 // FIXME: move this to a place where it would be called only once? |
4442 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); | 4456 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); |
4443 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); | 4457 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); |
4444 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle,"defaultPrintStyle")
; | 4458 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle,"defaultPrintStyle")
; |
4445 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); | 4459 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); |
4446 } | 4460 } |
4447 | 4461 |
4448 } // namespace WebCore | 4462 } // namespace WebCore |
OLD | NEW |