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

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

Issue 296743003: Removed RecalcStyleTime. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 7 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
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/frame/FrameView.cpp » ('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) 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 groupSheet->contents()->parseString(entry->source()); 222 groupSheet->contents()->parseString(entry->source());
223 } 223 }
224 } 224 }
225 225
226 void StyleEngine::invalidateInjectedStyleSheetCache() 226 void StyleEngine::invalidateInjectedStyleSheetCache()
227 { 227 {
228 m_injectedStyleSheetCacheValid = false; 228 m_injectedStyleSheetCacheValid = false;
229 markDocumentDirty(); 229 markDocumentDirty();
230 // FIXME: updateInjectedStyleSheetCache is called inside StyleSheetCollectio n::updateActiveStyleSheets 230 // FIXME: updateInjectedStyleSheetCache is called inside StyleSheetCollectio n::updateActiveStyleSheets
231 // and batch updates lots of sheets so we can't call addedStyleSheet() or re movedStyleSheet(). 231 // and batch updates lots of sheets so we can't call addedStyleSheet() or re movedStyleSheet().
232 document().styleResolverChanged(RecalcStyleDeferred); 232 document().styleResolverChanged();
233 } 233 }
234 234
235 void StyleEngine::addAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> auth orSheet) 235 void StyleEngine::addAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> auth orSheet)
236 { 236 {
237 m_authorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_document)); 237 m_authorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_document));
238 document().addedStyleSheet(m_authorStyleSheets.last().get(), RecalcStyleDefe rred); 238 document().addedStyleSheet(m_authorStyleSheets.last().get());
239 markDocumentDirty(); 239 markDocumentDirty();
240 } 240 }
241 241
242 void StyleEngine::addPendingSheet() 242 void StyleEngine::addPendingSheet()
243 { 243 {
244 m_pendingStylesheets++; 244 m_pendingStylesheets++;
245 } 245 }
246 246
247 // This method is called whenever a top-level stylesheet has finished loading. 247 // This method is called whenever a top-level stylesheet has finished loading.
248 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) 248 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode)
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void StyleEngine::didDetach() 486 void StyleEngine::didDetach()
487 { 487 {
488 clearResolver(); 488 clearResolver();
489 } 489 }
490 490
491 bool StyleEngine::shouldClearResolver() const 491 bool StyleEngine::shouldClearResolver() const
492 { 492 {
493 return !m_didCalculateResolver && !haveStylesheetsLoaded(); 493 return !m_didCalculateResolver && !haveStylesheetsLoaded();
494 } 494 }
495 495
496 StyleResolverChange StyleEngine::resolverChanged(RecalcStyleTime time, StyleReso lverUpdateMode mode) 496 StyleResolverChange StyleEngine::resolverChanged(StyleResolverUpdateMode mode)
497 { 497 {
498 StyleResolverChange change; 498 StyleResolverChange change;
499 499
500 if (!isMaster()) { 500 if (!isMaster()) {
501 if (Document* master = this->master()) 501 if (Document* master = this->master())
502 master->styleResolverChanged(time, mode); 502 master->styleResolverChanged(mode);
503 return change; 503 return change;
504 } 504 }
505 505
506 // Don't bother updating, since we haven't loaded all our style info yet 506 // Don't bother updating, since we haven't loaded all our style info yet
507 // and haven't calculated the style selector for the first time. 507 // and haven't calculated the style selector for the first time.
508 if (!document().isActive() || shouldClearResolver()) { 508 if (!document().isActive() || shouldClearResolver()) {
509 clearResolver(); 509 clearResolver();
510 return change; 510 return change;
511 } 511 }
512 512
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 visitor->trace(m_authorStyleSheets); 641 visitor->trace(m_authorStyleSheets);
642 visitor->trace(m_documentStyleSheetCollection); 642 visitor->trace(m_documentStyleSheetCollection);
643 visitor->trace(m_styleSheetCollectionMap); 643 visitor->trace(m_styleSheetCollectionMap);
644 visitor->trace(m_resolver); 644 visitor->trace(m_resolver);
645 visitor->trace(m_fontSelector); 645 visitor->trace(m_fontSelector);
646 visitor->trace(m_textToSheetCache); 646 visitor->trace(m_textToSheetCache);
647 visitor->trace(m_sheetToTextCache); 647 visitor->trace(m_sheetToTextCache);
648 } 648 }
649 649
650 } 650 }
OLDNEW
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698