| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 | 271 |
| 272 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s
tate, CSSValue* value) | 272 void StyleBuilderFunctions::applyValueCSSPropertyDirection(StyleResolverState& s
tate, CSSValue* value) |
| 273 { | 273 { |
| 274 state.style()->setDirection(*toCSSPrimitiveValue(value)); | 274 state.style()->setDirection(*toCSSPrimitiveValue(value)); |
| 275 Element* element = state.element(); | 275 Element* element = state.element(); |
| 276 if (element && element == element->document().documentElement()) | 276 if (element && element == element->document().documentElement()) |
| 277 element->document().setDirectionSetOnDocumentElement(true); | 277 element->document().setDirectionSetOnDocumentElement(true); |
| 278 } | 278 } |
| 279 | 279 |
| 280 static inline bool isValidDisplayValue(StyleResolverState& state, EDisplay displ
ayPropertyValue) | |
| 281 { | |
| 282 if (state.element() && state.element()->isSVGElement() && state.style()->sty
leType() == NOPSEUDO) | |
| 283 return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK
|| displayPropertyValue == NONE); | |
| 284 return true; | |
| 285 } | |
| 286 | |
| 287 void StyleBuilderFunctions::applyInheritCSSPropertyDisplay(StyleResolverState& s
tate) | |
| 288 { | |
| 289 EDisplay display = state.parentStyle()->display(); | |
| 290 if (!isValidDisplayValue(state, display)) | |
| 291 return; | |
| 292 state.style()->setDisplay(display); | |
| 293 } | |
| 294 | |
| 295 void StyleBuilderFunctions::applyValueCSSPropertyDisplay(StyleResolverState& sta
te, CSSValue* value) | |
| 296 { | |
| 297 EDisplay display = *toCSSPrimitiveValue(value); | |
| 298 if (!isValidDisplayValue(state, display)) | |
| 299 return; | |
| 300 state.style()->setDisplay(display); | |
| 301 } | |
| 302 | |
| 303 void StyleBuilderFunctions::applyInitialCSSPropertyFontFamily(StyleResolverState
& state) | 280 void StyleBuilderFunctions::applyInitialCSSPropertyFontFamily(StyleResolverState
& state) |
| 304 { | 281 { |
| 305 state.fontBuilder().setFontFamilyInitial(); | 282 state.fontBuilder().setFontFamilyInitial(); |
| 306 } | 283 } |
| 307 | 284 |
| 308 void StyleBuilderFunctions::applyInheritCSSPropertyFontFamily(StyleResolverState
& state) | 285 void StyleBuilderFunctions::applyInheritCSSPropertyFontFamily(StyleResolverState
& state) |
| 309 { | 286 { |
| 310 state.fontBuilder().setFontFamilyInherit(state.parentFontDescription()); | 287 state.fontBuilder().setFontFamilyInherit(state.parentFontDescription()); |
| 311 } | 288 } |
| 312 | 289 |
| (...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 break; | 1458 break; |
| 1482 default: | 1459 default: |
| 1483 ASSERT_NOT_REACHED(); | 1460 ASSERT_NOT_REACHED(); |
| 1484 break; | 1461 break; |
| 1485 } | 1462 } |
| 1486 | 1463 |
| 1487 state.style()->setGridAutoFlow(autoFlow); | 1464 state.style()->setGridAutoFlow(autoFlow); |
| 1488 } | 1465 } |
| 1489 | 1466 |
| 1490 } // namespace WebCore | 1467 } // namespace WebCore |
| OLD | NEW |