[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 15:39:25 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 96c4e4b0e1e7ec758844156b872b24f3936e30a2
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 10 01:46:10 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=49202
    
    Reviewed by Dan Bernstein.
    
    WebCore:
    
    Make lists work with vertical text.
    
    (1) Patch all the CSS rules in html.css so that the margins are directionally abstract.
    (2) Add a transposedRect and transposedSize method to IntRect and IntSize for swapping x/y and width/height.
    (3) Add adjustLineDirectionPosition as a helper for moving a line box only in the line direction.
    (4) Fix a bug in addIntrudingFLoats uncovered by list test cases where the top margin of an element was being
    incorrectly added to a float's physical left side instead of its top side.
    (5) Make positioning and painting and selection of list markers account for all writing modes.
    (6) Add helpers for setting the start and end margins directly in a RenderStyle, since lists do this to hack
    marker margins before they have been calculated and set on the box.
    
    Cloned a bunch of fast/lists tests into fast/lists/*-vertical.html versions.
    
    * css/html.css:
    * platform/graphics/IntRect.h:
    (WebCore::IntRect::transposedRect):
    * platform/graphics/IntSize.h:
    (WebCore::IntSize::transposedSize):
    * rendering/InlineBox.h:
    (WebCore::InlineBox::adjustLineDirectionPosition):
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::addIntrudingFloats):
    * rendering/RenderListItem.cpp:
    (WebCore::getParentOfFirstLineBox):
    (WebCore::RenderListItem::positionListMarker):
    (WebCore::RenderListItem::paint):
    * rendering/RenderListMarker.cpp:
    (WebCore::RenderListMarker::localSelectionRect):
    (WebCore::RenderListMarker::paint):
    (WebCore::RenderListMarker::layout):
    (WebCore::RenderListMarker::computePreferredLogicalWidths):
    (WebCore::RenderListMarker::updateMargins):
    (WebCore::RenderListMarker::getRelativeMarkerRect):
    * rendering/style/RenderStyle.cpp:
    (WebCore::RenderStyle::setMarginStart):
    (WebCore::RenderStyle::setMarginEnd):
    * rendering/style/RenderStyle.h:
    
    LayoutTests:
    
    Make lists work with vertical text.
    
    (1) Patch all the CSS rules in html.css so that the margins are directionally abstract.
    (2) Add a transposedRect and transposedSize method to IntRect and IntSize for swapping x/y and width/height.
    (3) Add adjustLineDirectionPosition as a helper for moving a line box only in the line direction.
    (4) Fix a bug in addIntrudingFLoats uncovered by list test cases where the top margin of an element was being
    incorrectly added to a float's physical left side instead of its top side.
    (5) Make positioning and painting and selection of list markers account for all writing modes.
    (6) Add helpers for setting the start and end margins directly in a RenderStyle, since lists do this to hack
    marker margins before they have been calculated and set on the box.
    
    Cloned a bunch of fast/lists tests into fast/lists/*-vertical.html versions.
    
    * fast/lists/001-vertical.html: Added.
    * fast/lists/002-vertical.html: Added.
    * fast/lists/003-vertical.html: Added.
    * fast/lists/005-vertical.html: Added.
    * fast/lists/006-vertical.html: Added.
    * fast/lists/007-vertical.html: Added.
    * fast/lists/008-vertical.html: Added.
    * fast/lists/009-vertical.html: Added.
    * platform/mac/fast/lists/001-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/001-vertical-expected.png: Added.
    * platform/mac/fast/lists/001-vertical-expected.txt: Added.
    * platform/mac/fast/lists/002-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/002-vertical-expected.png: Added.
    * platform/mac/fast/lists/002-vertical-expected.txt: Added.
    * platform/mac/fast/lists/003-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/003-vertical-expected.png: Added.
    * platform/mac/fast/lists/003-vertical-expected.txt: Added.
    * platform/mac/fast/lists/005-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/005-vertical-expected.png: Added.
    * platform/mac/fast/lists/005-vertical-expected.txt: Added.
    * platform/mac/fast/lists/006-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/006-vertical-expected.png: Added.
    * platform/mac/fast/lists/006-vertical-expected.txt: Added.
    * platform/mac/fast/lists/007-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/007-vertical-expected.png: Added.
    * platform/mac/fast/lists/007-vertical-expected.txt: Added.
    * platform/mac/fast/lists/008-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/008-vertical-expected.png: Added.
    * platform/mac/fast/lists/008-vertical-expected.txt: Added.
    * platform/mac/fast/lists/009-vertical-expected.checksum: Added.
    * platform/mac/fast/lists/009-vertical-expected.png: Added.
    * platform/mac/fast/lists/009-vertical-expected.txt: Added.
    * platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png:
    * platform/mac/fast/lists/markers-in-selection-expected.checksum:
    * platform/mac/fast/lists/markers-in-selection-expected.png:
    * platform/mac/fast/lists/ol-start-parsing-expected.checksum:
    * platform/mac/fast/lists/ol-start-parsing-expected.png:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71700 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d4a3ea7..29e27f3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,60 @@
+2010-11-09  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49202
+        
+        Make lists work with vertical text.
+        
+        (1) Patch all the CSS rules in html.css so that the margins are directionally abstract.
+        (2) Add a transposedRect and transposedSize method to IntRect and IntSize for swapping x/y and width/height.
+        (3) Add adjustLineDirectionPosition as a helper for moving a line box only in the line direction.
+        (4) Fix a bug in addIntrudingFLoats uncovered by list test cases where the top margin of an element was being
+        incorrectly added to a float's physical left side instead of its top side.
+        (5) Make positioning and painting and selection of list markers account for all writing modes.
+        (6) Add helpers for setting the start and end margins directly in a RenderStyle, since lists do this to hack
+        marker margins before they have been calculated and set on the box.
+        
+        Cloned a bunch of fast/lists tests into fast/lists/*-vertical.html versions.
+
+        * fast/lists/001-vertical.html: Added.
+        * fast/lists/002-vertical.html: Added.
+        * fast/lists/003-vertical.html: Added.
+        * fast/lists/005-vertical.html: Added.
+        * fast/lists/006-vertical.html: Added.
+        * fast/lists/007-vertical.html: Added.
+        * fast/lists/008-vertical.html: Added.
+        * fast/lists/009-vertical.html: Added.
+        * platform/mac/fast/lists/001-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/001-vertical-expected.png: Added.
+        * platform/mac/fast/lists/001-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/002-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/002-vertical-expected.png: Added.
+        * platform/mac/fast/lists/002-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/003-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/003-vertical-expected.png: Added.
+        * platform/mac/fast/lists/003-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/005-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/005-vertical-expected.png: Added.
+        * platform/mac/fast/lists/005-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/006-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/006-vertical-expected.png: Added.
+        * platform/mac/fast/lists/006-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/007-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/007-vertical-expected.png: Added.
+        * platform/mac/fast/lists/007-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/008-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/008-vertical-expected.png: Added.
+        * platform/mac/fast/lists/008-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/009-vertical-expected.checksum: Added.
+        * platform/mac/fast/lists/009-vertical-expected.png: Added.
+        * platform/mac/fast/lists/009-vertical-expected.txt: Added.
+        * platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png:
+        * platform/mac/fast/lists/markers-in-selection-expected.checksum:
+        * platform/mac/fast/lists/markers-in-selection-expected.png:
+        * platform/mac/fast/lists/ol-start-parsing-expected.checksum:
+        * platform/mac/fast/lists/ol-start-parsing-expected.png:
+
 2010-11-09  Mihai Parparita  <mihaip at chromium.org>
 
         Unreviewed Chromium test_expectations.txt update.
diff --git a/LayoutTests/fast/lists/001-vertical.html b/LayoutTests/fast/lists/001-vertical.html
new file mode 100644
index 0000000..003fdc5
--- /dev/null
+++ b/LayoutTests/fast/lists/001-vertical.html
@@ -0,0 +1,30 @@
+<html style="-webkit-writing-mode:vertical-lr">
+<head>
+<style>
+div {
+   border: solid orange; padding: 0.5em 0.5em 0.5em 0.5em;
+   display: list-item;
+ }
+ 
+ .float {
+   float: left;
+   margin-bottom: 2em;
+   width:100px;
+   height:100px;
+   background-color: orange;
+ }
+</style>
+<body>
+<div style="display:block">
+ <div class="float"></div>
+ <div>
+  <div>
+   <div>
+    List item text.
+   </div>
+  </div>
+ </div>
+</div>
+
+<ul><li style="direction: rtl; border:2px solid red; padding:50px">Foo fofodfosjlkdf
+dslkdjlk asdlksjald djklsd klasjdkas sdajd lsadjkl asjdlksajdk </ul>
diff --git a/LayoutTests/fast/lists/002-vertical.html b/LayoutTests/fast/lists/002-vertical.html
new file mode 100644
index 0000000..7f3dc4e
--- /dev/null
+++ b/LayoutTests/fast/lists/002-vertical.html
@@ -0,0 +1,22 @@
+<html style="-webkit-writing-mode:vertical-rl">
+<head>
+<title>Safari test case: list items within text-align: right div</title>
+<style type="text/css">
+#menu {
+  text-align: right;
+}
+</style>
+</head>
+<body>
+<div id="menu">
+<ul>
+<li><a href="/">Home</a></li>
+<li><a href="/archives/">Archives</a></li>
+</ul>
+</div>
+
+<p>This test case illustrates the correct positioning of list item bullets according to CSS3.  The bullets should be on the far left, with the text of the list items on the far right.
+</p>
+</body>
+
+</html>
diff --git a/LayoutTests/fast/lists/003-vertical.html b/LayoutTests/fast/lists/003-vertical.html
new file mode 100644
index 0000000..92d511e
--- /dev/null
+++ b/LayoutTests/fast/lists/003-vertical.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html style="-webkit-writing-mode:vertical-lr" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<title>Safari test case: list items within text-align: right div after float:left div</title>
+<style type="text/css">
+#main {
+  float: left;
+  height: 60%;
+}
+
+#menu {
+  text-align: right;
+}
+</style>
+</head>
+<body>
+<div id="main">
+<p>This test case illustrates incorrect positioning of list items within a <code>text-align: right</code> div after a <code>float: left</code> div.  <a href="float-left-chimera.png">Screenshot of correct behavior</a>; <a href="float-left-safari.png">screenshot of Safari</a>.</p>
+
+<p>This bug only occurs on pages with a standards-compliant DOCTYPE.  <a href="float-left-text-align-right-no-doctype.html">View this test case without a DOCTYPE</a>.</p>
+
+<ol>
+<li>New larger PowerBook.  Still 1 GHz, but with a 17-inch screen. $3299.</li>
+<li>New smaller PowerBook, with a 12-inch screen.  $1799.</li>
+<li>New browser: <a href="http://www.apple.com/safari/">Safari</a>.  Engine is <a href="http://developer.apple.com/darwin/projects/webcore/">open source</a> (a <a href="http://lists.kde.org/?l=kfm-devel&amp;m=104196912316326&amp;w=2">modified version</a> of <a href="http://developer.kde.org/documentation/library/kdeqt/kde3arch/khtml/">KHTML</a>), rest of the application is free but not open source (just like the OS).  Only runs on 10.2.  Currently in public beta.</li>
+<li>New presentation software: Keynote.  The software Steve Jobs uses.</li>
+<li>New versions of <a href="http://www.apple.com/imovie/">iMovie</a>, <a href="http://www.apple.com/iphoto/">iPhoto</a>, <a href="http://www.apple.com/itunes/">iTunes</a>.  Bundled into a box called <a href="http://www.apple.com/ilife/">iLife</a>, for $49.</li>
+<li><a href="http://www.apple.com/finalcutexpress/">Final Cut Express</a> for creating DVDs.  $299.</li>
+</ol>
+
+
+</div> <!--main-->
+
+<div id="menu">
+<ul>
+<li><a title="about this site" href="/about/" accesskey="9" rel="help">About</a></li>
+<li><a title="a little of everything" href="/sitemap.html">Site map</a></li>
+<li><a title="old posts" href="/archives/" rel="contents">Archives</a></li>
+<li><a title="small projects, scripts, fun stuff" href="/projects/">Projects</a></li>
+<li><a title="cat pictures and stuff" href="/pictures/">Photos</a></li>
+<li><a title="referrers and other visitor statistics" href="/stats/">Statistics</a></li>
+<li><a title="accessibility features of this site" href="/accessibility_statement.html" accesskey="0">Accessibility statement</a></li>
+<li><a title="syndicated version of &quot;dive into mark&quot; in RSS format" href="/xml/rss.xml">RSS</a> (<a title="other syndicated feeds" href="/xml/">more feeds</a>)</li>
+</ul>
+<ul>
+<li><a title="Mark Pilgrim's new column, Dive Into XML, explores the RSS menagerie" href="http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html">What is RSS?</a></li>
+</ul>
+<ul>
+<li><a title="Free validator for syndicated content producers" href="http://feeds.archive.org/validator/">RSS Validator</a></li>
+<li><a title="Free book for web designers" href="http://diveintoaccessibility.org/">Dive Into Accessibility</a></li>
+<li><a title="Free repository for Mac OS X system administrators" href="http://diveintoosx.org/">Dive Into OS X</a></li>
+<li><a title="Free J2EE training material" href="http://j2ee.masslight.com/">Dive Into J2EE</a></li>
+<li><a title="Free Python book for experienced programmers" href="http://diveintopython.org/">Dive Into Python</a></li> 
+<li><a title="web design, J2EE, Mac OS X, Python expertise -- available for contract work and training" href="/resume/">r&eacute;sum&eacute;</a></li>
+</ul>
+</div> <!--menu-->
+
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/lists/005-vertical.html b/LayoutTests/fast/lists/005-vertical.html
new file mode 100644
index 0000000..8ee6c77
--- /dev/null
+++ b/LayoutTests/fast/lists/005-vertical.html
@@ -0,0 +1,10 @@
+<html style="-webkit-writing-mode:vertical-rl">
+<body>
+<ul>
+<li></li>
+<li></li>
+<li>There should be two bullets with no text above me.
+</ul>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/lists/006-vertical.html b/LayoutTests/fast/lists/006-vertical.html
new file mode 100644
index 0000000..461b9e1
--- /dev/null
+++ b/LayoutTests/fast/lists/006-vertical.html
@@ -0,0 +1,6 @@
+<html style="-webkit-writing-mode:vertical-rl">
+<body>
+<ol>
+<li> <i><u>Hello world</u></i> <ol><li>Goodbye</li></ol>
+</li>
+</ol>
diff --git a/LayoutTests/fast/lists/007-vertical.html b/LayoutTests/fast/lists/007-vertical.html
new file mode 100644
index 0000000..e2477aa
--- /dev/null
+++ b/LayoutTests/fast/lists/007-vertical.html
@@ -0,0 +1,13 @@
+<html style="-webkit-writing-mode:vertical-rl">
+<head>
+<style type="text/css">
+.two {padding-top: 25px; border-top: 25px solid green; background-color: aqua;}
+</style>
+</head>
+<body>
+<UL class="two" style="background-color: gray;">
+<LI>The top padding on this unordered list has been set to 25 pixels, which will require some extra test in order to test.</LI>
+<LI class="two" style="background-color: white;">Another list item might not be such a bad idea, either, considering that such things do need to be double-checked.  This list item has its left padding also set to 25 pixels, which should combine with the list's padding to make 50 pixels of margin.
+</UL>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/lists/008-vertical.html b/LayoutTests/fast/lists/008-vertical.html
new file mode 100644
index 0000000..20a1fac
--- /dev/null
+++ b/LayoutTests/fast/lists/008-vertical.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML style="-webkit-writing-mode:vertical-lr">
+<HEAD>
+<TITLE>lists with direction:rtl</TITLE>
+<style>
+li { border:5px solid orange; padding:5px; }
+.img { list-style-image: url(resources/white.gif) }
+</style>
+</HEAD>
+<BODY>
+<UL style="height:20ex; border:1px blue solid;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</UL>
+<UL style="direction:rtl; height:20ex; border:1px red solid;">
+<LI>First item<LI>Second and very very long item<LI>Third item</UL>
+<UL style="height:20ex; border:1px blue solid; list-style-position:inside;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</UL>
+<UL style="direction:rtl; height:20ex; border:1px red solid; list-style-position:inside;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</UL>
+
+
+
+<UL class=img style="height:20ex; border:1px blue solid;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</UL>
+<UL class=img style="direction:rtl; height:20ex; border:1px red solid;">
+<LI>First item<LI>Second and very very long item<LI>Third item</UL>
+<UL class=img style="height:20ex; border:1px blue solid; list-style-position:inside;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</UL>
+<UL class=img style="direction:rtl; height:20ex; border:1px red solid; list-style-position:inside;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</UL>
+
+<OL style="height:20ex; border:1px blue solid;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</OL>
+<OL style="direction:rtl; height:20ex; border:1px red solid;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</OL>
+<OL style="height:20ex; border:1px blue solid; list-style-position:inside;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</OL>
+<OL style="direction:rtl; height:20ex; border:1px red solid; list-style-position:inside;">
+<LI>First item
+<LI>Second and very very long item
+<LI>Third item
+</OL>
+
+</BODY>
+</HTML>
\ No newline at end of file
diff --git a/LayoutTests/fast/lists/009-vertical.html b/LayoutTests/fast/lists/009-vertical.html
new file mode 100644
index 0000000..a1bed0f
--- /dev/null
+++ b/LayoutTests/fast/lists/009-vertical.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html style="-webkit-writing-mode:vertical-rl">
+<head>
+    <title>A List Apart</title>
+
+<style type="text/css">
+
+
+#subnav ul	{
+	
+	padding: 0;
+	
+	}
+	
+#subnav ul li	{
+	list-style: disc url(resources/listmark.gif) inside;
+	
+	}	
+
+#subnav dd 	{
+	margin: 0;
+	}   	
+
+</style>
+
+
+
+</head>
+
+<body>
+
+
+
+<div id="subnav">
+
+<dl>
+<dt>DT text is rendered here</dt>
+<dd>
+<ul>
+<li>LI text is here too</li>
+
+</ul>
+</dd>
+</dl>
+
+
+
+
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/001-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/001-vertical-expected.checksum
new file mode 100644
index 0000000..2d8b748
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/001-vertical-expected.checksum
@@ -0,0 +1 @@
+f7a10f5053c0cd7b2a915412c74e411e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/001-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/001-vertical-expected.png
new file mode 100644
index 0000000..49e0a5b
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/001-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/001-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/001-vertical-expected.txt
new file mode 100644
index 0000000..f0dceb5
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/001-vertical-expected.txt
@@ -0,0 +1,21 @@
+layer at (0,0) size 785x620
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x620
+  RenderBlock {HTML} at (0,0) size 785x600
+    RenderBody {BODY} at (8,8) size 761x584
+      RenderBlock {DIV} at (0,0) size 106x584 [border: (3px solid #FFA500)]
+        RenderBlock (floating) {DIV} at (11,11) size 122x122 [bgcolor=#FFA500] [border: (3px solid #FFA500)]
+        RenderListItem {DIV} at (11,11) size 84x562 [border: (3px solid #FFA500)]
+          RenderListItem {DIV} at (11,11) size 62x540 [border: (3px solid #FFA500)]
+            RenderListItem {DIV} at (11,11) size 40x518 [border: (3px solid #FFA500)]
+              RenderListMarker at (11,104) size 18x7: bullet
+              RenderListMarker at (11,104) size 18x7: bullet
+              RenderListMarker at (11,104) size 18x7: bullet
+              RenderText {#text} at (11,132) size 18x86
+                text run at (11,132) width 86: "List item text."
+      RenderBlock {UL} at (122,0) size 140x584
+        RenderListItem {LI} at (0,40) size 140x544 [border: (2px solid #FF0000)]
+          RenderListMarker at (52,554) size 18x7: bullet
+          RenderText {#text} at (52,75) size 36x417
+            text run at (52,75) width 417: "Foo fofodfosjlkdf dslkdjlk asdlksjald djklsd klasjdkas sdajd lsadjkl"
+            text run at (70,422) width 70: "asjdlksajdk"
diff --git a/LayoutTests/platform/mac/fast/lists/002-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/002-vertical-expected.checksum
new file mode 100644
index 0000000..ddbdeb5
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/002-vertical-expected.checksum
@@ -0,0 +1 @@
+c8cecd691c7bd29d8bebb3bbff4d4e6c
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/002-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/002-vertical-expected.png
new file mode 100644
index 0000000..7f4daa4
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/002-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/002-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/002-vertical-expected.txt
new file mode 100644
index 0000000..5c69dec
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/002-vertical-expected.txt
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 36x584
+        RenderBlock {UL} at (0,0) size 36x584
+          RenderListItem {LI} at (0,40) size 18x544
+            RenderListMarker at (0,-17) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x39 [color=#0000EE]
+              RenderText {#text} at (0,505) size 18x39
+                text run at (0,505) width 39: "Home"
+          RenderListItem {LI} at (18,40) size 18x544
+            RenderListMarker at (0,-17) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x57 [color=#0000EE]
+              RenderText {#text} at (0,487) size 18x57
+                text run at (0,487) width 57: "Archives"
+      RenderBlock {P} at (52,16) size 36x552
+        RenderText {#text} at (0,0) size 36x533
+          text run at (0,0) width 533: "This test case illustrates the correct positioning of list item bullets according to CSS3."
+          text run at (18,0) width 509: "The bullets should be on the far left, with the text of the list items on the far right."
diff --git a/LayoutTests/platform/mac/fast/lists/003-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/003-vertical-expected.checksum
new file mode 100644
index 0000000..6841096
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/003-vertical-expected.checksum
@@ -0,0 +1 @@
+8ea39c2cea378fe2a063ce9a79663813
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/003-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/003-vertical-expected.png
new file mode 100644
index 0000000..012853e
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/003-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/003-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/003-vertical-expected.txt
new file mode 100644
index 0000000..fcecfa5
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/003-vertical-expected.txt
@@ -0,0 +1,207 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 426x600
+  RenderBlock {HTML} at (0,0) size 334x600
+    RenderBody {BODY} at (16,8) size 302x584
+      RenderBlock (floating) {DIV} at (0,0) size 410x350
+        RenderBlock {P} at (0,16) size 72x318
+          RenderText {#text} at (0,0) size 36x297
+            text run at (0,0) width 297: "This test case illustrates incorrect positioning of"
+            text run at (18,0) width 114: "list items within a "
+          RenderInline {CODE} at (0,0) size 15x136
+            RenderText {#text} at (19,114) size 15x136
+              text run at (19,114) width 136: "text-align: right"
+          RenderText {#text} at (18,250) size 18x67
+            text run at (18,250) width 67: " div after a"
+          RenderInline {CODE} at (0,0) size 15x88
+            RenderText {#text} at (37,0) size 15x88
+              text run at (37,0) width 88: "float: left"
+          RenderText {#text} at (36,88) size 18x32
+            text run at (36,88) width 32: " div. "
+          RenderInline {A} at (0,0) size 18x192 [color=#0000EE]
+            RenderText {#text} at (36,120) size 18x192
+              text run at (36,120) width 192: "Screenshot of correct behavior"
+          RenderText {#text} at (36,312) size 18x4
+            text run at (36,312) width 4: ";"
+          RenderInline {A} at (0,0) size 18x124 [color=#0000EE]
+            RenderText {#text} at (54,0) size 18x124
+              text run at (54,0) width 124: "screenshot of Safari"
+          RenderText {#text} at (54,124) size 18x4
+            text run at (54,124) width 4: "."
+        RenderBlock {P} at (72,16) size 54x318
+          RenderText {#text} at (0,0) size 36x304
+            text run at (0,0) width 304: "This bug only occurs on pages with a standards-"
+            text run at (18,0) width 150: "compliant DOCTYPE. "
+          RenderInline {A} at (0,0) size 36x267 [color=#0000EE]
+            RenderText {#text} at (18,150) size 36x267
+              text run at (18,150) width 117: "View this test case"
+              text run at (36,0) width 139: "without a DOCTYPE"
+          RenderText {#text} at (36,139) size 18x4
+            text run at (36,139) width 4: "."
+        RenderBlock {OL} at (142,0) size 252x350
+          RenderListItem {LI} at (0,40) size 36x310
+            RenderListMarker at (0,-20) size 18x16: "1"
+            RenderText {#text} at (0,0) size 36x302
+              text run at (0,0) width 159: "New larger PowerBook. "
+              text run at (0,159) width 143: "Still 1 GHz, but with a"
+              text run at (18,0) width 144: "17-inch screen. $3299."
+          RenderListItem {LI} at (36,40) size 36x310
+            RenderListMarker at (0,-20) size 18x16: "2"
+            RenderText {#text} at (0,0) size 36x307
+              text run at (0,0) width 307: "New smaller PowerBook, with a 12-inch screen."
+              text run at (18,0) width 44: "$1799."
+          RenderListItem {LI} at (72,40) size 90x310
+            RenderListMarker at (0,-20) size 18x16: "3"
+            RenderText {#text} at (0,0) size 18x94
+              text run at (0,0) width 94: "New browser: "
+            RenderInline {A} at (0,0) size 18x37 [color=#0000EE]
+              RenderText {#text} at (0,94) size 18x37
+                text run at (0,94) width 37: "Safari"
+            RenderText {#text} at (0,131) size 18x71
+              text run at (0,131) width 8: ". "
+              text run at (0,139) width 63: "Engine is "
+            RenderInline {A} at (0,0) size 18x76 [color=#0000EE]
+              RenderText {#text} at (0,202) size 18x76
+                text run at (0,202) width 76: "open source"
+            RenderText {#text} at (0,278) size 18x16
+              text run at (0,278) width 16: " (a"
+            RenderInline {A} at (0,0) size 18x106 [color=#0000EE]
+              RenderText {#text} at (18,0) size 18x106
+                text run at (18,0) width 106: "modified version"
+            RenderText {#text} at (18,106) size 18x21
+              text run at (18,106) width 21: " of "
+            RenderInline {A} at (0,0) size 18x58 [color=#0000EE]
+              RenderText {#text} at (18,127) size 18x58
+                text run at (18,127) width 58: "KHTML"
+            RenderText {#text} at (18,185) size 72x299
+              text run at (18,185) width 75: "), rest of the"
+              text run at (36,0) width 297: "application is free but not open source (just like"
+              text run at (54,0) width 57: "the OS). "
+              text run at (54,57) width 123: "Only runs on 10.2. "
+              text run at (54,180) width 119: "Currently in public"
+              text run at (72,0) width 30: "beta."
+          RenderListItem {LI} at (162,40) size 36x310
+            RenderListMarker at (0,-20) size 18x16: "4"
+            RenderText {#text} at (0,0) size 36x264
+              text run at (0,0) width 239: "New presentation software: Keynote. "
+              text run at (0,239) width 25: "The"
+              text run at (18,0) width 160: "software Steve Jobs uses."
+          RenderListItem {LI} at (198,40) size 36x310
+            RenderListMarker at (0,-20) size 18x16: "5"
+            RenderText {#text} at (0,0) size 18x108
+              text run at (0,0) width 108: "New versions of "
+            RenderInline {A} at (0,0) size 18x45 [color=#0000EE]
+              RenderText {#text} at (0,108) size 18x45
+                text run at (0,108) width 45: "iMovie"
+            RenderText {#text} at (0,153) size 18x8
+              text run at (0,153) width 8: ", "
+            RenderInline {A} at (0,0) size 18x41 [color=#0000EE]
+              RenderText {#text} at (0,161) size 18x41
+                text run at (0,161) width 41: "iPhoto"
+            RenderText {#text} at (0,202) size 18x8
+              text run at (0,202) width 8: ", "
+            RenderInline {A} at (0,0) size 18x43 [color=#0000EE]
+              RenderText {#text} at (0,210) size 18x43
+                text run at (0,210) width 43: "iTunes"
+            RenderText {#text} at (0,253) size 36x257
+              text run at (0,253) width 4: "."
+              text run at (18,0) width 166: "Bundled into a box called "
+            RenderInline {A} at (0,0) size 18x30 [color=#0000EE]
+              RenderText {#text} at (18,166) size 18x30
+                text run at (18,166) width 30: "iLife"
+            RenderText {#text} at (18,196) size 18x58
+              text run at (18,196) width 58: ", for $49."
+          RenderListItem {LI} at (234,40) size 18x310
+            RenderListMarker at (0,-20) size 18x16: "6"
+            RenderInline {A} at (0,0) size 18x113 [color=#0000EE]
+              RenderText {#text} at (0,0) size 18x113
+                text run at (0,0) width 113: "Final Cut Express"
+            RenderText {#text} at (0,113) size 18x166
+              text run at (0,113) width 130: " for creating DVDs. "
+              text run at (0,243) width 36: "$299."
+      RenderBlock {DIV} at (0,0) size 302x584
+        RenderBlock {UL} at (0,0) size 144x584
+          RenderListItem {LI} at (0,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x40 [color=#0000EE]
+              RenderText {#text} at (0,504) size 18x40
+                text run at (0,504) width 40: "About"
+          RenderListItem {LI} at (18,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x55 [color=#0000EE]
+              RenderText {#text} at (0,489) size 18x55
+                text run at (0,489) width 55: "Site map"
+          RenderListItem {LI} at (36,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x57 [color=#0000EE]
+              RenderText {#text} at (0,487) size 18x57
+                text run at (0,487) width 57: "Archives"
+          RenderListItem {LI} at (54,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x50 [color=#0000EE]
+              RenderText {#text} at (0,494) size 18x50
+                text run at (0,494) width 50: "Projects"
+          RenderListItem {LI} at (72,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x43 [color=#0000EE]
+              RenderText {#text} at (0,501) size 18x43
+                text run at (0,501) width 43: "Photos"
+          RenderListItem {LI} at (90,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x55 [color=#0000EE]
+              RenderText {#text} at (0,489) size 18x55
+                text run at (0,489) width 55: "Statistics"
+          RenderListItem {LI} at (108,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x144 [color=#0000EE]
+              RenderText {#text} at (0,400) size 18x144
+                text run at (0,400) width 144: "Accessibility statement"
+          RenderListItem {LI} at (126,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x29 [color=#0000EE]
+              RenderText {#text} at (0,432) size 18x29
+                text run at (0,432) width 29: "RSS"
+            RenderText {#text} at (0,461) size 18x9
+              text run at (0,461) width 9: " ("
+            RenderInline {A} at (0,0) size 18x69 [color=#0000EE]
+              RenderText {#text} at (0,470) size 18x69
+                text run at (0,470) width 69: "more feeds"
+            RenderText {#text} at (0,539) size 18x5
+              text run at (0,539) width 5: ")"
+        RenderBlock {UL} at (160,0) size 18x584
+          RenderListItem {LI} at (0,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x88 [color=#0000EE]
+              RenderText {#text} at (0,456) size 18x88
+                text run at (0,456) width 88: "What is RSS?"
+        RenderBlock {UL} at (194,0) size 108x584
+          RenderListItem {LI} at (0,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x92 [color=#0000EE]
+              RenderText {#text} at (0,452) size 18x92
+                text run at (0,452) width 92: "RSS Validator"
+          RenderListItem {LI} at (18,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x145 [color=#0000EE]
+              RenderText {#text} at (0,399) size 18x145
+                text run at (0,399) width 145: "Dive Into Accessibility"
+          RenderListItem {LI} at (36,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x101 [color=#0000EE]
+              RenderText {#text} at (0,443) size 18x101
+                text run at (0,443) width 101: "Dive Into OS X"
+          RenderListItem {LI} at (54,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x98 [color=#0000EE]
+              RenderText {#text} at (0,446) size 18x98
+                text run at (0,446) width 98: "Dive Into J2EE"
+          RenderListItem {LI} at (72,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x109 [color=#0000EE]
+              RenderText {#text} at (0,435) size 18x109
+                text run at (0,435) width 109: "Dive Into Python"
+          RenderListItem {LI} at (90,40) size 18x544
+            RenderListMarker at (0,293) size 18x7: bullet
+            RenderInline {A} at (0,0) size 18x45 [color=#0000EE]
+              RenderText {#text} at (0,499) size 18x45
+                text run at (0,499) width 45: "r\x{E9}sum\x{E9}"
diff --git a/LayoutTests/platform/mac/fast/lists/005-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/005-vertical-expected.checksum
new file mode 100644
index 0000000..f8e80f3
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/005-vertical-expected.checksum
@@ -0,0 +1 @@
+347ac394fad7a08e24e3c5ea1390d957
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/005-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/005-vertical-expected.png
new file mode 100644
index 0000000..15a5f9f
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/005-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/005-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/005-vertical-expected.txt
new file mode 100644
index 0000000..414958f
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/005-vertical-expected.txt
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 776x584
+      RenderBlock {UL} at (0,0) size 54x584
+        RenderListItem {LI} at (0,40) size 18x544
+          RenderListMarker at (0,-17) size 18x7: bullet
+        RenderListItem {LI} at (18,40) size 18x544
+          RenderListMarker at (0,-17) size 18x7: bullet
+        RenderListItem {LI} at (36,40) size 18x544
+          RenderListMarker at (0,-17) size 18x7: bullet
+          RenderText {#text} at (0,0) size 18x323
+            text run at (0,0) width 323: "There should be two bullets with no text above me."
diff --git a/LayoutTests/platform/mac/fast/lists/006-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/006-vertical-expected.checksum
new file mode 100644
index 0000000..d5ed511
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/006-vertical-expected.checksum
@@ -0,0 +1 @@
+a393f97559e8bad2b535a87d551e762d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/006-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/006-vertical-expected.png
new file mode 100644
index 0000000..9c4b196
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/006-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/006-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/006-vertical-expected.txt
new file mode 100644
index 0000000..002f78b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/006-vertical-expected.txt
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 776x584
+      RenderBlock {OL} at (0,0) size 36x584
+        RenderListItem {LI} at (0,40) size 36x544
+          RenderBlock (anonymous) at (0,0) size 18x544
+            RenderListMarker at (0,-20) size 18x16: "1"
+            RenderInline {I} at (0,0) size 18x76
+              RenderInline {U} at (0,0) size 18x76
+                RenderText {#text} at (0,0) size 18x76
+                  text run at (0,0) width 76: "Hello world"
+            RenderText {#text} at (0,0) size 0x0
+          RenderBlock {OL} at (18,0) size 18x544
+            RenderListItem {LI} at (0,40) size 18x504
+              RenderListMarker at (0,-20) size 18x16: "1"
+              RenderText {#text} at (0,0) size 18x59
+                text run at (0,0) width 59: "Goodbye"
diff --git a/LayoutTests/platform/mac/fast/lists/007-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/007-vertical-expected.checksum
new file mode 100644
index 0000000..8cc7021
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/007-vertical-expected.checksum
@@ -0,0 +1 @@
+60d5795a1a0a87622e3d56d64ce2cd7f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/007-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/007-vertical-expected.png
new file mode 100644
index 0000000..2ae1a46
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/007-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/007-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/007-vertical-expected.txt
new file mode 100644
index 0000000..eaa6e0a
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/007-vertical-expected.txt
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 776x584
+      RenderBlock {UL} at (0,0) size 108x584 [bgcolor=#808080] [border: (25px solid #008000) none]
+        RenderListItem {LI} at (0,50) size 36x534
+          RenderListMarker at (0,-17) size 18x7: bullet
+          RenderText {#text} at (0,0) size 36x520
+            text run at (0,0) width 520: "The top padding on this unordered list has been set to 25 pixels, which will require"
+            text run at (18,0) width 191: "some extra test in order to test."
+        RenderListItem {LI} at (36,50) size 72x534 [bgcolor=#FFFFFF] [border: (25px solid #008000) none]
+          RenderListMarker at (0,-17) size 18x7: bullet
+          RenderText {#text} at (0,50) size 72x473
+            text run at (0,50) width 473: "Another list item might not be such a bad idea, either, considering that such"
+            text run at (18,50) width 239: "things do need to be double-checked. "
+            text run at (18,289) width 232: "This list item has its left padding also"
+            text run at (36,50) width 460: "set to 25 pixels, which should combine with the list's padding to make 50"
+            text run at (54,50) width 106: "pixels of margin."
diff --git a/LayoutTests/platform/mac/fast/lists/008-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/008-vertical-expected.checksum
new file mode 100644
index 0000000..68d525d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/008-vertical-expected.checksum
@@ -0,0 +1 @@
+9c513c74f48355e9a044c04328c2326d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/008-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/008-vertical-expected.png
new file mode 100644
index 0000000..d456e5e
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/008-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/008-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/008-vertical-expected.txt
new file mode 100644
index 0000000..fa54865
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/008-vertical-expected.txt
@@ -0,0 +1,173 @@
+layer at (0,0) size 1808x585
+  RenderView at (0,0) size 800x585
+layer at (0,0) size 1808x585
+  RenderBlock {HTML} at (0,0) size 1808x585
+    RenderBody {BODY} at (8,8) size 1784x569
+      RenderBlock {UL} at (0,0) size 134x195 [border: (1px solid #0000FF)]
+        RenderListItem {LI} at (1,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,-17) size 18x7: bullet
+          RenderText {#text} at (10,10) size 18x59
+            text run at (10,10) width 59: "First item"
+        RenderListItem {LI} at (39,41) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,-17) size 18x7: bullet
+          RenderText {#text} at (10,10) size 36x106
+            text run at (10,10) width 106: "Second and very"
+            text run at (28,10) width 91: "very long item"
+        RenderListItem {LI} at (95,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,-17) size 18x7: bullet
+          RenderText {#text} at (10,10) size 18x66
+            text run at (10,10) width 66: "Third item"
+      RenderBlock {UL} at (150,0) size 134x195 [border: (1px solid #FF0000)]
+        RenderListItem {LI} at (1,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,163) size 18x7: bullet
+          RenderText {#text} at (10,84) size 18x59
+            text run at (10,84) width 59: "First item"
+        RenderListItem {LI} at (39,1) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,163) size 18x7: bullet
+          RenderText {#text} at (10,37) size 36x106
+            text run at (10,37) width 106: "Second and very"
+            text run at (28,52) width 91: "very long item"
+        RenderListItem {LI} at (95,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,163) size 18x7: bullet
+          RenderText {#text} at (10,77) size 18x66
+            text run at (10,77) width 66: "Third item"
+      RenderBlock {UL} at (300,0) size 134x195 [border: (1px solid #0000FF)]
+        RenderListItem {LI} at (1,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,9) size 18x7: bullet
+          RenderText {#text} at (10,24) size 18x59
+            text run at (10,24) width 59: "First item"
+        RenderListItem {LI} at (39,41) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,9) size 18x7: bullet
+          RenderText {#text} at (10,24) size 36x120
+            text run at (10,24) width 106: "Second and very"
+            text run at (28,10) width 91: "very long item"
+        RenderListItem {LI} at (95,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,9) size 18x7: bullet
+          RenderText {#text} at (10,24) size 18x66
+            text run at (10,24) width 66: "Third item"
+      RenderBlock {UL} at (450,0) size 134x195 [border: (1px solid #FF0000)]
+        RenderListItem {LI} at (1,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,137) size 18x7: bullet
+          RenderText {#text} at (10,70) size 18x59
+            text run at (10,70) width 59: "First item"
+        RenderListItem {LI} at (39,1) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,137) size 18x7: bullet
+          RenderText {#text} at (10,23) size 36x120
+            text run at (10,23) width 106: "Second and very"
+            text run at (28,52) width 91: "very long item"
+        RenderListItem {LI} at (95,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,137) size 18x7: bullet
+          RenderText {#text} at (10,63) size 18x66
+            text run at (10,63) width 66: "Third item"
+      RenderBlock {UL} at (600,0) size 134x195 [border: (1px solid #0000FF)]
+        RenderListItem {LI} at (1,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,-17) size 10x10
+          RenderText {#text} at (10,10) size 18x59
+            text run at (10,10) width 59: "First item"
+        RenderListItem {LI} at (39,41) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,-17) size 10x10
+          RenderText {#text} at (10,10) size 36x106
+            text run at (10,10) width 106: "Second and very"
+            text run at (28,10) width 91: "very long item"
+        RenderListItem {LI} at (95,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,-17) size 10x10
+          RenderText {#text} at (10,10) size 18x66
+            text run at (10,10) width 66: "Third item"
+      RenderBlock {UL} at (750,0) size 134x195 [border: (1px solid #FF0000)]
+        RenderListItem {LI} at (1,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,160) size 10x10
+          RenderText {#text} at (10,84) size 18x59
+            text run at (10,84) width 59: "First item"
+        RenderListItem {LI} at (39,1) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,160) size 10x10
+          RenderText {#text} at (10,37) size 36x106
+            text run at (10,37) width 106: "Second and very"
+            text run at (28,52) width 91: "very long item"
+        RenderListItem {LI} at (95,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,160) size 10x10
+          RenderText {#text} at (10,77) size 18x66
+            text run at (10,77) width 66: "Third item"
+      RenderBlock {UL} at (900,0) size 134x195 [border: (1px solid #0000FF)]
+        RenderListItem {LI} at (1,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,10) size 10x10
+          RenderText {#text} at (10,27) size 18x59
+            text run at (10,27) width 59: "First item"
+        RenderListItem {LI} at (39,41) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,10) size 10x10
+          RenderText {#text} at (10,27) size 36x123
+            text run at (10,27) width 106: "Second and very"
+            text run at (28,10) width 91: "very long item"
+        RenderListItem {LI} at (95,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,10) size 10x10
+          RenderText {#text} at (10,27) size 18x66
+            text run at (10,27) width 66: "Third item"
+      RenderBlock {UL} at (1050,0) size 134x195 [border: (1px solid #FF0000)]
+        RenderListItem {LI} at (1,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,133) size 10x10
+          RenderText {#text} at (10,67) size 18x59
+            text run at (10,67) width 59: "First item"
+        RenderListItem {LI} at (39,1) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,133) size 10x10
+          RenderText {#text} at (10,20) size 36x123
+            text run at (10,20) width 106: "Second and very"
+            text run at (28,52) width 91: "very long item"
+        RenderListItem {LI} at (95,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (14,133) size 10x10
+          RenderText {#text} at (10,60) size 18x66
+            text run at (10,60) width 66: "Third item"
+      RenderBlock {OL} at (1200,0) size 134x195 [border: (1px solid #0000FF)]
+        RenderListItem {LI} at (1,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,-20) size 18x16: "1"
+          RenderText {#text} at (10,10) size 18x59
+            text run at (10,10) width 59: "First item"
+        RenderListItem {LI} at (39,41) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,-20) size 18x16: "2"
+          RenderText {#text} at (10,10) size 36x106
+            text run at (10,10) width 106: "Second and very"
+            text run at (28,10) width 91: "very long item"
+        RenderListItem {LI} at (95,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,-20) size 18x16: "3"
+          RenderText {#text} at (10,10) size 18x66
+            text run at (10,10) width 66: "Third item"
+      RenderBlock {OL} at (1350,0) size 134x195 [border: (1px solid #FF0000)]
+        RenderListItem {LI} at (1,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,157) size 18x16: "1"
+          RenderText {#text} at (10,84) size 18x59
+            text run at (10,84) width 59: "First item"
+        RenderListItem {LI} at (39,1) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,157) size 18x16: "2"
+          RenderText {#text} at (10,37) size 36x106
+            text run at (10,37) width 106: "Second and very"
+            text run at (28,52) width 91: "very long item"
+        RenderListItem {LI} at (95,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,157) size 18x16: "3"
+          RenderText {#text} at (10,77) size 18x66
+            text run at (10,77) width 66: "Third item"
+      RenderBlock {OL} at (1500,0) size 134x195 [border: (1px solid #0000FF)]
+        RenderListItem {LI} at (1,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,10) size 18x16: "1"
+          RenderText {#text} at (10,26) size 18x59
+            text run at (10,26) width 59: "First item"
+        RenderListItem {LI} at (39,41) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,10) size 18x16: "2"
+          RenderText {#text} at (10,26) size 36x122
+            text run at (10,26) width 106: "Second and very"
+            text run at (28,10) width 91: "very long item"
+        RenderListItem {LI} at (95,41) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,10) size 18x16: "3"
+          RenderText {#text} at (10,26) size 18x66
+            text run at (10,26) width 66: "Third item"
+      RenderBlock {OL} at (1650,0) size 134x195 [border: (1px solid #FF0000)]
+        RenderListItem {LI} at (1,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,127) size 18x16: "1"
+          RenderText {#text} at (10,68) size 18x59
+            text run at (10,68) width 59: "First item"
+        RenderListItem {LI} at (39,1) size 56x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,127) size 18x16: "2"
+          RenderText {#text} at (10,21) size 36x122
+            text run at (10,21) width 106: "Second and very"
+            text run at (28,52) width 91: "very long item"
+        RenderListItem {LI} at (95,1) size 38x153 [border: (5px solid #FFA500)]
+          RenderListMarker at (10,127) size 18x16: "3"
+          RenderText {#text} at (10,61) size 18x66
+            text run at (10,61) width 66: "Third item"
diff --git a/LayoutTests/platform/mac/fast/lists/009-vertical-expected.checksum b/LayoutTests/platform/mac/fast/lists/009-vertical-expected.checksum
new file mode 100644
index 0000000..44c1d68
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/009-vertical-expected.checksum
@@ -0,0 +1 @@
+2627d451cc735d73ecf5e0bedc46b770
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/009-vertical-expected.png b/LayoutTests/platform/mac/fast/lists/009-vertical-expected.png
new file mode 100644
index 0000000..444ed41
Binary files /dev/null and b/LayoutTests/platform/mac/fast/lists/009-vertical-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/009-vertical-expected.txt b/LayoutTests/platform/mac/fast/lists/009-vertical-expected.txt
new file mode 100644
index 0000000..ad9295a
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/lists/009-vertical-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 776x584
+      RenderBlock {DIV} at (0,0) size 52x584
+        RenderBlock {DL} at (0,0) size 52x584
+          RenderBlock {DT} at (0,0) size 18x584
+            RenderText {#text} at (0,0) size 18x153
+              text run at (0,0) width 153: "DT text is rendered here"
+          RenderBlock {DD} at (34,0) size 18x584
+            RenderBlock {UL} at (0,0) size 18x584
+              RenderListItem {LI} at (0,0) size 18x584
+                RenderListMarker at (2,0) size 12x9
+                RenderText {#text} at (0,16) size 18x111
+                  text run at (0,16) width 111: "LI text is here too"
diff --git a/LayoutTests/platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png b/LayoutTests/platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png
index 4c8d038..83a3eb1 100644
Binary files a/LayoutTests/platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png and b/LayoutTests/platform/mac/fast/lists/inlineBoxWrapperNullCheck-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.checksum b/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.checksum
index 4a0fc2b..4ac2ee8 100644
--- a/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.checksum
+++ b/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.checksum
@@ -1 +1 @@
-1cec2ec7d8497014137c5221931c3d4b
\ No newline at end of file
+1b36d8625b23796c6ef10fa74cf48f83
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.png b/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.png
index dc8c18b..1718a7a 100644
Binary files a/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.png and b/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.checksum b/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.checksum
index 77389e0..f4ec401 100644
--- a/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.checksum
+++ b/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.checksum
@@ -1 +1 @@
-e9517dd81548786fcb7a6ee7c2a613a5
\ No newline at end of file
+01a0b10f5af80efe3ac97dbb435009e1
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.png b/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.png
index b33b6a9..797e629 100644
Binary files a/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.png and b/LayoutTests/platform/mac/fast/lists/ol-start-parsing-expected.png differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7b189d7..1c23309 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,47 @@
+2010-11-09  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=49202
+        
+        Make lists work with vertical text.
+        
+        (1) Patch all the CSS rules in html.css so that the margins are directionally abstract.
+        (2) Add a transposedRect and transposedSize method to IntRect and IntSize for swapping x/y and width/height.
+        (3) Add adjustLineDirectionPosition as a helper for moving a line box only in the line direction.
+        (4) Fix a bug in addIntrudingFLoats uncovered by list test cases where the top margin of an element was being
+        incorrectly added to a float's physical left side instead of its top side.
+        (5) Make positioning and painting and selection of list markers account for all writing modes.
+        (6) Add helpers for setting the start and end margins directly in a RenderStyle, since lists do this to hack
+        marker margins before they have been calculated and set on the box.
+        
+        Cloned a bunch of fast/lists tests into fast/lists/*-vertical.html versions.
+        
+        * css/html.css:
+        * platform/graphics/IntRect.h:
+        (WebCore::IntRect::transposedRect):
+        * platform/graphics/IntSize.h:
+        (WebCore::IntSize::transposedSize):
+        * rendering/InlineBox.h:
+        (WebCore::InlineBox::adjustLineDirectionPosition):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addIntrudingFloats):
+        * rendering/RenderListItem.cpp:
+        (WebCore::getParentOfFirstLineBox):
+        (WebCore::RenderListItem::positionListMarker):
+        (WebCore::RenderListItem::paint):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::localSelectionRect):
+        (WebCore::RenderListMarker::paint):
+        (WebCore::RenderListMarker::layout):
+        (WebCore::RenderListMarker::computePreferredLogicalWidths):
+        (WebCore::RenderListMarker::updateMargins):
+        (WebCore::RenderListMarker::getRelativeMarkerRect):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::setMarginStart):
+        (WebCore::RenderStyle::setMarginEnd):
+        * rendering/style/RenderStyle.h:
+
 2010-11-09  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by Antti Koivisto.
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index a201adc..d091806 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -229,14 +229,20 @@ caption {
 ul, menu, dir {
     display: block;
     list-style-type: disc;
-    margin: 1__qem 0 1em 0;
+    -webkit-margin-before: 1__qem;
+    -webkit-margin-after: 1em;
+    -webkit-margin-start: 0;
+    -webkit-margin-end: 0;
     -webkit-padding-start: 40px
 }
 
 ol {
     display: block;
     list-style-type: decimal;
-    margin: 1__qem 0 1em 0;
+    -webkit-margin-before: 1__qem;
+    -webkit-margin-after: 1em;
+    -webkit-margin-start: 0;
+    -webkit-margin-end: 0;
     -webkit-padding-start: 40px
 }
 
@@ -259,7 +265,10 @@ dd {
 
 dl {
     display: block;
-    margin: 1__qem 0 1em 0
+    -webkit-margin-before: 1__qem;
+    -webkit-margin-after: 1em;
+    -webkit-margin-start: 0;
+    -webkit-margin-end: 0;
 }
 
 dt {
@@ -267,8 +276,8 @@ dt {
 }
 
 ol ul, ul ol, ul ul, ol ol {
-    margin-top: 0;
-    margin-bottom: 0
+    -webkit-margin-before: 0;
+    -webkit-margin-after: 0
 }
 
 /* form elements */
diff --git a/WebCore/platform/graphics/IntRect.h b/WebCore/platform/graphics/IntRect.h
index c8d7c71..e43e290 100644
--- a/WebCore/platform/graphics/IntRect.h
+++ b/WebCore/platform/graphics/IntRect.h
@@ -143,6 +143,8 @@ public:
     void inflate(int d) { inflateX(d); inflateY(d); }
     void scale(float s);
 
+    IntRect transposedRect() const { return IntRect(m_location.transposedPoint(), m_size.transposedSize()); }
+
 #if PLATFORM(WX)
     IntRect(const wxRect&);
     operator wxRect() const;
diff --git a/WebCore/platform/graphics/IntSize.h b/WebCore/platform/graphics/IntSize.h
index 9ecf389..9db2224 100644
--- a/WebCore/platform/graphics/IntSize.h
+++ b/WebCore/platform/graphics/IntSize.h
@@ -104,6 +104,11 @@ public:
         *this = expandedTo(IntSize());
     }
 
+    IntSize transposedSize() const
+    {
+        return IntSize(m_height, m_width);
+    }
+
 #if PLATFORM(CG)
     explicit IntSize(const CGSize&); // don't do this implicitly since it's lossy
     operator CGSize() const;
diff --git a/WebCore/rendering/InlineBox.h b/WebCore/rendering/InlineBox.h
index 72e5534..f79330a 100644
--- a/WebCore/rendering/InlineBox.h
+++ b/WebCore/rendering/InlineBox.h
@@ -113,6 +113,13 @@ public:
     virtual bool isLineBreak() const { return false; }
 
     virtual void adjustPosition(int dx, int dy);
+    void adjustLineDirectionPosition(int delta)
+    {
+        if (isHorizontal())
+            adjustPosition(delta, 0);
+        else
+            adjustPosition(0, delta);
+    }
 
     virtual void paint(PaintInfo&, int tx, int ty);
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 863b5a3..4f0df76 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3963,8 +3963,12 @@ void RenderBlock::addIntrudingFloats(RenderBlock* prev, int logicalLeftOffset, i
                 // above.  |logicalLeftOffset| will equal the margin in this case, so it's already been taken
                 // into account.  Only apply this code if prev is the parent, since otherwise the left margin
                 // will get applied twice.
-                if (prev != parent())
-                    floatingObj->setLeft(floatingObj->left() + (style()->isHorizontalWritingMode() ? prev->marginLeft() : prev->marginTop()));
+                if (prev != parent()) {
+                    if (style()->isHorizontalWritingMode())
+                        floatingObj->setLeft(floatingObj->left() + prev->marginLeft());
+                    else
+                        floatingObj->setTop(floatingObj->top() + prev->marginTop());
+                }
                
                 floatingObj->m_shouldPaint = false;  // We are not in the direct inheritance chain for this float. We will never paint it.
                 floatingObj->m_renderer = r->m_renderer;
diff --git a/WebCore/rendering/RenderListItem.cpp b/WebCore/rendering/RenderListItem.cpp
index 1f600fe..2b64f04 100644
--- a/WebCore/rendering/RenderListItem.cpp
+++ b/WebCore/rendering/RenderListItem.cpp
@@ -161,7 +161,7 @@ static RenderObject* getParentOfFirstLineBox(RenderBlock* curr, RenderObject* ma
         if (currChild->isFloating() || currChild->isPositioned())
             continue;
 
-        if (currChild->isTable() || !currChild->isRenderBlock())
+        if (currChild->isTable() || !currChild->isRenderBlock() || (currChild->isBox() && toRenderBox(currChild)->isWritingModeRoot()))
             break;
 
         if (curr->isListItem() && inQuirksMode && currChild->node() &&
@@ -246,39 +246,39 @@ void RenderListItem::layout()
 void RenderListItem::positionListMarker()
 {
     if (m_marker && m_marker->parent()->isBox() && !m_marker->isInside() && m_marker->inlineBoxWrapper()) {
-        int markerOldX = m_marker->x();
-        int yOffset = 0;
-        int xOffset = 0;
+        int markerOldLogicalLeft = m_marker->logicalLeft();
+        int blockOffset = 0;
+        int lineOffset = 0;
         for (RenderBox* o = m_marker->parentBox(); o != this; o = o->parentBox()) {
-            yOffset += o->y();
-            xOffset += o->x();
+            blockOffset += o->logicalTop();
+            lineOffset += o->logicalLeft();
         }
 
         bool adjustOverflow = false;
-        int markerXPos;
+        int markerLogicalLeft;
         RootInlineBox* root = m_marker->inlineBoxWrapper()->root();
 
         // FIXME: Inline flows in the line box hierarchy that have self-painting layers should act as cutoff points
         // and really shouldn't keep propagating overflow up.  This won't really break anything other than repainting
         // not being as tight as it could be though.
         if (style()->isLeftToRightDirection()) {
-            int leftLineOffset = logicalLeftOffsetForLine(yOffset, logicalLeftOffsetForLine(yOffset, false), false);
-            markerXPos = leftLineOffset - xOffset - paddingLeft() - borderLeft() + m_marker->marginLeft();
-            m_marker->inlineBoxWrapper()->adjustPosition(markerXPos - markerOldX, 0);
+            int leftLineOffset = logicalLeftOffsetForLine(blockOffset, logicalLeftOffsetForLine(blockOffset, false), false);
+            markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - borderStart() + m_marker->marginStart();
+            m_marker->inlineBoxWrapper()->adjustLineDirectionPosition(markerLogicalLeft - markerOldLogicalLeft);
             for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); box; box = box->parent()) {
-                if (markerXPos < box->leftLayoutOverflow()) {
-                    box->setInlineDirectionOverflowPositions(markerXPos, box->rightLayoutOverflow(), box->leftVisualOverflow(), box->rightVisualOverflow());
+                if (markerLogicalLeft < box->logicalLeftLayoutOverflow()) {
+                    box->setInlineDirectionOverflowPositions(markerLogicalLeft, box->logicalRightLayoutOverflow(), box->logicalLeftVisualOverflow(), box->logicalRightVisualOverflow());
                     if (box == root)
                         adjustOverflow = true;
                 }
             }
         } else {
-            int rightLineOffset = logicalRightOffsetForLine(yOffset, logicalRightOffsetForLine(yOffset, false), false);
-            markerXPos = rightLineOffset - xOffset + paddingRight() + borderRight() + m_marker->marginLeft();
-            m_marker->inlineBoxWrapper()->adjustPosition(markerXPos - markerOldX, 0);
+            int rightLineOffset = logicalRightOffsetForLine(blockOffset, logicalRightOffsetForLine(blockOffset, false), false);
+            markerLogicalLeft = rightLineOffset - lineOffset + paddingStart() + borderStart() + m_marker->marginEnd();
+            m_marker->inlineBoxWrapper()->adjustLineDirectionPosition(markerLogicalLeft - markerOldLogicalLeft);
             for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); box; box = box->parent()) {
-                if (markerXPos + m_marker->width() > box->rightLayoutOverflow()) {
-                    box->setInlineDirectionOverflowPositions(box->leftLayoutOverflow(), markerXPos + m_marker->width(), box->leftVisualOverflow(), box->rightVisualOverflow());
+                if (markerLogicalLeft + m_marker->logicalWidth() > box->logicalRightLayoutOverflow()) {
+                    box->setInlineDirectionOverflowPositions(box->logicalLeftLayoutOverflow(), markerLogicalLeft + m_marker->logicalWidth(), box->logicalLeftVisualOverflow(), box->logicalRightVisualOverflow());
                     if (box == root)
                         adjustOverflow = true;
                 }
@@ -286,7 +286,9 @@ void RenderListItem::positionListMarker()
         }
 
         if (adjustOverflow) {
-            IntRect markerRect(markerXPos + xOffset, yOffset, m_marker->width(), m_marker->height());
+            IntRect markerRect(markerLogicalLeft + lineOffset, blockOffset, m_marker->width(), m_marker->height());
+            if (!style()->isHorizontalWritingMode())
+                markerRect = markerRect.transposedRect();
             RenderBox* o = m_marker;
             do {
                 o = o->parentBox();
@@ -300,7 +302,7 @@ void RenderListItem::positionListMarker()
 
 void RenderListItem::paint(PaintInfo& paintInfo, int tx, int ty)
 {
-    if (!height())
+    if (!logicalHeight())
         return;
 
     RenderBlock::paint(paintInfo, tx, ty);
diff --git a/WebCore/rendering/RenderListMarker.cpp b/WebCore/rendering/RenderListMarker.cpp
index ab5da61..d4a98be 100644
--- a/WebCore/rendering/RenderListMarker.cpp
+++ b/WebCore/rendering/RenderListMarker.cpp
@@ -1086,9 +1086,12 @@ IntRect RenderListMarker::localSelectionRect()
 {
     InlineBox* box = inlineBoxWrapper();
     if (!box)
-        return IntRect();
-    RootInlineBox* root = box->root();
-    return IntRect(x(), root->selectionTop() - y(), width(), root->selectionHeight());
+        return IntRect(0, 0, width(), height());
+    RootInlineBox* root = m_inlineBoxWrapper->root();
+    int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
+    if (root->block()->style()->isHorizontalWritingMode())
+        return IntRect(0, newLogicalTop, width(), root->selectionHeight());
+    return IntRect(newLogicalTop, 0, root->selectionHeight(), height());
 }
 
 void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
@@ -1099,16 +1102,18 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
     if (style()->visibility() != VISIBLE)
         return;
 
-    IntRect marker = getRelativeMarkerRect();
-    marker.move(tx, ty);
-
-    IntRect box(tx + x(), ty + y(), width(), height());
+    IntPoint boxOrigin(tx + x(), ty + y());
+    IntRect overflowRect(visibleOverflowRect());
+    overflowRect.move(boxOrigin.x(), boxOrigin.y());
+    overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
 
-    if (box.y() > paintInfo.rect.bottom() || box.y() + box.height() < paintInfo.rect.y())
+    if (!paintInfo.rect.intersects(overflowRect))
         return;
 
-    if (hasBoxDecorations()) 
-        paintBoxDecorations(paintInfo, box.x(), box.y());
+    IntRect box(boxOrigin, IntSize(width(), height()));
+    
+    IntRect marker = getRelativeMarkerRect();
+    marker.move(boxOrigin.x(), boxOrigin.y());
 
     GraphicsContext* context = paintInfo.context;
 
@@ -1117,10 +1122,10 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
         if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
             paintCustomHighlight(tx, ty, style()->highlight(), true);
 #endif
-        context->drawImage(m_image->image(this, marker.size()), style()->colorSpace(), marker.location());
+        context->drawImage(m_image->image(this, marker.size()), style()->colorSpace(), marker);
         if (selectionState() != SelectionNone) {
             IntRect selRect = localSelectionRect();
-            selRect.move(tx, ty);
+            selRect.move(boxOrigin.x(), boxOrigin.y());
             context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
         }
         return;
@@ -1134,7 +1139,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     if (selectionState() != SelectionNone) {
         IntRect selRect = localSelectionRect();
-        selRect.move(tx, ty);
+        selRect.move(boxOrigin.x(), boxOrigin.y());
         context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
     }
 
@@ -1146,10 +1151,6 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     EListStyleType type = style()->listStyleType();
     switch (type) {
-        case Asterisks:
-        case Footnotes:
-            context->drawText(style()->font(), TextRun(m_text), marker.location());
-            return;
         case Disc:
             context->drawEllipse(marker);
             return;
@@ -1235,6 +1236,8 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
         case UpperNorwegian:
         case UpperRoman:
         case Urdu:
+        case Asterisks:
+        case Footnotes:
             break;
     }
     if (m_text.isEmpty())
@@ -1242,32 +1245,51 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
 
     TextRun textRun(m_text);
 
-    // Text is not arbitrary. We can judge whether it's RTL from the first character,
-    // and we only need to handle the direction RightToLeft for now.
-    bool textNeedsReversing = direction(m_text[0]) == RightToLeft;
-    Vector<UChar> reversedText;
-    if (textNeedsReversing) {
-        int length = m_text.length();
-        reversedText.grow(length);
-        for (int i = 0; i < length; ++i)
-            reversedText[length - i - 1] = m_text[i];
-        textRun = TextRun(reversedText.data(), length);
+    if (!style()->isHorizontalWritingMode()) {
+        marker.move(-boxOrigin.x(), -boxOrigin.y());
+        marker = marker.transposedRect();
+        marker.move(box.x(), box.y() - logicalHeight());
+        context->save();
+        context->translate(marker.x(), marker.bottom());
+        context->rotate(static_cast<float>(deg2rad(90.)));
+        context->translate(-marker.x(), -marker.bottom());
     }
 
-    const Font& font = style()->font();
-    const UChar suffix = listMarkerSuffix(type, m_listItem->value());
-    if (style()->isLeftToRightDirection()) {
-        int width = font.width(textRun);
-        context->drawText(style()->font(), textRun, marker.location());
-        UChar suffixSpace[2] = { suffix, ' ' };
-        context->drawText(style()->font(), TextRun(suffixSpace, 2), marker.location() + IntSize(width, 0));
-    } else {
-        UChar spaceSuffix[2] = { ' ', suffix };
-        TextRun spaceSuffixRun(spaceSuffix, 2);
-        int width = font.width(spaceSuffixRun);
-        context->drawText(style()->font(), spaceSuffixRun, marker.location());
-        context->drawText(style()->font(), textRun, marker.location() + IntSize(width, 0));
+    IntPoint textOrigin = IntPoint(marker.x(), marker.y() + style()->font().ascent());
+
+    if (type == Asterisks || type == Footnotes)
+        context->drawText(style()->font(), textRun, textOrigin);
+    else {
+        // Text is not arbitrary. We can judge whether it's RTL from the first character,
+        // and we only need to handle the direction RightToLeft for now.
+        bool textNeedsReversing = direction(m_text[0]) == RightToLeft;
+        Vector<UChar> reversedText;
+        if (textNeedsReversing) {
+            int length = m_text.length();
+            reversedText.grow(length);
+            for (int i = 0; i < length; ++i)
+                reversedText[length - i - 1] = m_text[i];
+            textRun = TextRun(reversedText.data(), length);
+        }
+
+        const Font& font = style()->font();
+        const UChar suffix = listMarkerSuffix(type, m_listItem->value());
+        if (style()->isLeftToRightDirection()) {
+            int width = font.width(textRun);
+            context->drawText(style()->font(), textRun, textOrigin);
+            UChar suffixSpace[2] = { suffix, ' ' };
+            context->drawText(style()->font(), TextRun(suffixSpace, 2), textOrigin + IntSize(width, 0));
+        } else {
+            UChar spaceSuffix[2] = { ' ', suffix };
+            TextRun spaceSuffixRun(spaceSuffix, 2);
+            int width = font.width(spaceSuffixRun);
+            context->drawText(style()->font(), spaceSuffixRun, textOrigin);
+            context->drawText(style()->font(), textRun, textOrigin + IntSize(width, 0));
+        }
     }
+    
+    if (!style()->isHorizontalWritingMode())
+        context->restore();
 }
 
 void RenderListMarker::layout()
@@ -1278,18 +1300,19 @@ void RenderListMarker::layout()
         setWidth(m_image->imageSize(this, style()->effectiveZoom()).width());
         setHeight(m_image->imageSize(this, style()->effectiveZoom()).height());
     } else {
-        setWidth(minPreferredLogicalWidth());
-        setHeight(style()->font().height());
+        setLogicalWidth(minPreferredLogicalWidth());
+        setLogicalHeight(style()->font().height());
     }
 
-    m_marginLeft = m_marginRight = 0;
+    setMarginStart(0);
+    setMarginEnd(0);
 
-    Length leftMargin = style()->marginLeft();
-    Length rightMargin = style()->marginRight();
-    if (leftMargin.isFixed())
-        m_marginLeft = leftMargin.value();
-    if (rightMargin.isFixed())
-        m_marginRight = rightMargin.value();
+    Length startMargin = style()->marginStart();
+    Length endMargin = style()->marginEnd();
+    if (startMargin.isFixed())
+        setMarginStart(startMargin.value());
+    if (endMargin.isFixed())
+        setMarginEnd(endMargin.value());
 
     setNeedsLayout(false);
 }
@@ -1319,13 +1342,14 @@ void RenderListMarker::computePreferredLogicalWidths()
         // until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box.
         int bulletWidth = font.ascent() / 2;
         m_image->setImageContainerSize(IntSize(bulletWidth, bulletWidth));
-        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = m_image->imageSize(this, style()->effectiveZoom()).width();
+        IntSize imageSize = m_image->imageSize(this, style()->effectiveZoom());
+        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHorizontalWritingMode() ? imageSize.width() : imageSize.height();
         setPreferredLogicalWidthsDirty(false);
         updateMargins();
         return;
     }
 
-    int width = 0;
+    int logicalWidth = 0;
     EListStyleType type = style()->listStyleType();
     switch (type) {
         case NoneListStyle:
@@ -1333,13 +1357,13 @@ void RenderListMarker::computePreferredLogicalWidths()
         case Asterisks:
         case Footnotes:
             m_text = listMarkerText(type, m_listItem->value());
-            width = font.width(m_text); // no suffix for these types
+            logicalWidth = font.width(m_text); // no suffix for these types
             break;
         case Circle:
         case Disc:
         case Square:
             m_text = listMarkerText(type, 0); // value is ignored for these types
-            width = (font.ascent() * 2 / 3 + 1) / 2 + 2;
+            logicalWidth = (font.ascent() * 2 / 3 + 1) / 2 + 2;
             break;
         case Afar:
         case Amharic:
@@ -1416,18 +1440,18 @@ void RenderListMarker::computePreferredLogicalWidths()
         case Urdu:
             m_text = listMarkerText(type, m_listItem->value());
             if (m_text.isEmpty())
-                width = 0;
+                logicalWidth = 0;
             else {
                 int itemWidth = font.width(m_text);
                 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' };
                 int suffixSpaceWidth = font.width(TextRun(suffixSpace, 2));
-                width = itemWidth + suffixSpaceWidth;
+                logicalWidth = itemWidth + suffixSpaceWidth;
             }
             break;
     }
 
-    m_minPreferredLogicalWidth = width;
-    m_maxPreferredLogicalWidth = width;
+    m_minPreferredLogicalWidth = logicalWidth;
+    m_maxPreferredLogicalWidth = logicalWidth;
 
     setPreferredLogicalWidthsDirty(false);
     
@@ -1438,26 +1462,18 @@ void RenderListMarker::updateMargins()
 {
     const Font& font = style()->font();
 
-    int marginLeft = 0;
-    int marginRight = 0;
+    int marginStart = 0;
+    int marginEnd = 0;
 
     if (isInside()) {
-        if (isImage()) {
-            if (style()->isLeftToRightDirection())
-                marginRight = cMarkerPadding;
-            else
-                marginLeft = cMarkerPadding;
-        } else switch (style()->listStyleType()) {
+        if (isImage())
+            marginEnd = cMarkerPadding;
+        else switch (style()->listStyleType()) {
             case Disc:
             case Circle:
             case Square:
-                if (style()->isLeftToRightDirection()) {
-                    marginLeft = -1;
-                    marginRight = font.ascent() - minPreferredLogicalWidth() + 1;
-                } else {
-                    marginLeft = font.ascent() - minPreferredLogicalWidth() + 1;
-                    marginRight = -1;
-                }
+                marginStart = -1;
+                marginEnd = font.ascent() - minPreferredLogicalWidth() + 1;
                 break;
             default:
                 break;
@@ -1465,44 +1481,46 @@ void RenderListMarker::updateMargins()
     } else {
         if (style()->isLeftToRightDirection()) {
             if (isImage())
-                marginLeft = -minPreferredLogicalWidth() - cMarkerPadding;
+                marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
             else {
                 int offset = font.ascent() * 2 / 3;
                 switch (style()->listStyleType()) {
                     case Disc:
                     case Circle:
                     case Square:
-                        marginLeft = -offset - cMarkerPadding - 1;
+                        marginStart = -offset - cMarkerPadding - 1;
                         break;
                     case NoneListStyle:
                         break;
                     default:
-                        marginLeft = m_text.isEmpty() ? 0 : -minPreferredLogicalWidth() - offset / 2;
+                        marginStart = m_text.isEmpty() ? 0 : -minPreferredLogicalWidth() - offset / 2;
                 }
             }
+            marginEnd = -marginStart - minPreferredLogicalWidth();
         } else {
             if (isImage())
-                marginLeft = cMarkerPadding;
+                marginEnd = cMarkerPadding;
             else {
                 int offset = font.ascent() * 2 / 3;
                 switch (style()->listStyleType()) {
                     case Disc:
                     case Circle:
                     case Square:
-                        marginLeft = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
+                        marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
                         break;
                     case NoneListStyle:
                         break;
                     default:
-                        marginLeft = m_text.isEmpty() ? 0 : offset / 2;
+                        marginEnd = m_text.isEmpty() ? 0 : offset / 2;
                 }
             }
+            marginStart = -marginEnd - minPreferredLogicalWidth();
         }
-        marginRight = -marginLeft - minPreferredLogicalWidth();
+        
     }
 
-    style()->setMarginLeft(Length(marginLeft, Fixed));
-    style()->setMarginRight(Length(marginRight, Fixed));
+    style()->setMarginStart(Length(marginStart, Fixed));
+    style()->setMarginEnd(Length(marginEnd, Fixed));
 }
 
 int RenderListMarker::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
@@ -1546,14 +1564,16 @@ bool RenderListMarker::isInside() const
 IntRect RenderListMarker::getRelativeMarkerRect()
 {
     if (isImage())
-        return IntRect(x(), y(), m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height());
-
+        return IntRect(0, 0, m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height());
+    
+    IntRect relativeRect;
     EListStyleType type = style()->listStyleType();
     switch (type) {
         case Asterisks:
         case Footnotes: {
             const Font& font = style()->font();
-            return IntRect(x(), y() + font.ascent(), font.width(m_text), font.height());
+            relativeRect = IntRect(0, 0, font.width(m_text), font.height());
+            break;
         }
         case Disc:
         case Circle:
@@ -1562,7 +1582,8 @@ IntRect RenderListMarker::getRelativeMarkerRect()
             const Font& font = style()->font();
             int ascent = font.ascent();
             int bulletWidth = (ascent * 2 / 3 + 1) / 2;
-            return IntRect(x() + 1, y() + 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth);
+            relativeRect = IntRect(1, 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth);
+            break;
         }
         case NoneListStyle:
             return IntRect();
@@ -1645,10 +1666,15 @@ IntRect RenderListMarker::getRelativeMarkerRect()
             int itemWidth = font.width(m_text);
             UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' };
             int suffixSpaceWidth = font.width(TextRun(suffixSpace, 2));
-            return IntRect(x(), y() + font.ascent(), itemWidth + suffixSpaceWidth, font.height());
+            relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.height());
+    }
+
+    if (!style()->isHorizontalWritingMode()) {
+        relativeRect = relativeRect.transposedRect();
+        relativeRect.setX(width() - relativeRect.x() - relativeRect.width());
     }
 
-    return IntRect();
+    return relativeRect;
 }
 
 void RenderListMarker::setSelectionState(SelectionState state)
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index a6e7d59..0ea3673 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -1332,6 +1332,36 @@ Length RenderStyle::marginEndUsing(const RenderStyle* otherStyle) const
     return otherStyle->isLeftToRightDirection() ? marginBottom() : marginTop();
 }
 
+void RenderStyle::setMarginStart(Length margin)
+{
+    if (isHorizontalWritingMode()) {
+        if (isLeftToRightDirection())
+            setMarginLeft(margin);
+        else
+            setMarginRight(margin);
+    } else {
+        if (isLeftToRightDirection())
+            setMarginTop(margin);
+        else
+            setMarginBottom(margin);
+    }
+}
+
+void RenderStyle::setMarginEnd(Length margin)
+{
+    if (isHorizontalWritingMode()) {
+        if (isLeftToRightDirection())
+            setMarginRight(margin);
+        else
+            setMarginLeft(margin);
+    } else {
+        if (isLeftToRightDirection())
+            setMarginBottom(margin);
+        else
+            setMarginTop(margin);
+    }
+}
+
 Length RenderStyle::paddingBefore() const
 {
     switch (writingMode()) {
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 91fb86a..132ef1f 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -969,6 +969,8 @@ public:
     void setMarginBottom(Length v) { SET_VAR(surround, margin.m_bottom, v) }
     void setMarginLeft(Length v) { SET_VAR(surround, margin.m_left, v) }
     void setMarginRight(Length v) { SET_VAR(surround, margin.m_right, v) }
+    void setMarginStart(Length);
+    void setMarginEnd(Length);
 
     void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)) }
     void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b) }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list