Changeset 118650 in webkit
- Timestamp:
- May 28, 2012, 12:11:20 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
css/MediaQuery.cpp (modified) (6 diffs)
-
css/MediaQuery.h (modified) (3 diffs)
-
css/MediaQueryEvaluator.cpp (modified) (6 diffs)
-
css/MediaQueryEvaluator.h (modified) (4 diffs)
-
css/StyleResolver.cpp (modified) (3 diffs)
-
css/StyleResolver.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r118648 r118650 1 2012-05-28 Darin Adler <darin@apple.com> 2 3 StyleResolver need not allocate each MediaQueryResult on the heap 4 https://bugs.webkit.org/show_bug.cgi?id=75223 5 6 Reviewed by Daniel Bates. 7 8 * css/MediaQuery.cpp: Removed some comments that pointed to CSS documents. 9 There is no guarantee these links will be valid over time. 10 (WebCore::MediaQuery::MediaQuery): Rewrote for clarity, conventional WebKit coding 11 style, and simplicity. 12 (WebCore::MediaQuery::copy): Moved out of line; not performance critical, and this 13 allows us to cut down header dependencies. 14 (WebCore::MediaQuery::cssText): Updated for change to data member name. 15 16 * css/MediaQuery.h: Removed unneeded includes. Removed non-helpful argument name 17 "exprs". Changed expressions function to return a reference instead of 18 a pointer. Changed mediaType and cssText functions to return a reference. Renamed 19 m_serializationCache to m_serializedQuery. Moved copy function out of header. 20 21 * css/MediaQueryEvaluator.cpp: Renamed EvalFunc to MediaFeatureEvaluationFunction. 22 Broke a FIXME into three and reworded for clarity. 23 (WebCore::MediaQueryEvaluator): Updated for name changes. 24 (WebCore::MediaQueryEvaluator::eval): Rewrote this for clarity and to regularize 25 the logic a bit. 26 (WebCore::aspect_ratioMediaFeatureEval): Got rid of a != 0 that is contrary to the 27 normal WebKit style. 28 (WebCore::device_aspect_ratioMediaFeatureEval): Ditto. 29 (WebCore::transform_3dMediaFeatureEval): Fixed mangled #if that was here. 30 (WebCore::view_modeMediaFeatureEval): Replaced UNUSED_PARAM usage with ASSERT_UNUSED. 31 (WebCore::createFunctionMap): Changed this so it returns the map so we can use a 32 cleaner style in the caller. 33 (WebCore::MediaQueryEvaluator::eval): Updated to take a reference and improved the 34 comments and coding style a bit. 35 36 * css/MediaQueryEvaluator.h: Updated comment style. Removed unused constructor. 37 Removed unneeded destructor declaration. Renamed m_expResult to m_mediaFeatureResult. 38 39 * css/StyleResolver.cpp: Moved the MediaQueryResult class into this file 40 and made it a structure rather than a class. 41 (WebCore::StyleResolver::addViewportDependentMediaQueryResult): Updated to take 42 a reference argument instead of a pointer and for the new vector type. 43 (WebCore::StyleResolver::affectedByViewportChange): Updated for above changes. 44 45 * css/StyleResolver.h: Removed many unneeded includes and forward declarations of 46 classes, including now-unneeded include of MediaQueryExp.h. Replaced MediaQueryResult 47 definition with a forward declaration. Changed addViewportDependentMediaQueryResult 48 to take a reference instead of a pointer. Changed m_viewportDependentMediaQueryResults 49 to be a vector of values rather than of pointers. 50 1 51 2012-05-27 Shinya Kawanaka <shinyak@chromium.org> 2 52 -
trunk/Source/WebCore/css/MediaQuery.cpp
r115115 r118650 36 36 namespace WebCore { 37 37 38 // http://dev.w3.org/csswg/cssom/#serialize-a-media-query39 38 String MediaQuery::serialize() const 40 39 { … … 67 66 result.append(m_expressions->at(i)->serialize()); 68 67 } 68 69 69 return result.toString(); 70 70 } … … 75 75 } 76 76 77 78 MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > exprs) 79 : m_restrictor(r) 77 MediaQuery::MediaQuery(Restrictor restrictor, const String& mediaType, PassOwnPtr<ExpressionVector> expressions) 78 : m_restrictor(restrictor) 80 79 , m_mediaType(mediaType.lower()) 81 , m_expressions(expr s)80 , m_expressions(expressions) 82 81 , m_ignored(false) 83 82 { 84 83 if (!m_expressions) { 85 m_expressions = adoptPtr(new Vector<OwnPtr<MediaQueryExp> >);84 m_expressions = adoptPtr(new ExpressionVector); 86 85 return; 87 86 } 88 87 89 nonCopyingSort(m_expressions->begin(), m_expressions->end(), expressionCompare);88 ExpressionVector& vector = *m_expressions; 90 89 91 // remove all duplicated expressions 92 String key; 93 for (int i = m_expressions->size() - 1; i >= 0; --i) { 90 nonCopyingSort(vector.begin(), vector.end(), expressionCompare); 94 91 95 // if not all of the expressions is valid the media query must be ignored.96 if (!m_ignored)97 m_ignored = !m_expressions->at(i)->isValid();92 String previousSerializedExpression; 93 for (size_t i = vector.size(); i; ) { 94 --i; 98 95 99 if (m_expressions->at(i)->serialize() == key) 100 m_expressions->remove(i); 101 else 102 key = m_expressions->at(i)->serialize(); 96 // If any expression is invalid, the entire media query must be ignored. 97 m_ignored = m_ignored || !vector[i]->isValid(); 98 99 // Remove duplicate expressions. 100 String serializedExpression = vector[i]->serialize(); 101 if (serializedExpression == previousSerializedExpression) 102 vector.remove(i); 103 previousSerializedExpression = serializedExpression; 103 104 } 104 105 } … … 109 110 , m_expressions(adoptPtr(new Vector<OwnPtr<MediaQueryExp> >(o.m_expressions->size()))) 110 111 , m_ignored(o.m_ignored) 111 , m_serializ ationCache(o.m_serializationCache)112 , m_serializedQuery(o.m_serializedQuery) 112 113 { 113 114 for (unsigned i = 0; i < m_expressions->size(); ++i) 114 115 (*m_expressions)[i] = o.m_expressions->at(i)->copy(); 116 } 117 118 PassOwnPtr<MediaQuery> MediaQuery::copy() const 119 { 120 return adoptPtr(new MediaQuery(*this)); 115 121 } 116 122 … … 119 125 } 120 126 121 // http://dev.w3.org/csswg/cssom/#compare-media-queries122 127 bool MediaQuery::operator==(const MediaQuery& other) const 123 128 { … … 125 130 } 126 131 127 // http://dev.w3.org/csswg/cssom/#serialize-a-list-of-media-queries 128 String MediaQuery::cssText() const 132 const String& MediaQuery::cssText() const 129 133 { 130 if (m_serializationCache.isNull()) 131 const_cast<MediaQuery*>(this)->m_serializationCache = serialize(); 132 133 return m_serializationCache; 134 if (m_serializedQuery.isNull()) 135 const_cast<MediaQuery*>(this)->m_serializedQuery = serialize(); 136 return m_serializedQuery; 134 137 } 135 138 136 } // namespace139 } // namespace WebCore -
trunk/Source/WebCore/css/MediaQuery.h
r115115 r118650 31 31 32 32 #include "PlatformString.h" 33 #include <wtf/PassOwnPtr.h>34 #include <wtf/Vector.h>35 #include <wtf/text/StringHash.h>36 33 37 34 namespace WebCore { 35 38 36 class MediaQueryExp; 39 37 … … 41 39 WTF_MAKE_FAST_ALLOCATED; 42 40 public: 43 enum Restrictor { 44 Only, Not, None 45 }; 41 enum Restrictor { Only, Not, None }; 46 42 47 43 typedef Vector<OwnPtr<MediaQueryExp> > ExpressionVector; 48 44 49 MediaQuery(Restrictor, const String& mediaType, PassOwnPtr<ExpressionVector> exprs);45 MediaQuery(Restrictor, const String& mediaType, PassOwnPtr<ExpressionVector>); 50 46 ~MediaQuery(); 51 47 48 bool operator==(const MediaQuery&) const; 49 52 50 Restrictor restrictor() const { return m_restrictor; } 53 const Vector<OwnPtr<MediaQueryExp> >* expressions() const { return m_expressions.get(); } 54 String mediaType() const { return m_mediaType; } 55 bool operator==(const MediaQuery& other) const; 56 String cssText() const; 51 const ExpressionVector& expressions() const { return *m_expressions; } 52 const String& mediaType() const { return m_mediaType; } 53 const String& cssText() const; 57 54 bool ignored() const { return m_ignored; } 58 55 59 PassOwnPtr<MediaQuery> copy() const { return adoptPtr(new MediaQuery(*this)); }56 PassOwnPtr<MediaQuery> copy() const; 60 57 61 private:58 private: 62 59 MediaQuery(const MediaQuery&); 60 void operator=(const MediaQuery&); 61 62 String serialize() const; 63 63 64 64 Restrictor m_restrictor; … … 66 66 OwnPtr<ExpressionVector> m_expressions; 67 67 bool m_ignored; 68 String m_serializationCache; 69 70 String serialize() const; 68 String m_serializedQuery; 71 69 }; 72 70 -
trunk/Source/WebCore/css/MediaQueryEvaluator.cpp
r115215 r118650 59 59 enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix }; 60 60 61 typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix); 62 typedef HashMap<AtomicStringImpl*, EvalFunc> FunctionMap; 63 static FunctionMap* gFunctionMap; 64 65 /* 66 * FIXME: following media features are not implemented: color_index, scan, resolution 67 * 68 * color_index, min-color-index, max_color_index: It's unknown how to retrieve 69 * the information if the display mode is indexed 70 * scan: The "scan" media feature describes the scanning process of 71 * tv output devices. It's unknown how to retrieve this information from 72 * the platform 73 * resolution, min-resolution, max-resolution: css parser doesn't seem to 74 * support CSS_DIMENSION 75 */ 76 77 MediaQueryEvaluator::MediaQueryEvaluator(bool mediaFeatureResult) 78 : m_frame(0) 79 , m_style(0) 80 , m_expResult(mediaFeatureResult) 81 { 82 } 83 84 MediaQueryEvaluator:: MediaQueryEvaluator(const String& acceptedMediaType, bool mediaFeatureResult) 61 typedef bool (*MediaFeatureEvaluationFunction)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix); 62 typedef HashMap<AtomicStringImpl*, MediaFeatureEvaluationFunction> FunctionMap; 63 64 // FIXME: color-index, min-color-index, and max-color-index are not implemented. 65 // To implement them we'd have to add information about indexed color to the WebCore platform; 66 // most modern platforms don't make use of indexed color, so it's not clear this is worthwhile. 67 68 // FIXME: scan is not implemented: This media feature describes the scanning process of 69 // TV output devices. To implement this we'd have to add information to the WebCore platform. 70 71 // FIXME: resolution, min-resolution, max-resolution are not implemented: At the time this 72 // was originally written the author said the CSS parser "didn't seem to support CSS_DIMENSION". 73 74 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, bool mediaFeatureResult) 85 75 : m_mediaType(acceptedMediaType) 86 76 , m_frame(0) 87 77 , m_style(0) 88 , m_ expResult(mediaFeatureResult)89 { 90 } 91 92 MediaQueryEvaluator:: MediaQueryEvaluator(const char* acceptedMediaType, bool mediaFeatureResult)78 , m_mediaFeatureResult(mediaFeatureResult) 79 { 80 } 81 82 MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType, bool mediaFeatureResult) 93 83 : m_mediaType(acceptedMediaType) 94 84 , m_frame(0) 95 85 , m_style(0) 96 , m_ expResult(mediaFeatureResult)97 { 98 } 99 100 MediaQueryEvaluator:: MediaQueryEvaluator(const String& acceptedMediaType, Frame* frame, RenderStyle* style)86 , m_mediaFeatureResult(mediaFeatureResult) 87 { 88 } 89 90 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, Frame* frame, RenderStyle* style) 101 91 : m_mediaType(acceptedMediaType) 102 92 , m_frame(frame) 103 93 , m_style(style) 104 , m_ expResult(false) // doesn't matter when we have m_frame and m_style94 , m_mediaFeatureResult(false) // Ignored if both m_frame and m_style are non-null. 105 95 { 106 96 } … … 137 127 138 128 const Vector<OwnPtr<MediaQuery> >& queries = querySet->queryVector(); 139 if (!queries.size()) 140 return true; // empty query list evaluates to true 141 142 // iterate over queries, stop if any of them eval to true (OR semantics) 143 bool result = false; 144 for (size_t i = 0; i < queries.size() && !result; ++i) { 145 MediaQuery* query = queries[i].get(); 146 147 if (query->ignored()) 129 130 bool result = true; 131 132 // Iterate over queries and stop if any of them eval to true ("or" semantics). 133 for (size_t i = 0; i < queries.size(); ++i) { 134 const MediaQuery& query = *queries[i]; 135 136 result = false; 137 138 if (query.ignored()) 148 139 continue; 149 140 150 if (mediaTypeMatch(query ->mediaType())) {151 const Vector<OwnPtr<MediaQueryExp> > * exps = query->expressions();141 if (mediaTypeMatch(query.mediaType())) { 142 const Vector<OwnPtr<MediaQueryExp> >& expressions = query.expressions(); 152 143 // iterate through expressions, stop if any of them eval to false 153 144 // (AND semantics) 154 145 size_t j = 0; 155 for (; j < exp s->size(); ++j) {156 bool exprResult = eval(exps->at(j).get());157 if (styleResolver && exp s->at(j)->isViewportDependent())158 styleResolver->addViewportDependentMediaQueryResult( exps->at(j).get(), exprResult);159 if (! exprResult)146 for (; j < expressions.size(); ++j) { 147 result = eval(*expressions[j]); 148 if (styleResolver && expressions[j]->isViewportDependent()) 149 styleResolver->addViewportDependentMediaQueryResult(*expressions[j], result); 150 if (!result) 160 151 break; 161 152 } 162 163 // assume true if we are at the end of the list, 164 // otherwise assume false 165 result = applyRestrictor(query->restrictor(), exps->size() == j); 166 } else 167 result = applyRestrictor(query->restrictor(), false); 153 } 154 155 result = applyRestrictor(query.restrictor(), result); 156 if (result) 157 break; 168 158 } 169 159 … … 264 254 int v = 0; 265 255 if (parseAspectRatio(value, h, v)) 266 return v != 0&& compareValue(width * v, height * h, op);256 return v && compareValue(width * v, height * h, op); 267 257 return false; 268 258 } … … 280 270 int v = 0; 281 271 if (parseAspectRatio(value, h, v)) 282 return v != 0&& compareValue(static_cast<int>(sg.width()) * v, static_cast<int>(sg.height()) * h, op);272 return v && compareValue(static_cast<int>(sg.width()) * v, static_cast<int>(sg.height()) * h, op); 283 273 return false; 284 274 } … … 504 494 static bool transform_3dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op) 505 495 { 506 bool returnValueIfNoParameter;507 int have3dRendering;508 509 #if ENABLE(3D_RENDERING)510 496 bool threeDEnabled = false; 511 #if USE(ACCELERATED_COMPOSITING)497 #if ENABLE(3D_RENDERING) && USE(ACCELERATED_COMPOSITING) 512 498 if (RenderView* view = frame->contentRenderer()) 513 499 threeDEnabled = view->compositor()->canRender3DTransforms(); 514 #endif515 516 returnValueIfNoParameter = threeDEnabled;517 have3dRendering = threeDEnabled ? 1 : 0;518 500 #else 519 501 UNUSED_PARAM(frame); 520 returnValueIfNoParameter = false;521 have3dRendering = 0;522 502 #endif 523 524 503 if (value) { 525 504 float number; 526 return numberValue(value, number) && compareValue( have3dRendering, static_cast<int>(number), op);527 } 528 return returnValueIfNoParameter;505 return numberValue(value, number) && compareValue(static_cast<int>(threeDEnabled), static_cast<int>(number), op); 506 } 507 return threeDEnabled; 529 508 } 530 509 531 510 static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op) 532 511 { 533 UNUSED_PARAM(op);512 ASSERT_UNUSED(op, op == NoPrefix); 534 513 if (!value) 535 514 return true; … … 537 516 } 538 517 539 static void createFunctionMap() 540 { 541 // Create the table. 542 gFunctionMap = new FunctionMap; 518 static FunctionMap* createFunctionMap() 519 { 520 FunctionMap* functionMap = new FunctionMap; 543 521 #define ADD_TO_FUNCTIONMAP(name, str) \ 544 gFunctionMap->set(name##MediaFeature.impl(), name##MediaFeatureEval);522 functionMap->set(name##MediaFeature.impl(), name##MediaFeatureEval); 545 523 CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(ADD_TO_FUNCTIONMAP); 546 524 #undef ADD_TO_FUNCTIONMAP 547 } 548 549 bool MediaQueryEvaluator::eval(const MediaQueryExp* expr) const 525 return functionMap; 526 } 527 528 bool MediaQueryEvaluator::eval(const MediaQueryExp& expression) const 550 529 { 551 530 if (!m_frame || !m_style) 552 return m_ expResult;553 554 if (!expr ->isValid())531 return m_mediaFeatureResult; 532 533 if (!expression.isValid()) 555 534 return false; 556 535 557 if (!gFunctionMap) 558 createFunctionMap(); 559 560 // call the media feature evaluation function. Assume no prefix 561 // and let trampoline functions override the prefix if prefix is 562 // used 563 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 564 if (func) 565 return func(expr->value(), m_style.get(), m_frame, NoPrefix); 566 567 return false; 536 static FunctionMap* functionMap = createFunctionMap(); 537 MediaFeatureEvaluationFunction function = functionMap->get(expression.mediaFeature().impl()); 538 539 // Start with no prefix: Some trampoline functions add the prefix and call other media feature functions. 540 return function && function(expression.value(), m_style.get(), m_frame, NoPrefix); 568 541 } 569 542 -
trunk/Source/WebCore/css/MediaQueryEvaluator.h
r115097 r118650 32 32 33 33 namespace WebCore { 34 34 35 class Frame; 35 36 class MediaQueryExp; … … 38 39 class StyleResolver; 39 40 40 /** 41 * Class that evaluates css media queries as defined in 42 * CSS3 Module "Media Queries" (http://www.w3.org/TR/css3-mediaqueries/) 43 * Special constructors are needed, if simple media queries are to be 44 * evaluated without knowledge of the medium features. This can happen 45 * for example when parsing UA stylesheets, if evaluation is done 46 * right after parsing. 47 * 48 * the boolean parameter is used to approximate results of evaluation, if 49 * the device characteristics are not known. This can be used to prune the loading 50 * of stylesheets to only those which are probable to match. 51 */ 41 // Class that evaluates CSS media queries as defined in CSS3 Module "Media Queries". 42 // 43 // Special constructors are supplied so that simple media queries can be 44 // evaluated without knowledge of device characteristics. This is used, for example, 45 // when parsing user agent stylesheets. The boolean parameter to the constructor is used 46 // if the device characteristics are not known. This can be used to prune loading 47 // of stylesheets to remove those that definitely won't match. 48 52 49 class MediaQueryEvaluator { 53 50 WTF_MAKE_NONCOPYABLE(MediaQueryEvaluator); WTF_MAKE_FAST_ALLOCATED; 54 51 public: 55 /** Creates evaluator which evaluates only simple media queries 56 * Evaluator returns true for "all", and returns value of \mediaFeatureResult 57 * for any media features 58 */ 59 MediaQueryEvaluator(bool mediaFeatureResult = false); 60 61 /** Creates evaluator which evaluates only simple media queries 62 * Evaluator returns true for acceptedMediaType and returns value of \mediafeatureResult 63 * for any media features 64 */ 52 // Creates evaluator which evaluates only simple media queries. 53 // Evaluator returns true for acceptedMediaType and uses mediaFeatureResult for any media features. 65 54 MediaQueryEvaluator(const String& acceptedMediaType, bool mediaFeatureResult = false); 66 55 MediaQueryEvaluator(const char* acceptedMediaType, bool mediaFeatureResult = false); 67 56 68 /** Creates evaluator which evaluates full media queries 69 */ 57 // Creates evaluator which evaluates full media queries. 70 58 MediaQueryEvaluator(const String& acceptedMediaType, Frame*, RenderStyle*); 71 59 … … 75 63 bool mediaTypeMatchSpecific(const char* mediaTypeToMatch) const; 76 64 77 / ** Evaluates a list of media queries */65 // Evaluates a list of media queries. 78 66 bool eval(const MediaQuerySet*, StyleResolver* = 0) const; 79 67 80 / ** Evaluates media query subexpression, ie "and (media-feature: value)" part */81 bool eval(const MediaQueryExp *) const;68 // Evaluates media query subexpression, i.e. "and (media-feature: value)" part. 69 bool eval(const MediaQueryExp&) const; 82 70 83 71 private: … … 85 73 Frame* m_frame; // not owned 86 74 RefPtr<RenderStyle> m_style; 87 bool m_ expResult;75 bool m_mediaFeatureResult; 88 76 }; 89 77 90 } // namespace 78 } // namespace WebCore 79 91 80 #endif -
trunk/Source/WebCore/css/StyleResolver.cpp
r118583 r118650 78 78 #include "MediaList.h" 79 79 #include "MediaQueryEvaluator.h" 80 #include "MediaQueryExp.h" 80 81 #include "NodeRenderStyle.h" 81 82 #include "Page.h" … … 160 161 161 162 using namespace HTMLNames; 163 164 struct MediaQueryResult { 165 MediaQueryResult(const MediaQueryExp& expression, bool result) 166 : expression(expression) 167 , result(result) 168 { 169 } 170 171 MediaQueryExp expression; 172 bool result; 173 }; 162 174 163 175 #define HANDLE_INHERIT(prop, Prop) \ … … 5129 5141 } 5130 5142 5131 void StyleResolver::addViewportDependentMediaQueryResult(const MediaQueryExp * expr, bool result)5132 { 5133 m_viewportDependentMediaQueryResults.append( adoptPtr(new MediaQueryResult(*expr, result)));5143 void StyleResolver::addViewportDependentMediaQueryResult(const MediaQueryExp& expression, bool result) 5144 { 5145 m_viewportDependentMediaQueryResults.append(MediaQueryResult(expression, result)); 5134 5146 } 5135 5147 5136 5148 bool StyleResolver::affectedByViewportChange() const 5137 5149 { 5138 unsigned s = m_viewportDependentMediaQueryResults.size();5139 for (unsigned i = 0; i < s ; i++) {5140 if (m_medium->eval( &m_viewportDependentMediaQueryResults[i]->m_expression) != m_viewportDependentMediaQueryResults[i]->m_result)5150 unsigned size = m_viewportDependentMediaQueryResults.size(); 5151 for (unsigned i = 0; i < size; i++) { 5152 if (m_medium->eval(m_viewportDependentMediaQueryResults[i].expression) != m_viewportDependentMediaQueryResults[i].result) 5141 5153 return true; 5142 5154 } -
trunk/Source/WebCore/css/StyleResolver.h
r118460 r118650 23 23 #define StyleResolver_h 24 24 25 #include "CSSRule.h"26 #include "CSSValueList.h"27 25 #include "LinkHash.h" 28 #include "MediaQueryExp.h"29 26 #include "RenderStyle.h" 30 27 #include "SelectorChecker.h" 31 #include <wtf/HashMap.h>32 #include <wtf/HashSet.h>33 #include <wtf/RefPtr.h>34 #include <wtf/Vector.h>35 #include <wtf/text/StringHash.h>36 28 37 29 namespace WebCore { 38 30 39 enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize };40 41 31 class CSSFontSelector; 42 class CSSPageRule;43 class CSSPrimitiveValue;44 class CSSProperty;45 class CSSRuleList;46 class CSSFontFace;47 class CSSFontFaceRule;48 32 class CSSImageGeneratorValue; 49 33 class CSSImageSetValue; 50 34 class CSSImageValue; 51 class CSS Selector;35 class CSSRuleList; 52 36 class CSSStyleRule; 53 37 class CSSStyleSheet; 54 class CSSValue;55 38 class ContainerNode; 56 39 class CustomFilterOperation; … … 58 41 class Document; 59 42 class Element; 60 class Frame;61 class FrameView;62 class KURL;63 43 class KeyframeList; 64 44 class KeyframeValue; 65 45 class MediaQueryEvaluator; 46 class MediaQueryExp; 66 47 class Node; 67 48 class RenderRegion; 68 49 class RuleData; 69 50 class RuleSet; 70 class Settings;71 51 class StaticCSSRuleList; 72 52 class StyleBuilder; … … 78 58 class StyleRuleKeyframes; 79 59 class StyleRulePage; 80 class StyleRuleRegion;81 60 class StyleShader; 82 class StyleSheet;83 61 class StyleSheetContents; 84 class StyleSheetList;85 62 class StyledElement; 86 63 class WebKitCSSFilterValue; 87 64 class WebKitCSSShaderValue; 88 65 66 struct MediaQueryResult; 67 68 enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize }; 69 89 70 #if ENABLE(CSS_SHADERS) 90 71 typedef Vector<RefPtr<CustomFilterParameter> > CustomFilterParameterList; 91 72 #endif 92 93 class MediaQueryResult {94 WTF_MAKE_NONCOPYABLE(MediaQueryResult); WTF_MAKE_FAST_ALLOCATED;95 public:96 MediaQueryResult(const MediaQueryExp& expr, bool result)97 : m_expression(expr)98 , m_result(result)99 {100 }101 102 MediaQueryExp m_expression;103 bool m_result;104 };105 73 106 74 enum StyleSharingBehavior { … … 226 194 CSSFontSelector* fontSelector() const { return m_fontSelector.get(); } 227 195 228 void addViewportDependentMediaQueryResult(const MediaQueryExp *, bool result);196 void addViewportDependentMediaQueryResult(const MediaQueryExp&, bool result); 229 197 230 198 bool affectedByViewportChange() const; … … 497 465 498 466 RefPtr<CSSFontSelector> m_fontSelector; 499 Vector< OwnPtr<MediaQueryResult>> m_viewportDependentMediaQueryResults;467 Vector<MediaQueryResult> m_viewportDependentMediaQueryResults; 500 468 501 469 bool m_applyPropertyToRegularStyle;
Note:
See TracChangeset
for help on using the changeset viewer.