Title: [116435] trunk
Revision
116435
Author
[email protected]
Date
2012-05-08 10:51:29 -0700 (Tue, 08 May 2012)

Log Message

[Chromium] Fix the position of an RTL resizer
https://bugs.webkit.org/show_bug.cgi?id=80640

Reviewed by Tony Chang.

When rendering an RTL resizer, my r110073 renders it at the same position as the
one used for rendering a LTR resizer. Unfortunately, this code renders the RTL
resizer image at an incorrect position on Mac and Linux. This change uses the
correct formula to calculate the position of an RTL resizer.

Source/WebCore:

Test: platform/chromium/scrollbars/rtl-resizer-position.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::drawPlatformResizerImage):

LayoutTests:

* platform/chromium/platform/chromium/scrollbars: Added.
* platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.png: Added.
* platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.txt: Added.
* platform/chromium/scrollbars/rtl-resizer-position.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (116434 => 116435)


--- trunk/LayoutTests/ChangeLog	2012-05-08 17:14:44 UTC (rev 116434)
+++ trunk/LayoutTests/ChangeLog	2012-05-08 17:51:29 UTC (rev 116435)
@@ -1,3 +1,20 @@
+2012-05-08  Hironori Bono  <[email protected]>
+
+        [Chromium] Fix the position of an RTL resizer
+        https://bugs.webkit.org/show_bug.cgi?id=80640
+
+        Reviewed by Tony Chang.
+
+        When rendering an RTL resizer, my r110073 renders it at the same position as the
+        one used for rendering a LTR resizer. Unfortunately, this code renders the RTL
+        resizer image at an incorrect position on Mac and Linux. This change uses the
+        correct formula to calculate the position of an RTL resizer.
+
+        * platform/chromium/platform/chromium/scrollbars: Added.
+        * platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.png: Added.
+        * platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.txt: Added.
+        * platform/chromium/scrollbars/rtl-resizer-position.html: Added.
+
 2012-05-08  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Unreviewed gardening, skip failing tests.

Added: trunk/LayoutTests/platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.png (0 => 116435)


--- trunk/LayoutTests/platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.png	2012-05-08 17:51:29 UTC (rev 116435)
@@ -0,0 +1,4 @@
+\x89PNG
+
+
+IHDR X\x9Av\x82p)tEXtchecksum46689358df988e0376f70a2a7324519c\xA0\xD1L&\xC3IDATx\x9C\xED\xDA\xC1m\xC30A1p\xAF\xAAI\xD52'A.\xB1c%3\xBC\xB1\xF8sι\xC0\xC6WO\xE0\xF8\xB8z\xF0<\xAE\xC0\xBD8\x9C\xB0\xE2yIw2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x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xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8 #@\x80\x8C2\xC8|\x93\xBC0\xE1͡\x82IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.txt (0 => 116435)


--- trunk/LayoutTests/platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/platform/chromium/scrollbars/rtl-resizer-position-expected.txt	2012-05-08 17:51:29 UTC (rev 116435)
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x404
+  RenderBlock {HTML} at (0,0) size 800x404
+    RenderBody {BODY} at (0,0) size 800x404
+layer at (396,0) size 404x404 clip at (398,2) size 400x400
+  RenderBlock {DIV} at (396,0) size 404x404 [border: (2px solid #000000)]

Added: trunk/LayoutTests/platform/chromium/scrollbars/rtl-resizer-position.html (0 => 116435)


--- trunk/LayoutTests/platform/chromium/scrollbars/rtl-resizer-position.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/scrollbars/rtl-resizer-position.html	2012-05-08 17:51:29 UTC (rev 116435)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Bug 80640</title>
+</head>
+<body dir="rtl" style="margin:0px">
+<div id="overflow" dir="rtl" style="border:2px solid black; overflow:auto; width: 400px; height: 400px; resize:both;">
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (116434 => 116435)


--- trunk/Source/WebCore/ChangeLog	2012-05-08 17:14:44 UTC (rev 116434)
+++ trunk/Source/WebCore/ChangeLog	2012-05-08 17:51:29 UTC (rev 116435)
@@ -1,3 +1,20 @@
+2012-05-08  Hironori Bono  <[email protected]>
+
+        [Chromium] Fix the position of an RTL resizer
+        https://bugs.webkit.org/show_bug.cgi?id=80640
+
+        Reviewed by Tony Chang.
+
+        When rendering an RTL resizer, my r110073 renders it at the same position as the
+        one used for rendering a LTR resizer. Unfortunately, this code renders the RTL
+        resizer image at an incorrect position on Mac and Linux. This change uses the
+        correct formula to calculate the position of an RTL resizer.
+
+        Test: platform/chromium/scrollbars/rtl-resizer-position.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::drawPlatformResizerImage):
+
 2012-05-08  Andreas Kling  <[email protected]>
 
         Element: isURLAttribute() should take a const Attribute&.

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (116434 => 116435)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-08 17:14:44 UTC (rev 116434)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-08 17:51:29 UTC (rev 116435)
@@ -2651,17 +2651,15 @@
         cornerResizerSize = resizeCornerImage->size();
     }
 
-    IntRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
     if (renderer()->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
         context->save();
-        context->translate(imageRect.x(), imageRect.y());
-        imageRect.setX(0);
-        imageRect.setY(0);
+        context->translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
         context->scale(FloatSize(-1.0, 1.0));
-        context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), imageRect);
+        context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), IntRect(IntPoint(), cornerResizerSize));
         context->restore();
         return;
     }
+    IntRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
     context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), imageRect);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to