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

Side by Side Diff: Source/core/dom/StyleEngine.cpp

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 StyleEngine::StyleEngine(Document& document) 54 StyleEngine::StyleEngine(Document& document)
55 : m_document(&document) 55 : m_document(&document)
56 , m_isMaster(!document.importsController() || document.importsController()-> master() == &document) 56 , m_isMaster(!document.importsController() || document.importsController()-> master() == &document)
57 , m_pendingStylesheets(0) 57 , m_pendingStylesheets(0)
58 , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(docume nt)) 58 , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(docume nt))
59 , m_documentScopeDirty(true) 59 , m_documentScopeDirty(true)
60 , m_usesSiblingRules(false) 60 , m_usesSiblingRules(false)
61 , m_usesFirstLineRules(false) 61 , m_usesFirstLineRules(false)
62 , m_usesWindowInactiveSelector(false) 62 , m_usesWindowInactiveSelector(false)
63 , m_usesRemUnits(false) 63 , m_usesRemUnits(false)
64 , m_usesVariables(false)
64 , m_maxDirectAdjacentSelectors(0) 65 , m_maxDirectAdjacentSelectors(0)
65 , m_ignorePendingStylesheets(false) 66 , m_ignorePendingStylesheets(false)
66 , m_didCalculateResolver(false) 67 , m_didCalculateResolver(false)
67 // We don't need to create CSSFontSelector for imported document or 68 // We don't need to create CSSFontSelector for imported document or
68 // HTMLTemplateElement's document, because those documents have no frame. 69 // HTMLTemplateElement's document, because those documents have no frame.
69 , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nul lptr) 70 , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nul lptr)
70 { 71 {
71 if (m_fontSelector) 72 if (m_fontSelector)
72 m_fontSelector->registerForInvalidationCallbacks(this); 73 m_fontSelector->registerForInvalidationCallbacks(this);
73 } 74 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 for (UnorderedTreeScopeSet::iterator it = m_dirtyTreeScopes.begin(); it != m_dirtyTreeScopes.end(); ++it) { 392 for (UnorderedTreeScopeSet::iterator it = m_dirtyTreeScopes.begin(); it != m_dirtyTreeScopes.end(); ++it) {
392 updateActiveStyleSheetsInShadow(updateMode, *it, treeScopesRemov ed); 393 updateActiveStyleSheetsInShadow(updateMode, *it, treeScopesRemov ed);
393 } 394 }
394 } 395 }
395 for (UnorderedTreeScopeSet::iterator it = treeScopesRemoved.begin(); it != treeScopesRemoved.end(); ++it) 396 for (UnorderedTreeScopeSet::iterator it = treeScopesRemoved.begin(); it != treeScopesRemoved.end(); ++it)
396 m_activeTreeScopes.remove(*it); 397 m_activeTreeScopes.remove(*it);
397 } 398 }
398 399
399 InspectorInstrumentation::activeStyleSheetsUpdated(m_document); 400 InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
400 m_usesRemUnits = documentStyleSheetCollection()->usesRemUnits(); 401 m_usesRemUnits = documentStyleSheetCollection()->usesRemUnits();
402 m_usesVariables = documentStyleSheetCollection()->usesVariables();
401 403
402 m_dirtyTreeScopes.clear(); 404 m_dirtyTreeScopes.clear();
403 m_documentScopeDirty = false; 405 m_documentScopeDirty = false;
404 } 406 }
405 407
406 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>> StyleEngine::activeSty leSheetsForInspector() const 408 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet>> StyleEngine::activeSty leSheetsForInspector() const
407 { 409 {
408 if (m_activeTreeScopes.isEmpty()) 410 if (m_activeTreeScopes.isEmpty())
409 return documentStyleSheetCollection()->activeAuthorStyleSheets(); 411 return documentStyleSheetCollection()->activeAuthorStyleSheets();
410 412
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 visitor->trace(m_dirtyTreeScopes); 783 visitor->trace(m_dirtyTreeScopes);
782 visitor->trace(m_activeTreeScopes); 784 visitor->trace(m_activeTreeScopes);
783 visitor->trace(m_fontSelector); 785 visitor->trace(m_fontSelector);
784 visitor->trace(m_textToSheetCache); 786 visitor->trace(m_textToSheetCache);
785 visitor->trace(m_sheetToTextCache); 787 visitor->trace(m_sheetToTextCache);
786 #endif 788 #endif
787 CSSFontSelectorClient::trace(visitor); 789 CSSFontSelectorClient::trace(visitor);
788 } 790 }
789 791
790 } 792 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698