OLD | NEW |
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 StyleResolver* styleResolver() | 473 StyleResolver* styleResolver() |
474 { | 474 { |
475 if (!m_styleResolver) | 475 if (!m_styleResolver) |
476 createStyleResolver(); | 476 createStyleResolver(); |
477 return m_styleResolver.get(); | 477 return m_styleResolver.get(); |
478 } | 478 } |
479 | 479 |
480 /** | 480 /** |
481 * Updates the pending sheet count and then calls updateActiveStylesheets. | 481 * Updates the pending sheet count and then calls updateActiveStylesheets. |
482 */ | 482 */ |
483 void removePendingSheet(); | 483 enum RemovePendingSheetNotificationType { |
| 484 RemovePendingSheetNotifyImmediately, |
| 485 RemovePendingSheetNotifyLater |
| 486 }; |
| 487 |
| 488 void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSh
eetNotifyImmediately); |
| 489 void notifyRemovePendingSheetIfNeeded(); |
484 | 490 |
485 /** | 491 /** |
486 * This method returns true if all top-level stylesheets have loaded (includ
ing | 492 * This method returns true if all top-level stylesheets have loaded (includ
ing |
487 * any @imports that they may be loading). | 493 * any @imports that they may be loading). |
488 */ | 494 */ |
489 bool haveStylesheetsLoaded() const | 495 bool haveStylesheetsLoaded() const |
490 { | 496 { |
491 return m_pendingStylesheets <= 0 || m_ignorePendingStylesheets; | 497 return m_pendingStylesheets <= 0 || m_ignorePendingStylesheets; |
492 } | 498 } |
493 | 499 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 | 1225 |
1220 void createStyleResolver(); | 1226 void createStyleResolver(); |
1221 void clearStyleResolver(); | 1227 void clearStyleResolver(); |
1222 void combineCSSFeatureFlags(); | 1228 void combineCSSFeatureFlags(); |
1223 void resetCSSFeatureFlags(); | 1229 void resetCSSFeatureFlags(); |
1224 | 1230 |
1225 bool updateActiveStylesheets(StyleResolverUpdateFlag); | 1231 bool updateActiveStylesheets(StyleResolverUpdateFlag); |
1226 void collectActiveStylesheets(Vector<RefPtr<StyleSheet> >&); | 1232 void collectActiveStylesheets(Vector<RefPtr<StyleSheet> >&); |
1227 bool testAddedStylesheetRequiresStyleRecalc(StyleSheetContents*); | 1233 bool testAddedStylesheetRequiresStyleRecalc(StyleSheetContents*); |
1228 void analyzeStylesheetChange(StyleResolverUpdateFlag, const Vector<RefPtr<St
yleSheet> >& newStylesheets, bool& requiresStyleResolverReset, bool& requiresFul
lStyleRecalc); | 1234 void analyzeStylesheetChange(StyleResolverUpdateFlag, const Vector<RefPtr<St
yleSheet> >& newStylesheets, bool& requiresStyleResolverReset, bool& requiresFul
lStyleRecalc); |
| 1235 void didRemoveAllPendingStylesheet(); |
| 1236 void setNeedsNotifyRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPend
ingStylesheet = true; } |
1229 | 1237 |
1230 void seamlessParentUpdatedStylesheets(); | 1238 void seamlessParentUpdatedStylesheets(); |
1231 void notifySeamlessChildDocumentsOfStylesheetUpdate() const; | 1239 void notifySeamlessChildDocumentsOfStylesheetUpdate() const; |
1232 | 1240 |
1233 void deleteCustomFonts(); | 1241 void deleteCustomFonts(); |
1234 | 1242 |
1235 PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&
) const; | 1243 PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&
) const; |
1236 | 1244 |
1237 void loadEventDelayTimerFired(Timer<Document>*); | 1245 void loadEventDelayTimerFired(Timer<Document>*); |
1238 | 1246 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 OwnPtr<DOMImplementation> m_implementation; | 1302 OwnPtr<DOMImplementation> m_implementation; |
1295 | 1303 |
1296 // Track the number of currently loading top-level stylesheets needed for re
ndering. | 1304 // Track the number of currently loading top-level stylesheets needed for re
ndering. |
1297 // Sheets loaded using the @import directive are not included in this count. | 1305 // Sheets loaded using the @import directive are not included in this count. |
1298 // We use this count of pending sheets to detect when we can begin attaching | 1306 // We use this count of pending sheets to detect when we can begin attaching |
1299 // elements and when it is safe to execute scripts. | 1307 // elements and when it is safe to execute scripts. |
1300 int m_pendingStylesheets; | 1308 int m_pendingStylesheets; |
1301 | 1309 |
1302 // But sometimes you need to ignore pending stylesheet count to | 1310 // But sometimes you need to ignore pending stylesheet count to |
1303 // force an immediate layout when requested by JS. | 1311 // force an immediate layout when requested by JS. |
1304 bool m_ignorePendingStylesheets; | 1312 bool m_ignorePendingStylesheets : 1; |
| 1313 bool m_needsNotifyRemoveAllPendingStylesheet : 1; |
1305 | 1314 |
1306 // If we do ignore the pending stylesheet count, then we need to add a boole
an | 1315 // If we do ignore the pending stylesheet count, then we need to add a boole
an |
1307 // to track that this happened so that we can do a full repaint when the sty
lesheets | 1316 // to track that this happened so that we can do a full repaint when the sty
lesheets |
1308 // do eventually load. | 1317 // do eventually load. |
1309 PendingSheetLayout m_pendingSheetLayout; | 1318 PendingSheetLayout m_pendingSheetLayout; |
1310 | 1319 |
1311 bool m_hasNodesWithPlaceholderStyle; | 1320 bool m_hasNodesWithPlaceholderStyle; |
1312 | 1321 |
1313 RefPtr<CSSStyleSheet> m_elemSheet; | 1322 RefPtr<CSSStyleSheet> m_elemSheet; |
1314 RefPtr<CSSStyleSheet> m_pageUserSheet; | 1323 RefPtr<CSSStyleSheet> m_pageUserSheet; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 | 1557 |
1549 #if ENABLE(CSP_NEXT) | 1558 #if ENABLE(CSP_NEXT) |
1550 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy; | 1559 RefPtr<DOMSecurityPolicy> m_domSecurityPolicy; |
1551 #endif | 1560 #endif |
1552 | 1561 |
1553 #ifndef NDEBUG | 1562 #ifndef NDEBUG |
1554 bool m_didDispatchViewportPropertiesChanged; | 1563 bool m_didDispatchViewportPropertiesChanged; |
1555 #endif | 1564 #endif |
1556 }; | 1565 }; |
1557 | 1566 |
| 1567 inline void Document::notifyRemovePendingSheetIfNeeded() |
| 1568 { |
| 1569 if (m_needsNotifyRemoveAllPendingStylesheet) |
| 1570 didRemoveAllPendingStylesheet(); |
| 1571 } |
| 1572 |
1558 // Put these methods here, because they require the Document definition, but we
really want to inline them. | 1573 // Put these methods here, because they require the Document definition, but we
really want to inline them. |
1559 | 1574 |
1560 inline bool Node::isDocumentNode() const | 1575 inline bool Node::isDocumentNode() const |
1561 { | 1576 { |
1562 return this == m_document; | 1577 return this == m_document; |
1563 } | 1578 } |
1564 | 1579 |
1565 inline Node::Node(Document* document, ConstructionType type) | 1580 inline Node::Node(Document* document, ConstructionType type) |
1566 : m_nodeFlags(type) | 1581 : m_nodeFlags(type) |
1567 , m_document(document) | 1582 , m_document(document) |
1568 , m_previous(0) | 1583 , m_previous(0) |
1569 , m_next(0) | 1584 , m_next(0) |
1570 , m_renderer(0) | 1585 , m_renderer(0) |
1571 { | 1586 { |
1572 if (document) | 1587 if (document) |
1573 document->guardRef(); | 1588 document->guardRef(); |
1574 #if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS) | 1589 #if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS) |
1575 trackForDebugging(); | 1590 trackForDebugging(); |
1576 #endif | 1591 #endif |
1577 InspectorCounters::incrementCounter(InspectorCounters::NodeCounter); | 1592 InspectorCounters::incrementCounter(InspectorCounters::NodeCounter); |
1578 } | 1593 } |
1579 | 1594 |
1580 Node* eventTargetNodeForDocument(Document*); | 1595 Node* eventTargetNodeForDocument(Document*); |
1581 | 1596 |
1582 } // namespace WebCore | 1597 } // namespace WebCore |
1583 | 1598 |
1584 #endif // Document_h | 1599 #endif // Document_h |
OLD | NEW |