| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 #include "core/dom/PageTransitionEvent.h" | 87 #include "core/dom/PageTransitionEvent.h" |
| 88 #include "core/dom/PopStateEvent.h" | 88 #include "core/dom/PopStateEvent.h" |
| 89 #include "core/dom/PostAttachCallbacks.h" | 89 #include "core/dom/PostAttachCallbacks.h" |
| 90 #include "core/dom/ProcessingInstruction.h" | 90 #include "core/dom/ProcessingInstruction.h" |
| 91 #include "core/dom/QualifiedName.h" | 91 #include "core/dom/QualifiedName.h" |
| 92 #include "core/dom/RequestAnimationFrameCallback.h" | 92 #include "core/dom/RequestAnimationFrameCallback.h" |
| 93 #include "core/dom/ScopedEventQueue.h" | 93 #include "core/dom/ScopedEventQueue.h" |
| 94 #include "core/dom/ScriptRunner.h" | 94 #include "core/dom/ScriptRunner.h" |
| 95 #include "core/dom/ScriptedAnimationController.h" | 95 #include "core/dom/ScriptedAnimationController.h" |
| 96 #include "core/dom/SelectorQuery.h" | 96 #include "core/dom/SelectorQuery.h" |
| 97 #include "core/dom/StyleSheetCollections.h" | 97 #include "core/dom/StyleEngine.h" |
| 98 #include "core/dom/TouchList.h" | 98 #include "core/dom/TouchList.h" |
| 99 #include "core/dom/TransformSource.h" | 99 #include "core/dom/TransformSource.h" |
| 100 #include "core/dom/TreeWalker.h" | 100 #include "core/dom/TreeWalker.h" |
| 101 #include "core/dom/UserActionElementSet.h" | 101 #include "core/dom/UserActionElementSet.h" |
| 102 #include "core/dom/VisitedLinkState.h" | 102 #include "core/dom/VisitedLinkState.h" |
| 103 #include "core/dom/shadow/ElementShadow.h" | 103 #include "core/dom/shadow/ElementShadow.h" |
| 104 #include "core/dom/shadow/ShadowRoot.h" | 104 #include "core/dom/shadow/ShadowRoot.h" |
| 105 #include "core/editing/Editor.h" | 105 #include "core/editing/Editor.h" |
| 106 #include "core/editing/FrameSelection.h" | 106 #include "core/editing/FrameSelection.h" |
| 107 #include "core/fetch/ResourceFetcher.h" | 107 #include "core/fetch/ResourceFetcher.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 , m_wellFormed(false) | 397 , m_wellFormed(false) |
| 398 , m_printing(false) | 398 , m_printing(false) |
| 399 , m_paginatedForScreen(false) | 399 , m_paginatedForScreen(false) |
| 400 , m_ignoreAutofocus(false) | 400 , m_ignoreAutofocus(false) |
| 401 , m_compatibilityMode(NoQuirksMode) | 401 , m_compatibilityMode(NoQuirksMode) |
| 402 , m_compatibilityModeLocked(false) | 402 , m_compatibilityModeLocked(false) |
| 403 , m_didPostCheckFocusedElementTask(false) | 403 , m_didPostCheckFocusedElementTask(false) |
| 404 , m_domTreeVersion(++s_globalTreeVersion) | 404 , m_domTreeVersion(++s_globalTreeVersion) |
| 405 , m_listenerTypes(0) | 405 , m_listenerTypes(0) |
| 406 , m_mutationObserverTypes(0) | 406 , m_mutationObserverTypes(0) |
| 407 , m_styleSheetCollections(StyleSheetCollections::create(*this)) | 407 , m_StyleEngine(StyleEngine::create(*this)) |
| 408 , m_visitedLinkState(VisitedLinkState::create(this)) | 408 , m_visitedLinkState(VisitedLinkState::create(this)) |
| 409 , m_visuallyOrdered(false) | 409 , m_visuallyOrdered(false) |
| 410 , m_readyState(Complete) | 410 , m_readyState(Complete) |
| 411 , m_bParsing(false) | 411 , m_bParsing(false) |
| 412 , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) | 412 , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) |
| 413 , m_inStyleRecalc(false) | 413 , m_inStyleRecalc(false) |
| 414 , m_gotoAnchorNeededAfterStylesheetsLoad(false) | 414 , m_gotoAnchorNeededAfterStylesheetsLoad(false) |
| 415 , m_containsValidityStyleRules(false) | 415 , m_containsValidityStyleRules(false) |
| 416 , m_updateFocusAppearanceRestoresSelection(false) | 416 , m_updateFocusAppearanceRestoresSelection(false) |
| 417 , m_ignoreDestructiveWriteCount(0) | 417 , m_ignoreDestructiveWriteCount(0) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 setDecoder(PassRefPtr<TextResourceDecoder>()); | 536 setDecoder(PassRefPtr<TextResourceDecoder>()); |
| 537 | 537 |
| 538 if (m_styleSheetList) | 538 if (m_styleSheetList) |
| 539 m_styleSheetList->detachFromDocument(); | 539 m_styleSheetList->detachFromDocument(); |
| 540 | 540 |
| 541 if (m_import) { | 541 if (m_import) { |
| 542 m_import->wasDetachedFromDocument(); | 542 m_import->wasDetachedFromDocument(); |
| 543 m_import = 0; | 543 m_import = 0; |
| 544 } | 544 } |
| 545 | 545 |
| 546 m_styleSheetCollections.clear(); | 546 m_StyleEngine.clear(); |
| 547 | 547 |
| 548 if (m_elemSheet) | 548 if (m_elemSheet) |
| 549 m_elemSheet->clearOwnerNode(); | 549 m_elemSheet->clearOwnerNode(); |
| 550 | 550 |
| 551 clearStyleResolver(); // We need to destory CSSFontSelector before destroyin
g m_fetcher. | 551 clearStyleResolver(); // We need to destory CSSFontSelector before destroyin
g m_fetcher. |
| 552 | 552 |
| 553 // It's possible for multiple Documents to end up referencing the same Resou
rceFetcher (e.g., SVGImages | 553 // It's possible for multiple Documents to end up referencing the same Resou
rceFetcher (e.g., SVGImages |
| 554 // load the initial empty document and the SVGDocument with the same Documen
tLoader). | 554 // load the initial empty document and the SVGDocument with the same Documen
tLoader). |
| 555 if (m_fetcher->document() == this) | 555 if (m_fetcher->document() == this) |
| 556 m_fetcher->setDocument(0); | 556 m_fetcher->setDocument(0); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 void Document::setCompatibilityMode(CompatibilityMode mode) | 634 void Document::setCompatibilityMode(CompatibilityMode mode) |
| 635 { | 635 { |
| 636 if (m_compatibilityModeLocked || mode == m_compatibilityMode) | 636 if (m_compatibilityModeLocked || mode == m_compatibilityMode) |
| 637 return; | 637 return; |
| 638 bool wasInQuirksMode = inQuirksMode(); | 638 bool wasInQuirksMode = inQuirksMode(); |
| 639 m_compatibilityMode = mode; | 639 m_compatibilityMode = mode; |
| 640 selectorQueryCache()->invalidate(); | 640 selectorQueryCache()->invalidate(); |
| 641 if (inQuirksMode() != wasInQuirksMode) { | 641 if (inQuirksMode() != wasInQuirksMode) { |
| 642 // All user stylesheets have to reparse using the different mode. | 642 // All user stylesheets have to reparse using the different mode. |
| 643 m_styleSheetCollections->clearPageUserSheet(); | 643 m_StyleEngine->clearPageUserSheet(); |
| 644 m_styleSheetCollections->invalidateInjectedStyleSheetCache(); | 644 m_StyleEngine->invalidateInjectedStyleSheetCache(); |
| 645 } | 645 } |
| 646 } | 646 } |
| 647 | 647 |
| 648 String Document::compatMode() const | 648 String Document::compatMode() const |
| 649 { | 649 { |
| 650 return inQuirksMode() ? "BackCompat" : "CSS1Compat"; | 650 return inQuirksMode() ? "BackCompat" : "CSS1Compat"; |
| 651 } | 651 } |
| 652 | 652 |
| 653 void Document::setDoctype(PassRefPtr<DocumentType> docType) | 653 void Document::setDoctype(PassRefPtr<DocumentType> docType) |
| 654 { | 654 { |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 | 1683 |
| 1684 updateDistributionIfNeeded(); | 1684 updateDistributionIfNeeded(); |
| 1685 | 1685 |
| 1686 // FIXME: We should update style on our ancestor chain before proceeding (es
pecially for seamless), | 1686 // FIXME: We should update style on our ancestor chain before proceeding (es
pecially for seamless), |
| 1687 // however doing so currently causes several tests to crash, as Frame::setDo
cument calls Document::attach | 1687 // however doing so currently causes several tests to crash, as Frame::setDo
cument calls Document::attach |
| 1688 // before setting the DOMWindow on the Frame, or the SecurityOrigin on the d
ocument. The attach, in turn | 1688 // before setting the DOMWindow on the Frame, or the SecurityOrigin on the d
ocument. The attach, in turn |
| 1689 // resolves style (here) and then when we resolve style on the parent chain,
we may end up | 1689 // resolves style (here) and then when we resolve style on the parent chain,
we may end up |
| 1690 // re-attaching our containing iframe, which when asked HTMLFrameElementBase
::isURLAllowed | 1690 // re-attaching our containing iframe, which when asked HTMLFrameElementBase
::isURLAllowed |
| 1691 // hits a null-dereference due to security code always assuming the document
has a SecurityOrigin. | 1691 // hits a null-dereference due to security code always assuming the document
has a SecurityOrigin. |
| 1692 | 1692 |
| 1693 if (m_styleSheetCollections->needsUpdateActiveStylesheetsOnStyleRecalc()) | 1693 if (m_StyleEngine->needsUpdateActiveStylesheetsOnStyleRecalc()) |
| 1694 m_styleSheetCollections->updateActiveStyleSheets(FullStyleUpdate); | 1694 m_StyleEngine->updateActiveStyleSheets(FullStyleUpdate); |
| 1695 | 1695 |
| 1696 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalc
ulateStyle(this); | 1696 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRecalc
ulateStyle(this); |
| 1697 | 1697 |
| 1698 if (m_elemSheet && m_elemSheet->contents()->usesRemUnits()) | 1698 if (m_elemSheet && m_elemSheet->contents()->usesRemUnits()) |
| 1699 m_styleSheetCollections->setUsesRemUnit(true); | 1699 m_StyleEngine->setUsesRemUnit(true); |
| 1700 | 1700 |
| 1701 m_inStyleRecalc = true; | 1701 m_inStyleRecalc = true; |
| 1702 { | 1702 { |
| 1703 PostAttachCallbacks::SuspendScope suspendPostAttachCallbacks; | 1703 PostAttachCallbacks::SuspendScope suspendPostAttachCallbacks; |
| 1704 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; | 1704 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; |
| 1705 | 1705 |
| 1706 RefPtr<FrameView> frameView = view(); | 1706 RefPtr<FrameView> frameView = view(); |
| 1707 if (frameView) { | 1707 if (frameView) { |
| 1708 frameView->pauseScheduledEvents(); | 1708 frameView->pauseScheduledEvents(); |
| 1709 frameView->beginDeferredRepaints(); | 1709 frameView->beginDeferredRepaints(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1735 | 1735 |
| 1736 if (view()) | 1736 if (view()) |
| 1737 view()->updateCompositingLayersAfterStyleChange(); | 1737 view()->updateCompositingLayersAfterStyleChange(); |
| 1738 | 1738 |
| 1739 bailOut: | 1739 bailOut: |
| 1740 clearNeedsStyleRecalc(); | 1740 clearNeedsStyleRecalc(); |
| 1741 clearChildNeedsStyleRecalc(); | 1741 clearChildNeedsStyleRecalc(); |
| 1742 unscheduleStyleRecalc(); | 1742 unscheduleStyleRecalc(); |
| 1743 | 1743 |
| 1744 // FIXME: SVG <use> element can schedule a recalc in the middle of an al
ready running one. | 1744 // FIXME: SVG <use> element can schedule a recalc in the middle of an al
ready running one. |
| 1745 // See StyleSheetCollections::updateActiveStyleSheets. | 1745 // See StyleEngine::updateActiveStyleSheets. |
| 1746 if (m_styleSheetCollections->needsUpdateActiveStylesheetsOnStyleRecalc()
) | 1746 if (m_StyleEngine->needsUpdateActiveStylesheetsOnStyleRecalc()) |
| 1747 setNeedsStyleRecalc(); | 1747 setNeedsStyleRecalc(); |
| 1748 | 1748 |
| 1749 m_inStyleRecalc = false; | 1749 m_inStyleRecalc = false; |
| 1750 | 1750 |
| 1751 // Pseudo element removal and similar may only work with these flags sti
ll set. Reset them after the style recalc. | 1751 // Pseudo element removal and similar may only work with these flags sti
ll set. Reset them after the style recalc. |
| 1752 if (m_styleResolver) { | 1752 if (m_styleResolver) { |
| 1753 m_styleSheetCollections->resetCSSFeatureFlags(m_styleResolver->ruleF
eatureSet()); | 1753 m_StyleEngine->resetCSSFeatureFlags(m_styleResolver->ruleFeatureSet(
)); |
| 1754 m_styleResolver->clearStyleSharingList(); | 1754 m_styleResolver->clearStyleSharingList(); |
| 1755 } | 1755 } |
| 1756 | 1756 |
| 1757 if (frameView) { | 1757 if (frameView) { |
| 1758 frameView->resumeScheduledEvents(); | 1758 frameView->resumeScheduledEvents(); |
| 1759 frameView->endDeferredRepaints(); | 1759 frameView->endDeferredRepaints(); |
| 1760 } | 1760 } |
| 1761 } | 1761 } |
| 1762 | 1762 |
| 1763 STYLE_STATS_PRINT(); | 1763 STYLE_STATS_PRINT(); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 setSecurityOrigin(SecurityOrigin::createUnique()); | 1965 setSecurityOrigin(SecurityOrigin::createUnique()); |
| 1966 didUpdateSecurityOrigin(); | 1966 didUpdateSecurityOrigin(); |
| 1967 } | 1967 } |
| 1968 | 1968 |
| 1969 void Document::createStyleResolver() | 1969 void Document::createStyleResolver() |
| 1970 { | 1970 { |
| 1971 bool matchAuthorAndUserStyles = true; | 1971 bool matchAuthorAndUserStyles = true; |
| 1972 if (Settings* docSettings = settings()) | 1972 if (Settings* docSettings = settings()) |
| 1973 matchAuthorAndUserStyles = docSettings->authorAndUserStylesEnabled(); | 1973 matchAuthorAndUserStyles = docSettings->authorAndUserStylesEnabled(); |
| 1974 m_styleResolver = adoptPtr(new StyleResolver(*this, matchAuthorAndUserStyles
)); | 1974 m_styleResolver = adoptPtr(new StyleResolver(*this, matchAuthorAndUserStyles
)); |
| 1975 m_styleSheetCollections->combineCSSFeatureFlags(m_styleResolver->ruleFeature
Set()); | 1975 m_StyleEngine->combineCSSFeatureFlags(m_styleResolver->ruleFeatureSet()); |
| 1976 } | 1976 } |
| 1977 | 1977 |
| 1978 void Document::clearStyleResolver() | 1978 void Document::clearStyleResolver() |
| 1979 { | 1979 { |
| 1980 m_styleResolver.clear(); | 1980 m_styleResolver.clear(); |
| 1981 } | 1981 } |
| 1982 | 1982 |
| 1983 void Document::attach(const AttachContext& context) | 1983 void Document::attach(const AttachContext& context) |
| 1984 { | 1984 { |
| 1985 ASSERT(!attached()); | 1985 ASSERT(!attached()); |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2806 return currentFrame; | 2806 return currentFrame; |
| 2807 currentFrame = ancestorFrame; | 2807 currentFrame = ancestorFrame; |
| 2808 ancestorFrame = ancestorFrame->tree()->parent(); | 2808 ancestorFrame = ancestorFrame->tree()->parent(); |
| 2809 } | 2809 } |
| 2810 return 0; | 2810 return 0; |
| 2811 } | 2811 } |
| 2812 | 2812 |
| 2813 | 2813 |
| 2814 void Document::seamlessParentUpdatedStylesheets() | 2814 void Document::seamlessParentUpdatedStylesheets() |
| 2815 { | 2815 { |
| 2816 m_styleSheetCollections->didModifySeamlessParentStyleSheet(); | 2816 m_StyleEngine->didModifySeamlessParentStyleSheet(); |
| 2817 styleResolverChanged(RecalcStyleImmediately); | 2817 styleResolverChanged(RecalcStyleImmediately); |
| 2818 } | 2818 } |
| 2819 | 2819 |
| 2820 void Document::didRemoveAllPendingStylesheet() | 2820 void Document::didRemoveAllPendingStylesheet() |
| 2821 { | 2821 { |
| 2822 m_needsNotifyRemoveAllPendingStylesheet = false; | 2822 m_needsNotifyRemoveAllPendingStylesheet = false; |
| 2823 | 2823 |
| 2824 styleResolverChanged(RecalcStyleDeferred, AnalyzedStyleUpdate); | 2824 styleResolverChanged(RecalcStyleDeferred, AnalyzedStyleUpdate); |
| 2825 executeScriptsWaitingForResourcesIfNeeded(); | 2825 executeScriptsWaitingForResourcesIfNeeded(); |
| 2826 | 2826 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2882 } | 2882 } |
| 2883 | 2883 |
| 2884 void Document::processHttpEquivDefaultStyle(const String& content) | 2884 void Document::processHttpEquivDefaultStyle(const String& content) |
| 2885 { | 2885 { |
| 2886 // The preferred style set has been overridden as per section | 2886 // The preferred style set has been overridden as per section |
| 2887 // 14.3.2 of the HTML4.0 specification. We need to update the | 2887 // 14.3.2 of the HTML4.0 specification. We need to update the |
| 2888 // sheet used variable and then update our style selector. | 2888 // sheet used variable and then update our style selector. |
| 2889 // For more info, see the test at: | 2889 // For more info, see the test at: |
| 2890 // http://www.hixie.ch/tests/evil/css/import/main/preferred.html | 2890 // http://www.hixie.ch/tests/evil/css/import/main/preferred.html |
| 2891 // -dwh | 2891 // -dwh |
| 2892 m_styleSheetCollections->setSelectedStylesheetSetName(content); | 2892 m_StyleEngine->setSelectedStylesheetSetName(content); |
| 2893 m_styleSheetCollections->setPreferredStylesheetSetName(content); | 2893 m_StyleEngine->setPreferredStylesheetSetName(content); |
| 2894 styleResolverChanged(RecalcStyleDeferred); | 2894 styleResolverChanged(RecalcStyleDeferred); |
| 2895 } | 2895 } |
| 2896 | 2896 |
| 2897 void Document::processHttpEquivRefresh(const String& content) | 2897 void Document::processHttpEquivRefresh(const String& content) |
| 2898 { | 2898 { |
| 2899 maybeHandleHttpRefresh(content, HttpRefreshFromMetaTag); | 2899 maybeHandleHttpRefresh(content, HttpRefreshFromMetaTag); |
| 2900 } | 2900 } |
| 2901 | 2901 |
| 2902 void Document::maybeHandleHttpRefresh(const String& content, HttpRefreshType htt
pRefreshType) | 2902 void Document::maybeHandleHttpRefresh(const String& content, HttpRefreshType htt
pRefreshType) |
| 2903 { | 2903 { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3257 | 3257 |
| 3258 StyleSheetList* Document::styleSheets() | 3258 StyleSheetList* Document::styleSheets() |
| 3259 { | 3259 { |
| 3260 if (!m_styleSheetList) | 3260 if (!m_styleSheetList) |
| 3261 m_styleSheetList = StyleSheetList::create(this); | 3261 m_styleSheetList = StyleSheetList::create(this); |
| 3262 return m_styleSheetList.get(); | 3262 return m_styleSheetList.get(); |
| 3263 } | 3263 } |
| 3264 | 3264 |
| 3265 String Document::preferredStylesheetSet() const | 3265 String Document::preferredStylesheetSet() const |
| 3266 { | 3266 { |
| 3267 return m_styleSheetCollections->preferredStylesheetSetName(); | 3267 return m_StyleEngine->preferredStylesheetSetName(); |
| 3268 } | 3268 } |
| 3269 | 3269 |
| 3270 String Document::selectedStylesheetSet() const | 3270 String Document::selectedStylesheetSet() const |
| 3271 { | 3271 { |
| 3272 return m_styleSheetCollections->selectedStylesheetSetName(); | 3272 return m_StyleEngine->selectedStylesheetSetName(); |
| 3273 } | 3273 } |
| 3274 | 3274 |
| 3275 void Document::setSelectedStylesheetSet(const String& aString) | 3275 void Document::setSelectedStylesheetSet(const String& aString) |
| 3276 { | 3276 { |
| 3277 m_styleSheetCollections->setSelectedStylesheetSetName(aString); | 3277 m_StyleEngine->setSelectedStylesheetSetName(aString); |
| 3278 styleResolverChanged(RecalcStyleDeferred); | 3278 styleResolverChanged(RecalcStyleDeferred); |
| 3279 } | 3279 } |
| 3280 | 3280 |
| 3281 void Document::evaluateMediaQueryList() | 3281 void Document::evaluateMediaQueryList() |
| 3282 { | 3282 { |
| 3283 if (m_mediaQueryMatcher) | 3283 if (m_mediaQueryMatcher) |
| 3284 m_mediaQueryMatcher->styleResolverChanged(); | 3284 m_mediaQueryMatcher->styleResolverChanged(); |
| 3285 } | 3285 } |
| 3286 | 3286 |
| 3287 void Document::styleResolverChanged(StyleResolverUpdateType updateType, StyleRes
olverUpdateMode updateMode) | 3287 void Document::styleResolverChanged(StyleResolverUpdateType updateType, StyleRes
olverUpdateMode updateMode) |
| 3288 { | 3288 { |
| 3289 // Don't bother updating, since we haven't loaded all our style info yet | 3289 // Don't bother updating, since we haven't loaded all our style info yet |
| 3290 // and haven't calculated the style selector for the first time. | 3290 // and haven't calculated the style selector for the first time. |
| 3291 if (!attached() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded()
)) { | 3291 if (!attached() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded()
)) { |
| 3292 m_styleResolver.clear(); | 3292 m_styleResolver.clear(); |
| 3293 return; | 3293 return; |
| 3294 } | 3294 } |
| 3295 m_didCalculateStyleResolver = true; | 3295 m_didCalculateStyleResolver = true; |
| 3296 | 3296 |
| 3297 bool needsRecalc = m_styleSheetCollections->updateActiveStyleSheets(updateMo
de); | 3297 bool needsRecalc = m_StyleEngine->updateActiveStyleSheets(updateMode); |
| 3298 | 3298 |
| 3299 if (didLayoutWithPendingStylesheets() && !m_styleSheetCollections->hasPendin
gSheets()) { | 3299 if (didLayoutWithPendingStylesheets() && !m_StyleEngine->hasPendingSheets())
{ |
| 3300 // We need to manually repaint because we avoid doing all repaints in la
yout or style | 3300 // We need to manually repaint because we avoid doing all repaints in la
yout or style |
| 3301 // recalc while sheets are still loading to avoid FOUC. | 3301 // recalc while sheets are still loading to avoid FOUC. |
| 3302 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; | 3302 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; |
| 3303 renderView()->repaintViewAndCompositedLayers(); | 3303 renderView()->repaintViewAndCompositedLayers(); |
| 3304 } | 3304 } |
| 3305 | 3305 |
| 3306 if (!needsRecalc) | 3306 if (!needsRecalc) |
| 3307 return; | 3307 return; |
| 3308 | 3308 |
| 3309 m_evaluateMediaQueriesOnStyleRecalc = true; | 3309 m_evaluateMediaQueriesOnStyleRecalc = true; |
| (...skipping 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5366 if (event && (ancestorHasCapturingMouseenterListener || nodesToAddTo
Chain[i]->hasEventListeners(eventNames().mouseenterEvent))) | 5366 if (event && (ancestorHasCapturingMouseenterListener || nodesToAddTo
Chain[i]->hasEventListeners(eventNames().mouseenterEvent))) |
| 5367 nodesToAddToChain[i]->dispatchMouseEvent(*event, eventNames().mo
useenterEvent, 0, oldHoverNode.get()); | 5367 nodesToAddToChain[i]->dispatchMouseEvent(*event, eventNames().mo
useenterEvent, 0, oldHoverNode.get()); |
| 5368 } | 5368 } |
| 5369 } | 5369 } |
| 5370 | 5370 |
| 5371 updateStyleIfNeeded(); | 5371 updateStyleIfNeeded(); |
| 5372 } | 5372 } |
| 5373 | 5373 |
| 5374 bool Document::haveStylesheetsLoaded() const | 5374 bool Document::haveStylesheetsLoaded() const |
| 5375 { | 5375 { |
| 5376 return !m_styleSheetCollections->hasPendingSheets() || m_ignorePendingStyles
heets; | 5376 return !m_StyleEngine->hasPendingSheets() || m_ignorePendingStylesheets; |
| 5377 } | 5377 } |
| 5378 | 5378 |
| 5379 Locale& Document::getCachedLocale(const AtomicString& locale) | 5379 Locale& Document::getCachedLocale(const AtomicString& locale) |
| 5380 { | 5380 { |
| 5381 AtomicString localeKey = locale; | 5381 AtomicString localeKey = locale; |
| 5382 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr
olUIEnabled()) | 5382 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr
olUIEnabled()) |
| 5383 localeKey = defaultLanguage(); | 5383 localeKey = defaultLanguage(); |
| 5384 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey,
nullptr); | 5384 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey,
nullptr); |
| 5385 if (result.isNewEntry) | 5385 if (result.isNewEntry) |
| 5386 result.iterator->value = Locale::create(localeKey); | 5386 result.iterator->value = Locale::create(localeKey); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5438 { | 5438 { |
| 5439 return DocumentLifecycleNotifier::create(this); | 5439 return DocumentLifecycleNotifier::create(this); |
| 5440 } | 5440 } |
| 5441 | 5441 |
| 5442 DocumentLifecycleNotifier* Document::lifecycleNotifier() | 5442 DocumentLifecycleNotifier* Document::lifecycleNotifier() |
| 5443 { | 5443 { |
| 5444 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec
ycleNotifier()); | 5444 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec
ycleNotifier()); |
| 5445 } | 5445 } |
| 5446 | 5446 |
| 5447 } // namespace WebCore | 5447 } // namespace WebCore |
| OLD | NEW |