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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "core/css/StylePropertySet.h" | 59 #include "core/css/StylePropertySet.h" |
60 #include "core/css/StyleRule.h" | 60 #include "core/css/StyleRule.h" |
61 #include "core/css/resolver/CSSVariableResolver.h" | 61 #include "core/css/resolver/CSSVariableResolver.h" |
62 #include "core/css/resolver/ElementStyleResources.h" | 62 #include "core/css/resolver/ElementStyleResources.h" |
63 #include "core/css/resolver/FilterOperationResolver.h" | 63 #include "core/css/resolver/FilterOperationResolver.h" |
64 #include "core/css/resolver/FontBuilder.h" | 64 #include "core/css/resolver/FontBuilder.h" |
65 #include "core/css/resolver/StyleBuilder.h" | 65 #include "core/css/resolver/StyleBuilder.h" |
66 #include "core/css/resolver/TransformBuilder.h" | 66 #include "core/css/resolver/TransformBuilder.h" |
67 #include "core/frame/LocalFrame.h" | 67 #include "core/frame/LocalFrame.h" |
68 #include "core/frame/Settings.h" | 68 #include "core/frame/Settings.h" |
| 69 #include "core/style/ContentData.h" |
| 70 #include "core/style/CounterContent.h" |
69 #include "core/style/ComputedStyle.h" | 71 #include "core/style/ComputedStyle.h" |
70 #include "core/style/ComputedStyleConstants.h" | 72 #include "core/style/ComputedStyleConstants.h" |
71 #include "core/style/ContentData.h" | |
72 #include "core/style/CounterContent.h" | |
73 #include "core/style/QuotesData.h" | 73 #include "core/style/QuotesData.h" |
74 #include "core/style/SVGComputedStyle.h" | 74 #include "core/style/SVGComputedStyle.h" |
75 #include "core/style/StyleGeneratedImage.h" | 75 #include "core/style/StyleGeneratedImage.h" |
76 #include "core/style/StyleVariableData.h" | 76 #include "core/style/StyleVariableData.h" |
77 #include "platform/fonts/FontDescription.h" | 77 #include "platform/fonts/FontDescription.h" |
78 #include "wtf/MathExtras.h" | 78 #include "wtf/MathExtras.h" |
79 #include "wtf/PtrUtil.h" | |
80 #include "wtf/StdLibExtras.h" | 79 #include "wtf/StdLibExtras.h" |
81 #include "wtf/Vector.h" | 80 #include "wtf/Vector.h" |
82 #include <memory> | |
83 | 81 |
84 namespace blink { | 82 namespace blink { |
85 | 83 |
86 namespace { | 84 namespace { |
87 | 85 |
88 static inline bool isValidVisitedLinkProperty(CSSPropertyID id) | 86 static inline bool isValidVisitedLinkProperty(CSSPropertyID id) |
89 { | 87 { |
90 switch (id) { | 88 switch (id) { |
91 case CSSPropertyBackgroundColor: | 89 case CSSPropertyBackgroundColor: |
92 case CSSPropertyBorderLeftColor: | 90 case CSSPropertyBorderLeftColor: |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 for (auto& item : toCSSValueList(value)) { | 700 for (auto& item : toCSSValueList(value)) { |
703 ContentData* nextContent = nullptr; | 701 ContentData* nextContent = nullptr; |
704 if (item->isImageGeneratorValue() || item->isImageSetValue() || item->is
ImageValue()) { | 702 if (item->isImageGeneratorValue() || item->isImageSetValue() || item->is
ImageValue()) { |
705 nextContent = ContentData::create(state.styleImage(CSSPropertyConten
t, *item)); | 703 nextContent = ContentData::create(state.styleImage(CSSPropertyConten
t, *item)); |
706 } else if (item->isCounterValue()) { | 704 } else if (item->isCounterValue()) { |
707 const CSSCounterValue* counterValue = toCSSCounterValue(item.get()); | 705 const CSSCounterValue* counterValue = toCSSCounterValue(item.get()); |
708 EListStyleType listStyleType = NoneListStyle; | 706 EListStyleType listStyleType = NoneListStyle; |
709 CSSValueID listStyleIdent = counterValue->listStyle(); | 707 CSSValueID listStyleIdent = counterValue->listStyle(); |
710 if (listStyleIdent != CSSValueNone) | 708 if (listStyleIdent != CSSValueNone) |
711 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS
ValueDisc); | 709 listStyleType = static_cast<EListStyleType>(listStyleIdent - CSS
ValueDisc); |
712 std::unique_ptr<CounterContent> counter = wrapUnique(new CounterCont
ent(AtomicString(counterValue->identifier()), listStyleType, AtomicString(counte
rValue->separator()))); | 710 OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicS
tring(counterValue->identifier()), listStyleType, AtomicString(counterValue->sep
arator()))); |
713 nextContent = ContentData::create(std::move(counter)); | 711 nextContent = ContentData::create(std::move(counter)); |
714 } else if (item->isPrimitiveValue()) { | 712 } else if (item->isPrimitiveValue()) { |
715 QuoteType quoteType; | 713 QuoteType quoteType; |
716 switch (toCSSPrimitiveValue(*item).getValueID()) { | 714 switch (toCSSPrimitiveValue(*item).getValueID()) { |
717 default: | 715 default: |
718 NOTREACHED(); | 716 NOTREACHED(); |
719 case CSSValueOpenQuote: | 717 case CSSValueOpenQuote: |
720 quoteType = OPEN_QUOTE; | 718 quoteType = OPEN_QUOTE; |
721 break; | 719 break; |
722 case CSSValueCloseQuote: | 720 case CSSValueCloseQuote: |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 } | 871 } |
874 } | 872 } |
875 | 873 |
876 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) | 874 void StyleBuilderFunctions::applyInheritCSSPropertyPosition(StyleResolverState&
state) |
877 { | 875 { |
878 if (!state.parentNode()->isDocumentNode()) | 876 if (!state.parentNode()->isDocumentNode()) |
879 state.style()->setPosition(state.parentStyle()->position()); | 877 state.style()->setPosition(state.parentStyle()->position()); |
880 } | 878 } |
881 | 879 |
882 } // namespace blink | 880 } // namespace blink |
OLD | NEW |