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, 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 m_usesBeforeAfterRulesOverride = false; | 546 m_usesBeforeAfterRulesOverride = false; |
547 m_usesRemUnits = false; | 547 m_usesRemUnits = false; |
548 m_usesLinkRules = false; | 548 m_usesLinkRules = false; |
549 | 549 |
550 m_gotoAnchorNeededAfterStylesheetsLoad = false; | 550 m_gotoAnchorNeededAfterStylesheetsLoad = false; |
551 | 551 |
552 m_didCalculateStyleResolver = false; | 552 m_didCalculateStyleResolver = false; |
553 m_hasDirtyStyleResolver = false; | 553 m_hasDirtyStyleResolver = false; |
554 m_pendingStylesheets = 0; | 554 m_pendingStylesheets = 0; |
555 m_ignorePendingStylesheets = false; | 555 m_ignorePendingStylesheets = false; |
| 556 m_needsNotifyRemoveAllPendingStylesheet = false; |
556 m_hasNodesWithPlaceholderStyle = false; | 557 m_hasNodesWithPlaceholderStyle = false; |
557 m_pendingSheetLayout = NoLayoutWithPendingSheets; | 558 m_pendingSheetLayout = NoLayoutWithPendingSheets; |
558 | 559 |
559 m_cssTarget = 0; | 560 m_cssTarget = 0; |
560 | 561 |
561 resetLinkColor(); | 562 resetLinkColor(); |
562 resetVisitedLinkColor(); | 563 resetVisitedLinkColor(); |
563 resetActiveLinkColor(); | 564 resetActiveLinkColor(); |
564 | 565 |
565 m_processingLoadEvent = false; | 566 m_processingLoadEvent = false; |
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 return m_selectedStylesheetSet; | 3307 return m_selectedStylesheetSet; |
3307 } | 3308 } |
3308 | 3309 |
3309 void Document::setSelectedStylesheetSet(const String& aString) | 3310 void Document::setSelectedStylesheetSet(const String& aString) |
3310 { | 3311 { |
3311 m_selectedStylesheetSet = aString; | 3312 m_selectedStylesheetSet = aString; |
3312 styleResolverChanged(DeferRecalcStyle); | 3313 styleResolverChanged(DeferRecalcStyle); |
3313 } | 3314 } |
3314 | 3315 |
3315 // This method is called whenever a top-level stylesheet has finished loading. | 3316 // This method is called whenever a top-level stylesheet has finished loading. |
3316 void Document::removePendingSheet() | 3317 void Document::removePendingSheet(RemovePendingSheetNotificationType notificatio
n) |
3317 { | 3318 { |
3318 // Make sure we knew this sheet was pending, and that our count isn't out of
sync. | 3319 // Make sure we knew this sheet was pending, and that our count isn't out of
sync. |
3319 ASSERT(m_pendingStylesheets > 0); | 3320 ASSERT(m_pendingStylesheets > 0); |
3320 | 3321 |
3321 m_pendingStylesheets--; | 3322 m_pendingStylesheets--; |
3322 | 3323 |
3323 #ifdef INSTRUMENT_LAYOUT_SCHEDULING | 3324 #ifdef INSTRUMENT_LAYOUT_SCHEDULING |
3324 if (!ownerElement()) | 3325 if (!ownerElement()) |
3325 printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", e
lapsedTime(), m_pendingStylesheets); | 3326 printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", e
lapsedTime(), m_pendingStylesheets); |
3326 #endif | 3327 #endif |
3327 | 3328 |
3328 if (m_pendingStylesheets) | 3329 if (m_pendingStylesheets) |
3329 return; | 3330 return; |
3330 | 3331 |
| 3332 if (notification == RemovePendingSheetNotifyLater) { |
| 3333 setNeedsNotifyRemoveAllPendingStylesheet(); |
| 3334 return; |
| 3335 } |
| 3336 |
| 3337 didRemoveAllPendingStylesheet(); |
| 3338 } |
| 3339 |
| 3340 void Document::didRemoveAllPendingStylesheet() |
| 3341 { |
| 3342 m_needsNotifyRemoveAllPendingStylesheet = false; |
| 3343 |
3331 styleResolverChanged(RecalcStyleIfNeeded); | 3344 styleResolverChanged(RecalcStyleIfNeeded); |
3332 | 3345 |
3333 if (ScriptableDocumentParser* parser = scriptableDocumentParser()) | 3346 if (ScriptableDocumentParser* parser = scriptableDocumentParser()) |
3334 parser->executeScriptsWaitingForStylesheets(); | 3347 parser->executeScriptsWaitingForStylesheets(); |
3335 | 3348 |
3336 if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) | 3349 if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) |
3337 view()->scrollToFragment(m_url); | 3350 view()->scrollToFragment(m_url); |
3338 } | 3351 } |
3339 | 3352 |
| 3353 |
3340 void Document::evaluateMediaQueryList() | 3354 void Document::evaluateMediaQueryList() |
3341 { | 3355 { |
3342 if (m_mediaQueryMatcher) | 3356 if (m_mediaQueryMatcher) |
3343 m_mediaQueryMatcher->styleResolverChanged(); | 3357 m_mediaQueryMatcher->styleResolverChanged(); |
3344 } | 3358 } |
3345 | 3359 |
3346 void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag) | 3360 void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag) |
3347 { | 3361 { |
3348 // Don't bother updating, since we haven't loaded all our style info yet | 3362 // Don't bother updating, since we haven't loaded all our style info yet |
3349 // and haven't calculated the style selector for the first time. | 3363 // and haven't calculated the style selector for the first time. |
(...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6138 #if ENABLE(UNDO_MANAGER) | 6152 #if ENABLE(UNDO_MANAGER) |
6139 PassRefPtr<UndoManager> Document::undoManager() | 6153 PassRefPtr<UndoManager> Document::undoManager() |
6140 { | 6154 { |
6141 if (!m_undoManager) | 6155 if (!m_undoManager) |
6142 m_undoManager = UndoManager::create(this); | 6156 m_undoManager = UndoManager::create(this); |
6143 return m_undoManager; | 6157 return m_undoManager; |
6144 } | 6158 } |
6145 #endif | 6159 #endif |
6146 | 6160 |
6147 } // namespace WebCore | 6161 } // namespace WebCore |
OLD | NEW |