void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { switch (changeType) { case SettingsDelegate::StyleChange: setNeedsRecalcStyleInAllFrames(); break; case SettingsDelegate::MediaTypeChange: if (mainFrame()) { mainFrame()->view()->setMediaType(AtomicString(settings().mediaTypeOverride())); setNeedsRecalcStyleInAllFrames(); } break; case SettingsDelegate::MultisamplingChange: { HashSet<RawPtr<MultisamplingChangedObserver> >::iterator stop = m_multisamplingChangedObservers.end(); for (HashSet<RawPtr<MultisamplingChangedObserver> >::iterator it = m_multisamplingChangedObservers.begin(); it != stop; ++it) (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled()); break; } case SettingsDelegate::ImageLoadingChange: break; case SettingsDelegate::FontFamilyChange: if (mainFrame()->document() && mainFrame()->document()->isActive()) mainFrame()->document()->styleEngine()->updateGenericFontFamilySettings(); setNeedsRecalcStyleInAllFrames(); break; case SettingsDelegate::MediaQueryChange: if (mainFrame()->document()) mainFrame()->document()->mediaQueryAffectingValueChanged(); setNeedsRecalcStyleInAllFrames(); break; } }
void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { switch (changeType) { case SettingsDelegate::StyleChange: setNeedsRecalcStyleInAllFrames(); break; case SettingsDelegate::ViewportDescriptionChange: if (mainFrame()) mainFrame()->document()->updateViewportDescription(); break; case SettingsDelegate::MediaTypeChange: m_mainFrame->view()->setMediaType(AtomicString(settings().mediaTypeOverride())); setNeedsRecalcStyleInAllFrames(); break; case SettingsDelegate::DNSPrefetchingChange: for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) frame->document()->initDNSPrefetch(); break; case SettingsDelegate::MultisamplingChange: { HashSet<MultisamplingChangedObserver*>::iterator stop = m_multisamplingChangedObservers.end(); for (HashSet<MultisamplingChangedObserver*>::iterator it = m_multisamplingChangedObservers.begin(); it != stop; ++it) (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled()); break; } case SettingsDelegate::ImageLoadingChange: for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { frame->document()->fetcher()->setImagesEnabled(settings().imagesEnabled()); frame->document()->fetcher()->setAutoLoadImages(settings().loadsImagesAutomatically()); } break; case SettingsDelegate::TextAutosizingChange: // FTA needs both setNeedsRecalcStyle and setNeedsLayout after a setting change. if (RuntimeEnabledFeatures::fastTextAutosizingEnabled()) { setNeedsRecalcStyleInAllFrames(); } else { // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::resize, or whether there is only one document per Settings instance? for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { TextAutosizer* textAutosizer = frame->document()->textAutosizer(); if (textAutosizer) textAutosizer->recalculateMultipliers(); } } // TextAutosizing updates RenderStyle during layout phase (via TextAutosizer::processSubtree). // We should invoke setNeedsLayout here. setNeedsLayoutInAllFrames(); break; case SettingsDelegate::ScriptEnableChange: m_inspectorController->scriptsEnabled(settings().scriptEnabled()); break; case SettingsDelegate::FontFamilyChange: for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) frame->document()->styleEngine()->updateGenericFontFamilySettings(); setNeedsRecalcStyleInAllFrames(); break; } }
void Settings::setFontRenderingMode(FontRenderingMode mode) { if (fontRenderingMode() == mode) return; m_fontRenderingMode = mode; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setTextAreasAreResizable(bool textAreasAreResizable) { if (m_textAreasAreResizable == textAreasAreResizable) return; m_textAreasAreResizable = textAreasAreResizable; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setDefaultFixedFontSize(int defaultFontSize) { if (m_defaultFixedFontSize == defaultFontSize) return; m_defaultFixedFontSize = defaultFontSize; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setMinimumLogicalFontSize(int minimumLogicalFontSize) { if (m_minimumLogicalFontSize == minimumLogicalFontSize) return; m_minimumLogicalFontSize = minimumLogicalFontSize; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setFantasyFontFamily(const AtomicString& fantasyFontFamily) { if (m_fantasyFontFamily == fantasyFontFamily) return; m_fantasyFontFamily = fantasyFontFamily; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setCursiveFontFamily(const AtomicString& cursiveFontFamily) { if (m_cursiveFontFamily == cursiveFontFamily) return; m_cursiveFontFamily = cursiveFontFamily; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setSansSerifFontFamily(const AtomicString& sansSerifFontFamily) { if (m_sansSerifFontFamily == sansSerifFontFamily) return; m_sansSerifFontFamily = sansSerifFontFamily; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setStandardFontFamily(const AtomicString& standardFontFamily) { if (standardFontFamily == m_standardFontFamily) return; m_standardFontFamily = standardFontFamily; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled) { if (m_authorAndUserStylesEnabled == authorAndUserStylesEnabled) return; m_authorAndUserStylesEnabled = authorAndUserStylesEnabled; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setTextReflowEnabled(bool enabled) { if (m_isTextReflowEnabled == enabled) return; m_isTextReflowEnabled = enabled; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setShowRepaintCounter(bool enabled) { if (m_showRepaintCounter == enabled) return; m_showRepaintCounter = enabled; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setShowDebugBorders(bool enabled) { if (m_showDebugBorders == enabled) return; m_showDebugBorders = enabled; setNeedsRecalcStyleInAllFrames(m_page); }
void Settings::setAcceleratedCompositingEnabled(bool enabled) { if (m_acceleratedCompositingEnabled == enabled) return; m_acceleratedCompositingEnabled = enabled; setNeedsRecalcStyleInAllFrames(m_page); }
void Page::setPagination(const Pagination& pagination) { if (m_pagination == pagination) return; m_pagination = pagination; setNeedsRecalcStyleInAllFrames(); }
void Page::setPagination(const Pagination& pagination) { if (m_pagination == pagination) return; m_pagination = pagination; setNeedsRecalcStyleInAllFrames(); pageCache()->markPagesForFullStyleRecalc(this); }
void Page::setDeviceScaleFactor(float scaleFactor) { if (m_deviceScaleFactor == scaleFactor) return; m_deviceScaleFactor = scaleFactor; setNeedsRecalcStyleInAllFrames(); if (mainFrame()) mainFrame()->deviceOrPageScaleFactorChanged(); }
void Page::setDeviceScaleFactor(float scaleFactor) { if (m_deviceScaleFactor == scaleFactor) return; m_deviceScaleFactor = scaleFactor; setNeedsRecalcStyleInAllFrames(); if (mainFrame() && mainFrame()->isLocalFrame()) { deprecatedLocalMainFrame()->deviceOrPageScaleFactorChanged(); m_chrome->client().deviceOrPageScaleFactorChanged(); } }
void Page::setDeviceScaleFactor(float scaleFactor) { if (m_deviceScaleFactor == scaleFactor) return; m_deviceScaleFactor = scaleFactor; setNeedsRecalcStyleInAllFrames(); #if USE(ACCELERATED_COMPOSITING) if (mainFrame()) mainFrame()->deviceOrPageScaleFactorChanged(); pageCache()->markPagesForDeviceScaleChanged(this); #endif for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) frame->editor().deviceScaleFactorChanged(); pageCache()->markPagesForFullStyleRecalc(this); }
void Page::settingsChanged(SettingsDelegate::ChangeType changeType) { switch (changeType) { case SettingsDelegate::StyleChange: setNeedsRecalcStyleInAllFrames(); break; case SettingsDelegate::ViewportDescriptionChange: if (mainFrame() && mainFrame()->isLocalFrame()) deprecatedLocalMainFrame()->document()->updateViewportDescription(); break; case SettingsDelegate::MediaTypeChange: if (m_mainFrame->isLocalFrame()) { deprecatedLocalMainFrame()->view()->setMediaType(AtomicString(settings().mediaTypeOverride())); setNeedsRecalcStyleInAllFrames(); } break; case SettingsDelegate::DNSPrefetchingChange: for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { if (frame->isLocalFrame()) toLocalFrame(frame)->document()->initDNSPrefetch(); } break; case SettingsDelegate::MultisamplingChange: { WillBeHeapHashSet<RawPtrWillBeWeakMember<MultisamplingChangedObserver> >::iterator stop = m_multisamplingChangedObservers.end(); for (WillBeHeapHashSet<RawPtrWillBeWeakMember<MultisamplingChangedObserver> >::iterator it = m_multisamplingChangedObservers.begin(); it != stop; ++it) (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled()); break; } case SettingsDelegate::ImageLoadingChange: for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { if (frame->isLocalFrame()) { toLocalFrame(frame)->document()->fetcher()->setImagesEnabled(settings().imagesEnabled()); toLocalFrame(frame)->document()->fetcher()->setAutoLoadImages(settings().loadsImagesAutomatically()); } } break; case SettingsDelegate::TextAutosizingChange: if (!mainFrame() || !mainFrame()->isLocalFrame()) break; if (FastTextAutosizer* textAutosizer = deprecatedLocalMainFrame()->document()->fastTextAutosizer()) { textAutosizer->updatePageInfoInAllFrames(); } else { for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { if (!frame->isLocalFrame()) continue; if (TextAutosizer* textAutosizer = toLocalFrame(frame)->document()->textAutosizer()) textAutosizer->recalculateMultipliers(); } // TextAutosizing updates RenderStyle during layout phase (via TextAutosizer::processSubtree). // We should invoke setNeedsLayout here. setNeedsLayoutInAllFrames(); } break; case SettingsDelegate::ScriptEnableChange: m_inspectorController->scriptsEnabled(settings().scriptEnabled()); break; case SettingsDelegate::FontFamilyChange: for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { if (frame->isLocalFrame()) toLocalFrame(frame)->document()->styleEngine()->updateGenericFontFamilySettings(); } setNeedsRecalcStyleInAllFrames(); break; case SettingsDelegate::AcceleratedCompositingChange: updateAcceleratedCompositingSettings(); break; } }