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

Side by Side Diff: Source/core/dom/Document.h

Issue 14604003: When there are no more stylesheets schedule the recalc async (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refactor based on review Created 7 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 | « no previous file | Source/core/dom/Document.cpp » ('j') | Source/core/dom/Document.cpp » ('J')
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, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 class FontLoader; 168 class FontLoader;
169 169
170 typedef int ExceptionCode; 170 typedef int ExceptionCode;
171 171
172 enum PageshowEventPersistence { 172 enum PageshowEventPersistence {
173 PageshowEventNotPersisted = 0, 173 PageshowEventNotPersisted = 0,
174 PageshowEventPersisted = 1 174 PageshowEventPersisted = 1
175 }; 175 };
176 176
177 enum StyleResolverUpdateFlag { RecalcStyleImmediately, DeferRecalcStyle, RecalcS tyleIfNeeded }; 177 enum StyleResolverUpdateType { RecalcStyleImmediately, DeferRecalcStyle };
178 enum StyleResolverUpdateMode { FullStyleUpdate, OptimizedStyleUpdate };
178 179
179 enum NodeListInvalidationType { 180 enum NodeListInvalidationType {
180 DoNotInvalidateOnAttributeChanges = 0, 181 DoNotInvalidateOnAttributeChanges = 0,
181 InvalidateOnClassAttrChange, 182 InvalidateOnClassAttrChange,
182 InvalidateOnIdNameAttrChange, 183 InvalidateOnIdNameAttrChange,
183 InvalidateOnNameAttrChange, 184 InvalidateOnNameAttrChange,
184 InvalidateOnForAttrChange, 185 InvalidateOnForAttrChange,
185 InvalidateForFormControls, 186 InvalidateForFormControls,
186 InvalidateOnHRefAttrChange, 187 InvalidateOnHRefAttrChange,
187 InvalidateOnItemAttrChange, 188 InvalidateOnItemAttrChange,
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 bool haveStylesheetsLoaded() const; 439 bool haveStylesheetsLoaded() const;
439 440
440 // This is a DOM function. 441 // This is a DOM function.
441 StyleSheetList* styleSheets(); 442 StyleSheetList* styleSheets();
442 443
443 DocumentStyleSheetCollection* styleSheetCollection() { return m_styleSheetCo llection.get(); } 444 DocumentStyleSheetCollection* styleSheetCollection() { return m_styleSheetCo llection.get(); }
444 445
445 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; } 446 bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfter StylesheetsLoad; }
446 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; } 447 void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAft erStylesheetsLoad = b; }
447 448
448 /** 449 // Called when one or more stylesheets in the document may have been added, removed or changed.
449 * Called when one or more stylesheets in the document may have been added, removed or changed. 450 void styleResolverChanged(StyleResolverUpdateType, StyleResolverUpdateMode = FullStyleUpdate);
450 *
451 * Creates a new style resolver and assign it to this document. This is done by iterating through all nodes in
452 * document (or those before <BODY> in a HTML document), searching for style sheets. Stylesheets can be contained in
453 * <LINK>, <STYLE> or <BODY> elements, as well as processing instructions (X ML documents only). A list is
454 * constructed from these which is used to create the a new style selector w hich collates all of the stylesheets
455 * found and is used to calculate the derived styles for all rendering objec ts.
456 */
457 void styleResolverChanged(StyleResolverUpdateFlag);
458 451
459 void didAccessStyleResolver(); 452 void didAccessStyleResolver();
460 453
461 void evaluateMediaQueryList(); 454 void evaluateMediaQueryList();
462 455
463 // Never returns 0. 456 // Never returns 0.
464 FormController* formController(); 457 FormController* formController();
465 Vector<String> formElementsState() const; 458 Vector<String> formElementsState() const;
466 void setStateForNewFormElements(const Vector<String>&); 459 void setStateForNewFormElements(const Vector<String>&);
467 460
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 trackForDebugging(); 1513 trackForDebugging();
1521 #endif 1514 #endif
1522 InspectorCounters::incrementCounter(InspectorCounters::NodeCounter); 1515 InspectorCounters::incrementCounter(InspectorCounters::NodeCounter);
1523 } 1516 }
1524 1517
1525 Node* eventTargetNodeForDocument(Document*); 1518 Node* eventTargetNodeForDocument(Document*);
1526 1519
1527 } // namespace WebCore 1520 } // namespace WebCore
1528 1521
1529 #endif // Document_h 1522 #endif // Document_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698