WebCore:
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Feb 2009 19:11:12 +0000 (19:11 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Feb 2009 19:11:12 +0000 (19:11 +0000)
2009-02-26  Rahul Kuchhal  <kuchhal@chromium.org>

        Reviewed by Dave Hyatt.

        https://bugs.webkit.org/show_bug.cgi?id=24003
        Fix a crash caused by unsafe type conversion.

        Test: fast/block/positioning/absolute-in-inline-rtl-4.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calcAbsoluteHorizontalValues):

LayoutTests:

2009-02-26  Rahul Kuchhal  <kuchhal@chromium.org>

        Reviewed by Dave Hyatt.

        https://bugs.webkit.org/show_bug.cgi?id=24003
        Fix a crash caused by unsafe type conversion.

        * fast/block/positioning/absolute-in-inline-rtl-4-expected.txt: Added.
        * fast/block/positioning/absolute-in-inline-rtl-4.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/block/positioning/absolute-in-inline-rtl-4-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/positioning/absolute-in-inline-rtl-4.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBox.cpp

index 8a385f83e3659f9b5035c339e52752a6bccc18b4..d8cf2ec8e8458e233f2f36f93ce3aef1409ecea9 100644 (file)
@@ -1,3 +1,13 @@
+2009-02-26  Rahul Kuchhal  <kuchhal@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24003
+        Fix a crash caused by unsafe type conversion.
+
+        * fast/block/positioning/absolute-in-inline-rtl-4-expected.txt: Added.
+        * fast/block/positioning/absolute-in-inline-rtl-4.html: Added.
+
 2009-02-26  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Dan Bernstein & Darin Adler
diff --git a/LayoutTests/fast/block/positioning/absolute-in-inline-rtl-4-expected.txt b/LayoutTests/fast/block/positioning/absolute-in-inline-rtl-4-expected.txt
new file mode 100644 (file)
index 0000000..e25e141
--- /dev/null
@@ -0,0 +1 @@
+This test checks that an absolute element inside inlined element should not cause crash. If this file opens successfully that means the test passed.
diff --git a/LayoutTests/fast/block/positioning/absolute-in-inline-rtl-4.html b/LayoutTests/fast/block/positioning/absolute-in-inline-rtl-4.html
new file mode 100644 (file)
index 0000000..7ea39cb
--- /dev/null
@@ -0,0 +1,13 @@
+<html dir="rtl">
+<body>
+<script>
+  if (window.layoutTestController)
+    layoutTestController.dumpAsText()
+</script>
+<button style="position: relative" type="submit">
+<span style="position: absolute">This test checks that an absolute element
+inside inlined element should not cause crash. If this file opens
+successfully that means the test passed.</span>
+</button>
+</body>
+</html>
index 1bfa55bd421dab52f2ade5bb56fc7429cd169a06..f3c7c42a2fc2b3fbda29b55f7284fb82b0785f7d 100644 (file)
@@ -1,3 +1,15 @@
+2009-02-26  Rahul Kuchhal  <kuchhal@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24003
+        Fix a crash caused by unsafe type conversion.
+
+        Test: fast/block/positioning/absolute-in-inline-rtl-4.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::calcAbsoluteHorizontalValues):
+
 2009-02-26  Ojan Vafai  <ojan@chromium.org>
 
         Reviewed by Adam Roben.
index 6915d371ca58b66c76385fb4b7f05c2104e79436..8d1b12d4557a7db956b5356e6b28eb7ae5b4185a 100644 (file)
@@ -2110,7 +2110,7 @@ void RenderBox::calcAbsoluteHorizontalValues(Length width, const RenderBoxModelO
     // positioned, inline 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();