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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h

Issue 2420413005: Collect @viewport before constructing RuleSets. (Closed)
Patch Set: Rebased Created 4 years, 2 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Intel Corporation. All rights reserved. 2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 static ViewportStyleResolver* create(Document& document) { 48 static ViewportStyleResolver* create(Document& document) {
49 return new ViewportStyleResolver(document); 49 return new ViewportStyleResolver(document);
50 } 50 }
51 51
52 void initialViewportChanged(); 52 void initialViewportChanged();
53 void setNeedsCollectRules(); 53 void setNeedsCollectRules();
54 void updateViewport(DocumentStyleSheetCollection&); 54 void updateViewport(DocumentStyleSheetCollection&);
55 55
56 void collectViewportRulesFromAuthorSheet(const CSSStyleSheet&); 56 void collectViewportRulesFromAuthorSheet(const CSSStyleSheet&);
57 57
58 enum Origin { UserAgentOrigin, AuthorOrigin };
59
60 void collectViewportRules();
61 void collectViewportRules(RuleSet*, Origin);
62
63 DECLARE_TRACE(); 58 DECLARE_TRACE();
64 59
65 private: 60 private:
66 explicit ViewportStyleResolver(Document&); 61 explicit ViewportStyleResolver(Document&);
67 62
68 void reset(); 63 void reset();
69 void resolve(); 64 void resolve();
70 65
66 enum Origin { UserAgentOrigin, AuthorOrigin };
71 enum UpdateType { NoUpdate, Resolve, CollectRules }; 67 enum UpdateType { NoUpdate, Resolve, CollectRules };
72 68
73 void collectViewportRulesFromUASheets(); 69 void collectViewportRulesFromUASheets();
74 void collectViewportChildRules(const HeapVector<Member<StyleRuleBase>>&, 70 void collectViewportChildRules(const HeapVector<Member<StyleRuleBase>>&,
75 Origin); 71 Origin);
76 void collectViewportRulesFromImports(StyleSheetContents&); 72 void collectViewportRulesFromImports(StyleSheetContents&);
77 void collectViewportRulesFromAuthorSheetContents(StyleSheetContents&); 73 void collectViewportRulesFromAuthorSheetContents(StyleSheetContents&);
78 void addViewportRule(StyleRuleViewport&, Origin); 74 void addViewportRule(StyleRuleViewport&, Origin);
79 75
80 float viewportArgumentValue(CSSPropertyID) const; 76 float viewportArgumentValue(CSSPropertyID) const;
81 Length viewportLengthValue(CSSPropertyID); 77 Length viewportLengthValue(CSSPropertyID);
82 78
83 Member<Document> m_document; 79 Member<Document> m_document;
84 Member<MutableStylePropertySet> m_propertySet; 80 Member<MutableStylePropertySet> m_propertySet;
85 Member<MediaQueryEvaluator> m_initialViewportMedium; 81 Member<MediaQueryEvaluator> m_initialViewportMedium;
86 MediaQueryResultList m_viewportDependentMediaQueryResults; 82 MediaQueryResultList m_viewportDependentMediaQueryResults;
87 MediaQueryResultList m_deviceDependentMediaQueryResults; 83 MediaQueryResultList m_deviceDependentMediaQueryResults;
88 bool m_hasAuthorStyle = false; 84 bool m_hasAuthorStyle = false;
89 bool m_hasViewportUnits = false; 85 bool m_hasViewportUnits = false;
90 UpdateType m_needsUpdate = CollectRules; 86 UpdateType m_needsUpdate = CollectRules;
91 }; 87 };
92 88
93 } // namespace blink 89 } // namespace blink
94 90
95 #endif // ViewportStyleResolver_h 91 #endif // ViewportStyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698