WebCore: Fix <rdar://problem/7162000> Crash while trying to
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2009 02:25:04 +0000 (02:25 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2009 02:25:04 +0000 (02:25 +0000)
calculate the horizontal position of image

Reviewed by Sam Weinig.

Test: fast/inline-block/relative-positioned-rtl-crash.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Corrected an
isInline() test to isRenderInline(). This is similar to r41259.

LayoutTests: Test for <rdar://problem/7162000> Crash while trying to
calculate the horizontal position of image

Reviewed by Sam Weinig.

* fast/inline-block/relative-positioned-rtl-crash-expected.txt: Added.
* fast/inline-block/relative-positioned-rtl-crash.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/inline-block/relative-positioned-rtl-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/inline-block/relative-positioned-rtl-crash.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBox.cpp

index a0023a9..1a4106b 100644 (file)
@@ -1,3 +1,13 @@
+2009-09-24  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Test for <rdar://problem/7162000> Crash while trying to
+        calculate the horizontal position of image
+
+        * fast/inline-block/relative-positioned-rtl-crash-expected.txt: Added.
+        * fast/inline-block/relative-positioned-rtl-crash.html: Added.
+
 2009-09-24  Carol Szabo  <carol.szabo@nokia.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/inline-block/relative-positioned-rtl-crash-expected.txt b/LayoutTests/fast/inline-block/relative-positioned-rtl-crash-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/fast/inline-block/relative-positioned-rtl-crash.html b/LayoutTests/fast/inline-block/relative-positioned-rtl-crash.html
new file mode 100644 (file)
index 0000000..9e300a3
--- /dev/null
@@ -0,0 +1,9 @@
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<body style="direction: rtl;">
+    <div style="display: inline-block; width: 100px; position: relative; height: 10px;">
+        <img style="position: absolute;"/>
+    </div>
+</body>
index 57bb760..ebf88d1 100644 (file)
@@ -1,3 +1,16 @@
+2009-09-24  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fix <rdar://problem/7162000> Crash while trying to
+        calculate the horizontal position of image
+
+        Test: fast/inline-block/relative-positioned-rtl-crash.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Corrected an
+        isInline() test to isRenderInline(). This is similar to r41259.
+
 2009-09-24  Jessie Berlin  <jberlin@webkit.org>
 
         Reviewed by Timothy Hatcher.
index cea226e..dd58ed1 100644 (file)
@@ -2456,7 +2456,7 @@ void RenderBox::calcAbsoluteHorizontalReplaced()
     // positioned, inline containing block because right now, it is using the xPos
     // of the first line box when really it should use the last line box.  When
     // this is fixed elsewhere, this block should be removed.
-    if (containerBlock->isInline() && containerBlock->style()->direction() == RTL) {
+    if (containerBlock->isRenderInline() && containerBlock->style()->direction() == RTL) {
         const RenderInline* flow = toRenderInline(containerBlock);
         InlineFlowBox* firstLine = flow->firstLineBox();
         InlineFlowBox* lastLine = flow->lastLineBox();