Index: Source/core/dom/StyleEngine.h |
diff --git a/Source/core/dom/StyleEngine.h b/Source/core/dom/StyleEngine.h |
index dca65687e8cc25f9401a9695415110fbcf6a98d4..0901186e5669394ca40a6bb3137a28ad75b7d624 100644 |
--- a/Source/core/dom/StyleEngine.h |
+++ b/Source/core/dom/StyleEngine.h |
@@ -81,7 +81,7 @@ public: |
const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>>& documentAuthorStyleSheets() const { return m_authorStyleSheets; } |
- const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>> activeStyleSheetsForInspector() const; |
kochi
2015/05/26 01:52:34
Why unconst'ing is necessary here?
kojii
2015/05/26 05:21:58
Original code was using const_cast(), and this pat
|
+ const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>> activeStyleSheetsForInspector(); |
void modifiedStyleSheet(StyleSheet*); |
void addStyleSheetCandidateNode(Node*, bool createdByParser); |
@@ -190,7 +190,9 @@ private: |
StyleEngine(Document&); |
TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); |
+public: |
TreeScopeStyleSheetCollection* styleSheetCollectionFor(TreeScope&); |
kochi
2015/05/26 01:52:34
Please append this declaration to public: section
kojii
2015/05/26 05:21:58
Done.
|
+private: |
bool shouldUpdateDocumentStyleSheetCollection(StyleResolverUpdateMode) const; |
bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode) const; |
@@ -202,52 +204,6 @@ private: |
void scheduleInvalidationSetsForElement(const InvalidationSetVector&, Element&); |
- typedef WillBeHeapHashSet<RawPtrWillBeMember<TreeScope>> UnorderedTreeScopeSet; |
- |
- // A class which holds document-ordered treescopes which have stylesheets. |
- // ListHashSet allows only sequential access, not random access. |
- // So it gets slow when the size of treescopes gets larger when finding |
- // the best place to insert a treescope into the document-ordered |
- // treescopes (requires linear search). |
- // To solve this, use a vector for the document-ordered treescopes and |
- // use a hashset for quickly checking whether a given treescope is |
- // in the document-ordered treescopes or not. |
- class OrderedTreeScopeSet final { |
- DISALLOW_ALLOCATION(); |
- WTF_MAKE_NONCOPYABLE(OrderedTreeScopeSet); |
- public: |
- OrderedTreeScopeSet() { } |
- |
- void insert(TreeScope*); |
- void remove(TreeScope*); |
- |
- // When we don't need to consider document-order, use this iterator. |
- // Otherwise, use [] operator. |
- UnorderedTreeScopeSet::iterator beginUnordered() { return m_hash.begin(); } |
- UnorderedTreeScopeSet::iterator endUnordered() { return m_hash.end(); } |
- |
- bool isEmpty() const { return m_treeScopes.isEmpty(); } |
- void clear() |
- { |
- m_treeScopes.clear(); |
- m_hash.clear(); |
- } |
- |
- size_t size() const { return m_treeScopes.size(); } |
- |
- TreeScope* operator[](size_t i) { return m_treeScopes[i]; } |
- const TreeScope* operator[](size_t i) const { return m_treeScopes[i]; } |
- |
- DECLARE_TRACE(); |
- |
- private: |
- WillBeHeapVector<RawPtrWillBeMember<TreeScope>, 16> m_treeScopes; |
- UnorderedTreeScopeSet m_hash; |
- }; |
- |
- static void insertTreeScopeInDocumentOrder(OrderedTreeScopeSet&, TreeScope*); |
- void clearMediaQueryRuleSetOnTreeScopeStyleSheets(UnorderedTreeScopeSet::iterator begin, UnorderedTreeScopeSet::iterator end); |
- |
void createResolver(); |
static PassRefPtrWillBeRawPtr<CSSStyleSheet> parseSheet(Element*, const String& text, TextPosition startPosition, bool createdByParser); |
@@ -262,7 +218,7 @@ private: |
return m_documentStyleSheetCollection.get(); |
} |
- void updateActiveStyleSheetsInShadow(StyleResolverUpdateMode, TreeScope*, UnorderedTreeScopeSet& treeScopesRemoved); |
+ void updateActiveStyleSheetsInShadow(StyleResolverUpdateMode, TreeScope*, TreeScope::UnorderedTreeScopeSet& treeScopesRemoved); |
RawPtrWillBeMember<Document> m_document; |
bool m_isMaster; |
@@ -281,8 +237,7 @@ private: |
StyleSheetCollectionMap m_styleSheetCollectionMap; |
bool m_documentScopeDirty; |
- UnorderedTreeScopeSet m_dirtyTreeScopes; |
- OrderedTreeScopeSet m_activeTreeScopes; |
+ TreeScope::UnorderedTreeScopeSet m_dirtyTreeScopes; |
String m_preferredStylesheetSetName; |
String m_selectedStylesheetSetName; |