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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 } | 650 } |
651 | 651 |
652 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&) | 652 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&) |
653 { | 653 { |
654 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not
. This | 654 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not
. This |
655 // note is a reminder that eventually "inherit" needs to be supported. | 655 // note is a reminder that eventually "inherit" needs to be supported. |
656 } | 656 } |
657 | 657 |
658 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
te, CSSValue* value) | 658 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
te, CSSValue* value) |
659 { | 659 { |
| 660 if (value->isPrimitiveValue()) { |
| 661 CSSValueID cssValueID = toCSSPrimitiveValue(*value).getValueID(); |
| 662 if (cssValueID == CSSValueNormal || cssValueID == CSSValueNone) { |
| 663 state.style()->clearContent(); |
| 664 return; |
| 665 } |
| 666 } |
| 667 |
660 // list of string, uri, counter, attr, i | 668 // list of string, uri, counter, attr, i |
661 | |
662 bool didSet = false; | 669 bool didSet = false; |
663 for (auto& item : toCSSValueList(*value)) { | 670 for (auto& item : toCSSValueList(*value)) { |
664 if (item->isImageGeneratorValue()) { | 671 if (item->isImageGeneratorValue()) { |
665 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGene
ratorValue(*item)), didSet); | 672 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGene
ratorValue(*item)), didSet); |
666 didSet = true; | 673 didSet = true; |
667 } else if (item->isImageSetValue()) { | 674 } else if (item->isImageSetValue()) { |
668 state.style()->setContent(state.elementStyleResources().setOrPending
FromValue(CSSPropertyContent, toCSSImageSetValue(*item)), didSet); | 675 state.style()->setContent(state.elementStyleResources().setOrPending
FromValue(CSSPropertyContent, toCSSImageSetValue(*item)), didSet); |
669 didSet = true; | 676 didSet = true; |
670 } | 677 } |
671 | 678 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 } | 849 } |
843 } | 850 } |
844 | 851 |
845 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) | 852 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) |
846 { | 853 { |
847 if (!state.parentNode()->isDocumentNode()) | 854 if (!state.parentNode()->isDocumentNode()) |
848 state.style()->setPosition(state.parentStyle()->position()); | 855 state.style()->setPosition(state.parentStyle()->position()); |
849 } | 856 } |
850 | 857 |
851 } // namespace blink | 858 } // namespace blink |
OLD | NEW |