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 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3131 m_styleEngine->setSelectedStylesheetSetName(aString); | 3131 m_styleEngine->setSelectedStylesheetSetName(aString); |
3132 styleResolverChanged(RecalcStyleDeferred); | 3132 styleResolverChanged(RecalcStyleDeferred); |
3133 } | 3133 } |
3134 | 3134 |
3135 void Document::evaluateMediaQueryList() | 3135 void Document::evaluateMediaQueryList() |
3136 { | 3136 { |
3137 if (m_mediaQueryMatcher) | 3137 if (m_mediaQueryMatcher) |
3138 m_mediaQueryMatcher->styleResolverChanged(); | 3138 m_mediaQueryMatcher->styleResolverChanged(); |
3139 } | 3139 } |
3140 | 3140 |
3141 void Document::styleResolverChanged(StyleResolverUpdateType updateType, StyleRes
olverUpdateMode updateMode) | 3141 void Document::styleResolverChanged(RecalcStyleTime updateTime, StyleResolverUpd
ateMode updateMode) |
3142 { | 3142 { |
3143 // Don't bother updating, since we haven't loaded all our style info yet | 3143 // Don't bother updating, since we haven't loaded all our style info yet |
3144 // and haven't calculated the style selector for the first time. | 3144 // and haven't calculated the style selector for the first time. |
3145 if (!isActive() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded()
)) { | 3145 if (!isActive() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded()
)) { |
3146 m_styleResolver.clear(); | 3146 m_styleResolver.clear(); |
3147 return; | 3147 return; |
3148 } | 3148 } |
3149 m_didCalculateStyleResolver = true; | 3149 m_didCalculateStyleResolver = true; |
3150 | 3150 |
3151 bool needsRecalc = m_styleEngine->updateActiveStyleSheets(updateMode); | 3151 bool needsRecalc = m_styleEngine->updateActiveStyleSheets(updateMode); |
3152 | 3152 |
3153 if (didLayoutWithPendingStylesheets() && !m_styleEngine->hasPendingSheets())
{ | 3153 if (didLayoutWithPendingStylesheets() && !m_styleEngine->hasPendingSheets())
{ |
3154 // We need to manually repaint because we avoid doing all repaints in la
yout or style | 3154 // We need to manually repaint because we avoid doing all repaints in la
yout or style |
3155 // recalc while sheets are still loading to avoid FOUC. | 3155 // recalc while sheets are still loading to avoid FOUC. |
3156 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; | 3156 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; |
3157 renderView()->repaintViewAndCompositedLayers(); | 3157 renderView()->repaintViewAndCompositedLayers(); |
3158 } | 3158 } |
3159 | 3159 |
3160 if (!needsRecalc) | 3160 if (!needsRecalc) |
3161 return; | 3161 return; |
3162 | 3162 |
3163 m_evaluateMediaQueriesOnStyleRecalc = true; | 3163 m_evaluateMediaQueriesOnStyleRecalc = true; |
3164 setNeedsStyleRecalc(); | 3164 setNeedsStyleRecalc(); |
3165 | 3165 |
3166 if (updateType == RecalcStyleImmediately) | 3166 if (updateTime == RecalcStyleImmediately) |
3167 updateStyleIfNeeded(); | 3167 updateStyleIfNeeded(); |
3168 } | 3168 } |
3169 | 3169 |
3170 void Document::notifySeamlessChildDocumentsOfStylesheetUpdate() const | 3170 void Document::notifySeamlessChildDocumentsOfStylesheetUpdate() const |
3171 { | 3171 { |
3172 // If we're not in a frame yet any potential child documents won't have a St
yleResolver to update. | 3172 // If we're not in a frame yet any potential child documents won't have a St
yleResolver to update. |
3173 if (!frame()) | 3173 if (!frame()) |
3174 return; | 3174 return; |
3175 | 3175 |
3176 // Seamless child frames are expected to notify their seamless children recu
rsively, so we only do direct children. | 3176 // Seamless child frames are expected to notify their seamless children recu
rsively, so we only do direct children. |
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5284 { | 5284 { |
5285 return DocumentLifecycleNotifier::create(this); | 5285 return DocumentLifecycleNotifier::create(this); |
5286 } | 5286 } |
5287 | 5287 |
5288 DocumentLifecycleNotifier* Document::lifecycleNotifier() | 5288 DocumentLifecycleNotifier* Document::lifecycleNotifier() |
5289 { | 5289 { |
5290 return static_cast<DocumentLifecycleNotifier*>(ExecutionContext::lifecycleNo
tifier()); | 5290 return static_cast<DocumentLifecycleNotifier*>(ExecutionContext::lifecycleNo
tifier()); |
5291 } | 5291 } |
5292 | 5292 |
5293 } // namespace WebCore | 5293 } // namespace WebCore |
OLD | NEW |