Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: sky/engine/core/css/CSSComputedStyleDeclaration.cpp

Issue 709213002: Remove ContentData. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/css/CSSProperties.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "core/css/CSSTransformValue.h" 46 #include "core/css/CSSTransformValue.h"
47 #include "core/css/CSSValueList.h" 47 #include "core/css/CSSValueList.h"
48 #include "core/css/CSSValuePool.h" 48 #include "core/css/CSSValuePool.h"
49 #include "core/css/Pair.h" 49 #include "core/css/Pair.h"
50 #include "core/css/Rect.h" 50 #include "core/css/Rect.h"
51 #include "core/css/StylePropertySet.h" 51 #include "core/css/StylePropertySet.h"
52 #include "core/css/resolver/StyleResolver.h" 52 #include "core/css/resolver/StyleResolver.h"
53 #include "core/dom/Document.h" 53 #include "core/dom/Document.h"
54 #include "core/dom/ExceptionCode.h" 54 #include "core/dom/ExceptionCode.h"
55 #include "core/rendering/RenderBox.h" 55 #include "core/rendering/RenderBox.h"
56 #include "core/rendering/style/ContentData.h"
57 #include "core/rendering/style/RenderStyle.h" 56 #include "core/rendering/style/RenderStyle.h"
58 #include "core/rendering/style/ShadowList.h" 57 #include "core/rendering/style/ShadowList.h"
59 #include "core/rendering/style/ShapeValue.h" 58 #include "core/rendering/style/ShapeValue.h"
60 #include "platform/FontFamilyNames.h" 59 #include "platform/FontFamilyNames.h"
61 #include "platform/RuntimeEnabledFeatures.h" 60 #include "platform/RuntimeEnabledFeatures.h"
62 #include "platform/fonts/FontFeatureSettings.h" 61 #include "platform/fonts/FontFeatureSettings.h"
63 #include "wtf/text/StringBuilder.h" 62 #include "wtf/text/StringBuilder.h"
64 63
65 namespace blink { 64 namespace blink {
66 65
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 1123
1125 if (fillSize.size.height().isAuto()) 1124 if (fillSize.size.height().isAuto())
1126 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style); 1125 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style);
1127 1126
1128 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1127 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1129 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style)); 1128 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style));
1130 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style)) ; 1129 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style)) ;
1131 return list.release(); 1130 return list.release();
1132 } 1131 }
1133 1132
1134 static PassRefPtr<CSSValue> valueForContentData(const RenderStyle& style)
1135 {
1136 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1137 for (const ContentData* contentData = style.contentData(); contentData; cont entData = contentData->next()) {
1138 if (contentData->isImage()) {
1139 const StyleImage* image = toImageContentData(contentData)->image();
1140 ASSERT(image);
1141 list->append(image->cssValue());
1142 } else if (contentData->isText()) {
1143 list->append(cssValuePool().createValue(toTextContentData(contentDat a)->text(), CSSPrimitiveValue::CSS_STRING));
1144 }
1145 }
1146 return list.release();
1147 }
1148
1149 static void logUnimplementedPropertyID(CSSPropertyID propertyID) 1133 static void logUnimplementedPropertyID(CSSPropertyID propertyID)
1150 { 1134 {
1151 DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ()); 1135 DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ());
1152 if (!propertyIDSet.add(propertyID).isNewEntry) 1136 if (!propertyIDSet.add(propertyID).isNewEntry)
1153 return; 1137 return;
1154 1138
1155 WTF_LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", ge tPropertyName(propertyID)); 1139 WTF_LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", ge tPropertyName(propertyID));
1156 } 1140 }
1157 1141
1158 static PassRefPtr<CSSValueList> valueForFontFamily(RenderStyle& style) 1142 static PassRefPtr<CSSValueList> valueForFontFamily(RenderStyle& style)
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 list->append(createTimingFunctionValue(CSSTransitionData::initialTim ingFunction().get())); 2159 list->append(createTimingFunctionValue(CSSTransitionData::initialTim ingFunction().get()));
2176 list->append(cssValuePool().createValue(CSSTransitionData::initialDe lay(), CSSPrimitiveValue::CSS_S)); 2160 list->append(cssValuePool().createValue(CSSTransitionData::initialDe lay(), CSSPrimitiveValue::CSS_S));
2177 return list.release(); 2161 return list.release();
2178 } 2162 }
2179 case CSSPropertyPointerEvents: 2163 case CSSPropertyPointerEvents:
2180 return cssValuePool().createValue(style->pointerEvents()); 2164 return cssValuePool().createValue(style->pointerEvents());
2181 case CSSPropertyWebkitTextOrientation: 2165 case CSSPropertyWebkitTextOrientation:
2182 return CSSPrimitiveValue::create(style->textOrientation()); 2166 return CSSPrimitiveValue::create(style->textOrientation());
2183 case CSSPropertyWebkitLineBoxContain: 2167 case CSSPropertyWebkitLineBoxContain:
2184 return createLineBoxContainValue(style->lineBoxContain()); 2168 return createLineBoxContainValue(style->lineBoxContain());
2185 case CSSPropertyContent:
2186 return valueForContentData(*style);
2187 case CSSPropertyWebkitClipPath: 2169 case CSSPropertyWebkitClipPath:
2188 if (ClipPathOperation* operation = style->clipPath()) { 2170 if (ClipPathOperation* operation = style->clipPath()) {
2189 if (operation->type() == ClipPathOperation::SHAPE) 2171 if (operation->type() == ClipPathOperation::SHAPE)
2190 return valueForBasicShape(*style, toShapeClipPathOperation(o peration)->basicShape()); 2172 return valueForBasicShape(*style, toShapeClipPathOperation(o peration)->basicShape());
2191 } 2173 }
2192 return cssValuePool().createIdentifierValue(CSSValueNone); 2174 return cssValuePool().createIdentifierValue(CSSValueNone);
2193 case CSSPropertyWebkitFilter: 2175 case CSSPropertyWebkitFilter:
2194 return valueForFilter(renderer, *style); 2176 return valueForFilter(renderer, *style);
2195 case CSSPropertyMixBlendMode: 2177 case CSSPropertyMixBlendMode:
2196 return cssValuePool().createValue(style->blendMode()); 2178 return cssValuePool().createValue(style->blendMode());
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 return list.release(); 2484 return list.release();
2503 } 2485 }
2504 2486
2505 void CSSComputedStyleDeclaration::trace(Visitor* visitor) 2487 void CSSComputedStyleDeclaration::trace(Visitor* visitor)
2506 { 2488 {
2507 visitor->trace(m_node); 2489 visitor->trace(m_node);
2508 CSSStyleDeclaration::trace(visitor); 2490 CSSStyleDeclaration::trace(visitor);
2509 } 2491 }
2510 2492
2511 } // namespace blink 2493 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698