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 * Copyright (C) 2015 Google Inc. All rights reserved. | 7 * Copyright (C) 2015 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 case OPEN_QUOTE: | 971 case OPEN_QUOTE: |
972 return CSSValueOpenQuote; | 972 return CSSValueOpenQuote; |
973 } | 973 } |
974 ASSERT_NOT_REACHED(); | 974 ASSERT_NOT_REACHED(); |
975 return CSSValueInvalid; | 975 return CSSValueInvalid; |
976 } | 976 } |
977 | 977 |
978 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) | 978 static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
style) |
979 { | 979 { |
980 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 980 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 981 if (style.hasPseudoElementStyle() && !style.contentData()) { |
| 982 list->append(cssValuePool().createIdentifierValue(CSSValueNormal)); |
| 983 } |
981 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { | 984 for (const ContentData* contentData = style.contentData(); contentData; cont
entData = contentData->next()) { |
982 if (contentData->isCounter()) { | 985 if (contentData->isCounter()) { |
983 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); | 986 const CounterContent* counter = toCounterContentData(contentData)->c
ounter(); |
984 ASSERT(counter); | 987 ASSERT(counter); |
985 RefPtrWillBeRawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentV
alue::create(counter->identifier()); | 988 RefPtrWillBeRawPtr<CSSCustomIdentValue> identifier = CSSCustomIdentV
alue::create(counter->identifier()); |
986 RefPtrWillBeRawPtr<CSSCustomIdentValue> separator = CSSCustomIdentVa
lue::create(counter->separator()); | 989 RefPtrWillBeRawPtr<CSSCustomIdentValue> separator = CSSCustomIdentVa
lue::create(counter->separator()); |
987 CSSValueID listStyleIdent = CSSValueNone; | 990 CSSValueID listStyleIdent = CSSValueNone; |
988 if (counter->listStyle() != NoneListStyle) | 991 if (counter->listStyle() != NoneListStyle) |
989 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); | 992 listStyleIdent = static_cast<CSSValueID>(CSSValueDisc + counter-
>listStyle()); |
990 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); | 993 RefPtrWillBeRawPtr<CSSPrimitiveValue> listStyle = cssValuePool().cre
ateIdentifierValue(listStyleIdent); |
991 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); | 994 list->append(CSSCounterValue::create(identifier.release(), listStyle
.release(), separator.release())); |
992 } else if (contentData->isImage()) { | 995 } else if (contentData->isImage()) { |
993 const StyleImage* image = toImageContentData(contentData)->image(); | 996 const StyleImage* image = toImageContentData(contentData)->image(); |
994 ASSERT(image); | 997 ASSERT(image); |
995 list->append(image->computedCSSValue()); | 998 list->append(image->computedCSSValue()); |
996 } else if (contentData->isText()) { | 999 } else if (contentData->isText()) { |
997 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); | 1000 list->append(CSSStringValue::create(toTextContentData(contentData)->
text())); |
998 } else if (contentData->isQuote()) { | 1001 } else if (contentData->isQuote()) { |
999 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; | 1002 const QuoteType quoteType = toQuoteContentData(contentData)->quote()
; |
1000 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); | 1003 list->append(cssValuePool().createIdentifierValue(valueForQuoteType(
quoteType))); |
| 1004 } else if (contentData->isCSSValueID()) { |
| 1005 list->append(cssValuePool().createIdentifierValue(toCSSValueIDConten
tData(contentData)->cssValueID())); |
1001 } else { | 1006 } else { |
1002 ASSERT_NOT_REACHED(); | 1007 ASSERT_NOT_REACHED(); |
1003 } | 1008 } |
1004 } | 1009 } |
1005 return list.release(); | 1010 return list.release(); |
1006 } | 1011 } |
1007 | 1012 |
1008 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) | 1013 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const Computed
Style& style, CSSPropertyID propertyID) |
1009 { | 1014 { |
1010 const CounterDirectiveMap* map = style.counterDirectives(); | 1015 const CounterDirectiveMap* map = style.counterDirectives(); |
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 case CSSPropertyAll: | 2759 case CSSPropertyAll: |
2755 return nullptr; | 2760 return nullptr; |
2756 default: | 2761 default: |
2757 break; | 2762 break; |
2758 } | 2763 } |
2759 ASSERT_NOT_REACHED(); | 2764 ASSERT_NOT_REACHED(); |
2760 return nullptr; | 2765 return nullptr; |
2761 } | 2766 } |
2762 | 2767 |
2763 } // namespace blink | 2768 } // namespace blink |
OLD | NEW |