Title: [168687] trunk
Revision
168687
Author
[email protected]
Date
2014-05-13 10:56:55 -0700 (Tue, 13 May 2014)

Log Message

REGRESSSION(r168528) Subpixel rendering: Selection rect is not positioned properly when SVG text is selected.
https://bugs.webkit.org/show_bug.cgi?id=132868

Reviewed by Dirk Schulze.

Scale the selection rect. r168528 missed applying this final transform on the selection/painting rect.

Source/WebCore:
Test: svg/text/hidpi-text-selection-rect-position.html

* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::selectionRectForTextFragment):

LayoutTests:
* svg/text/hidpi-text-selection-rect-position-expected.html: Added.
* svg/text/hidpi-text-selection-rect-position.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (168686 => 168687)


--- trunk/LayoutTests/ChangeLog	2014-05-13 17:30:45 UTC (rev 168686)
+++ trunk/LayoutTests/ChangeLog	2014-05-13 17:56:55 UTC (rev 168687)
@@ -1,3 +1,15 @@
+2014-05-13  Zalan Bujtas  <[email protected]>
+
+        REGRESSSION(r168528) Subpixel rendering: Selection rect is not positioned properly when SVG text is selected.
+        https://bugs.webkit.org/show_bug.cgi?id=132868
+
+        Reviewed by Dirk Schulze.
+
+        Scale the selection rect. r168528 missed applying this final transform on the selection/painting rect.
+
+        * svg/text/hidpi-text-selection-rect-position-expected.html: Added.
+        * svg/text/hidpi-text-selection-rect-position.html: Added.
+
 2014-05-13  Zoltan Horvath  <[email protected]>
 
         [CSS Regions] Add basic tests for inset flows into regions

Added: trunk/LayoutTests/svg/text/hidpi-text-selection-rect-position-expected.html (0 => 168687)


--- trunk/LayoutTests/svg/text/hidpi-text-selection-rect-position-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/hidpi-text-selection-rect-position-expected.html	2014-05-13 17:56:55 UTC (rev 168687)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that svg text selection rect is properly sized and positioned.</title>
+<style>
+  body {
+    margin: 0px;
+    font-size: 16px;
+  }
+  .bckg {
+    position: fixed;
+    left: 20px;
+    top: 5.5px;
+    width: 68px;
+    height: 18.5px;
+    background: rgba(255, 0, 0, 0.9);
+  }
+</style>
+</head>
+<body>
+<div class=bckg></div>
+</body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/svg/text/hidpi-text-selection-rect-position.html (0 => 168687)


--- trunk/LayoutTests/svg/text/hidpi-text-selection-rect-position.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/hidpi-text-selection-rect-position.html	2014-05-13 17:56:55 UTC (rev 168687)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that svg text selection rect is properly sized and positioned.</title>
+<style>
+  body {
+    margin: 0px;
+    font-size: 16px;
+  }
+  ::selection {
+    background: rgba(255, 0, 0, 0.9);
+  }
+  text { 
+    fill: transparent; 
+  }
+</style>
+</head>
+<body>
+<svg id=container><text x="20" y="20">foobar test</text></svg>
+<script>
+  var range = document.createRange(); 
+  range.selectNode(document.getElementById("container")); 
+  window.getSelection().addRange(range);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (168686 => 168687)


--- trunk/Source/WebCore/ChangeLog	2014-05-13 17:30:45 UTC (rev 168686)
+++ trunk/Source/WebCore/ChangeLog	2014-05-13 17:56:55 UTC (rev 168687)
@@ -1,3 +1,17 @@
+2014-05-13  Zalan Bujtas  <[email protected]>
+
+        REGRESSSION(r168528) Subpixel rendering: Selection rect is not positioned properly when SVG text is selected.
+        https://bugs.webkit.org/show_bug.cgi?id=132868
+
+        Reviewed by Dirk Schulze.
+
+        Scale the selection rect. r168528 missed applying this final transform on the selection/painting rect.
+
+        Test: svg/text/hidpi-text-selection-rect-position.html
+
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
+
 2014-05-13  Martin Hodovan  <[email protected]>
 
         ASSERTION FAILED: leftCategory != CalcOther && rightCategory != CalcOther

Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (168686 => 168687)


--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp	2014-05-13 17:30:45 UTC (rev 168686)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp	2014-05-13 17:56:55 UTC (rev 168687)
@@ -133,7 +133,7 @@
     if (scalingFactor == 1)
         return snappedSelectionRect;
 
-    selectionRect.scale(1 / scalingFactor);
+    snappedSelectionRect.scale(1 / scalingFactor);
     return snappedSelectionRect;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to