2010-01-19 Oliver Hunt <oliver@apple.com>
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jan 2010 21:37:17 +0000 (21:37 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jan 2010 21:37:17 +0000 (21:37 +0000)
        Reviewed by Beth Dakin.

        Insufficient repaint issues with html embedded in foreignObject
        https://bugs.webkit.org/show_bug.cgi?id=16318

        Partial fix for selection repaint in foreignObject, basically we
        just need to make sure foreignObject correctly applies the svg
        transform to the selection rect.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintSelection):
        * rendering/RenderForeignObject.cpp:
        (WebCore::RenderForeignObject::mapLocalToContainer):
        * rendering/RenderForeignObject.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@53561 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderForeignObject.cpp
WebCore/rendering/RenderForeignObject.h

index fbcc932..0f4c716 100644 (file)
@@ -1,3 +1,20 @@
+2010-01-19  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Insufficient repaint issues with html embedded in foreignObject
+        https://bugs.webkit.org/show_bug.cgi?id=16318
+
+        Partial fix for selection repaint in foreignObject, basically we
+        just need to make sure foreignObject correctly applies the svg
+        transform to the selection rect.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintSelection):
+        * rendering/RenderForeignObject.cpp:
+        (WebCore::RenderForeignObject::mapLocalToContainer):
+        * rendering/RenderForeignObject.h:
+
 2010-01-20  Kevin Ollivier  <kevino@theolliviers.com>
 
         Build fix for !ENABLE(SVG).
index 3fd10ea..61a97b3 100644 (file)
@@ -1957,8 +1957,10 @@ void RenderBlock::paintSelection(PaintInfo& paintInfo, int tx, int ty)
         IntRect gapRectsBounds = fillSelectionGaps(this, tx, ty, tx, ty, lastTop, lastLeft, lastRight, &paintInfo);
         if (!gapRectsBounds.isEmpty()) {
             if (RenderLayer* layer = enclosingLayer()) {
-                IntSize offset = hasLayer() ? IntSize() : offsetFromAncestorContainer(layer->renderer());
-                gapRectsBounds.move(offset - IntSize(tx, ty));
+                if (!hasLayer()) {
+                    FloatRect localBounds(gapRectsBounds);
+                    gapRectsBounds = localToContainerQuad(localBounds, layer->renderer()).enclosingBoundingBox();
+                }
                 layer->addBlockSelectionGapsBounds(gapRectsBounds);
             }
         }
index 573ae96..6597554 100644 (file)
@@ -120,6 +120,11 @@ bool RenderForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int
     return false;
 }
 
+void RenderForeignObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const
+{
+    SVGRenderBase::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT)
index 8ad223f..8cb9a55 100644 (file)
@@ -52,6 +52,8 @@ public:
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     virtual bool isSVGForeignObject() const { return true; }
 
+    virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const;
+
  private:
     TransformationMatrix translationForAttributes() const;