Commit 1c29edbc authored by akling@apple.com's avatar akling@apple.com

Simplify some Settings access where we have a Frame in reach.

<http://webkit.org/b/120239>

Reviewed by Anders Carlsson.

In three cases where we can grab at a Frame, we can reach all the way to some Settings
without having to use pointers.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9bbd63bf
2013-08-23 Andreas Kling <akling@apple.com>
Simplify some Settings access where we have a Frame in reach.
<http://webkit.org/b/120239>
Reviewed by Anders Carlsson.
In three cases where we can grab at a Frame, we can reach all the way to some Settings
without having to use pointers.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
2013-08-23 Jer Noble <jer.noble@apple.com>
REGRESSION (r150516): Media controls are messed up on right-to-left webpages
......@@ -669,11 +669,9 @@ void FrameLoader::didBeginDocument(bool dispatch)
updateFirstPartyForCookies();
m_frame.document()->initContentSecurityPolicy();
Settings* settings = m_frame.document()->settings();
if (settings) {
m_frame.document()->cachedResourceLoader()->setImagesEnabled(settings->areImagesEnabled());
m_frame.document()->cachedResourceLoader()->setAutoLoadImages(settings->loadsImagesAutomatically());
}
const Settings& settings = m_frame.settings();
m_frame.document()->cachedResourceLoader()->setImagesEnabled(settings.areImagesEnabled());
m_frame.document()->cachedResourceLoader()->setAutoLoadImages(settings.loadsImagesAutomatically());
if (m_documentLoader) {
String dnsPrefetchControl = m_documentLoader->response().httpHeaderField("X-DNS-Prefetch-Control");
......
......@@ -876,9 +876,9 @@ void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer*
}
IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(RenderLayer::ClipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.
if (Settings* settings = m_renderView.document()->settings())
if (!settings->applyPageScaleFactorInCompositor())
clipRect.scale(pageScaleFactor());
const Settings& settings = m_renderView.frameView().frame().settings();
if (!settings.applyPageScaleFactorInCompositor())
clipRect.scale(pageScaleFactor());
clipRect.intersect(layerBounds);
overlapMap.add(layer, clipRect);
}
......@@ -2260,10 +2260,9 @@ bool RenderLayerCompositor::requiresCompositingForPosition(RenderObject* rendere
return false;
// FIXME: acceleratedCompositingForFixedPositionEnabled should probably be renamed acceleratedCompositingForViewportConstrainedPositionEnabled().
if (Settings* settings = m_renderView.document()->settings()) {
if (!settings->acceleratedCompositingForFixedPositionEnabled())
return false;
}
const Settings& settings = m_renderView.frameView().frame().settings();
if (!settings.acceleratedCompositingForFixedPositionEnabled())
return false;
if (isSticky)
return hasCoordinatedScrolling() && isViewportConstrainedFixedOrStickyLayer(layer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment