if (m_renderView->document()->frame()->tree()->parent())
return false;
+ // For the moment, we want to only enable fixed composited layers on mobile websites.
// Enable composited layers (for fixed elements)
- if (layer->isFixed())
+ // We can consider a website as being a 'mobile' site if all the
+ // following checks are true:
+ // 1) - the viewport width is either undefined (-1) or equal to device-width (0), and
+ // 2) - no scaling is allowed
+ if (!layer->isFixed())
+ return false;
+
+ Settings* settings = m_renderView->document()->settings();
+ if (!settings)
+ return false;
+
+ if ((settings->viewportWidth() == -1 || settings->viewportWidth() == 0) &&
+ !settings->viewportUserScalable())
return true;
+
#endif
return false;
}