Index: Source/WebKit/chromium/src/LinkHighlight.cpp |
diff --git a/Source/WebKit/chromium/src/LinkHighlight.cpp b/Source/WebKit/chromium/src/LinkHighlight.cpp |
index ec65ee156815006eb98f7d67b0b8769656a3d6ea..465b0f213838b8e72b9cd7b7ca3d31d41a35f115 100644 |
--- a/Source/WebKit/chromium/src/LinkHighlight.cpp |
+++ b/Source/WebKit/chromium/src/LinkHighlight.cpp |
@@ -27,6 +27,7 @@ |
#include "LinkHighlight.h" |
+#include "NonCompositedContentHost.h" |
#include "SkMatrix44.h" |
#include "WebFrameImpl.h" |
#include "WebKit.h" |
@@ -65,6 +66,7 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl) |
: m_node(node) |
, m_owningWebViewImpl(owningWebViewImpl) |
, m_currentGraphicsLayer(0) |
+ , m_usingNonCompositedContentHost(false) |
, m_geometryNeedsUpdate(false) |
, m_isAnimating(false) |
, m_startTime(monotonicallyIncreasingTime()) |
@@ -127,6 +129,13 @@ RenderLayer* LinkHighlight::computeEnclosingCompositingLayer() |
return 0; |
GraphicsLayerChromium* newGraphicsLayer = static_cast<GraphicsLayerChromium*>(renderLayer->backing()->graphicsLayer()); |
+ m_clipLayer->setSublayerTransform(SkMatrix44()); |
+ m_usingNonCompositedContentHost = !newGraphicsLayer->drawsContent(); |
+ if (m_usingNonCompositedContentHost ) { |
+ m_clipLayer->setSublayerTransform(newGraphicsLayer->platformLayer()->transform()); |
+ newGraphicsLayer = static_cast<GraphicsLayerChromium*>(m_owningWebViewImpl->nonCompositedContentHost()->topLevelRootLayer()); |
+ } |
+ |
if (m_currentGraphicsLayer != newGraphicsLayer) { |
if (m_currentGraphicsLayer) |
clearGraphicsLayerLinkHighlightPointer(); |
@@ -188,20 +197,22 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositin |
ASSERT(quads.size()); |
FloatRect positionAdjust; |
- const RenderStyle* style = m_node->renderer()->style(); |
- // If we have a box shadow, and are non-relative, then must manually adjust |
- // for its size. |
- if (const ShadowData* shadow = style->boxShadow()) { |
- int outlineSize = m_node->renderer()->outlineStyleForRepaint()->outlineSize(); |
- shadow->adjustRectForShadow(positionAdjust, outlineSize); |
- } |
+ if (!m_usingNonCompositedContentHost) { |
+ const RenderStyle* style = m_node->renderer()->style(); |
+ // If we have a box shadow, and are non-relative, then must manually adjust |
+ // for its size. |
+ if (const ShadowData* shadow = style->boxShadow()) { |
+ int outlineSize = m_node->renderer()->outlineStyleForRepaint()->outlineSize(); |
+ shadow->adjustRectForShadow(positionAdjust, outlineSize); |
+ } |
- // If absolute or fixed, need to subtract out our fixed positioning. |
- // FIXME: should we use RenderLayer::staticBlockPosition() here instead? |
- // Perhaps consider this if out-of-flow elements cause further problems. |
- if (m_node->renderer()->isOutOfFlowPositioned()) { |
- FloatPoint delta(style->left().getFloatValue(), style->top().getFloatValue()); |
- positionAdjust.moveBy(delta); |
+ // If absolute or fixed, need to subtract out our fixed positioning. |
+ // FIXME: should we use RenderLayer::staticBlockPosition() here instead? |
+ // Perhaps consider this if out-of-flow elements cause further problems. |
+ if (m_node->renderer()->isOutOfFlowPositioned()) { |
+ FloatPoint delta(style->left().getFloatValue(), style->top().getFloatValue()); |
+ positionAdjust.moveBy(delta); |
+ } |
} |
Path newPath; |