LayoutTests:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Apr 2007 01:26:07 +0000 (01:26 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Apr 2007 01:26:07 +0000 (01:26 +0000)
        Patch and review by hyatt.  Testing and landing by ddkilzer.

        <rdar://problem/5078866>
        tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)

        Test tables/mozilla_expected_failures/bugs/bug11384s.html progressed after this fix, so
        it was moved to tables/mozilla/bugs/bug11384s.html.

        * fast/css/table-text-align-quirk-expected.checksum: Added.
        * fast/css/table-text-align-quirk-expected.png: Added.
        * fast/css/table-text-align-quirk-expected.txt: Added.
        * fast/css/table-text-align-quirk.html: Added.
        * fast/css/table-text-align-strict-expected.checksum: Added.
        * fast/css/table-text-align-strict-expected.png: Added.
        * fast/css/table-text-align-strict-expected.txt: Added.
        * fast/css/table-text-align-strict.html: Added.
        * fast/table/border-collapsing/rtl-border-collapsing.html: Replaced "text-align: -khtml-center"
        style with "text-align: center" style.
        * tables/mozilla/bugs/bug11384s-expected.checksum: Added.
        * tables/mozilla/bugs/bug11384s-expected.png: Added.
        * tables/mozilla/bugs/bug11384s-expected.txt: Added.
        * tables/mozilla/bugs/bug11384s.html: Added.
        * tables/mozilla_expected_failures/bugs/bug11384s-expected.checksum: Removed.
        * tables/mozilla_expected_failures/bugs/bug11384s-expected.png: Removed.
        * tables/mozilla_expected_failures/bugs/bug11384s-expected.txt: Removed.
        * tables/mozilla_expected_failures/bugs/bug11384s.html: Removed.

WebCore:

        Patch and review by hyatt.  Testing and landing by ddkilzer.

        <rdar://problem/5078866>
        tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)

        Test: fast/css/table-text-align-quirk.html
              fast/css/table-text-align-strict.html

        Previous commit (r20731) removed the wrong property from WebCore/css/html4.css.  However,
        when the correct property was removed, it caused tables to inherit alignment properties
        from tags like <center> and <div align="center">.  This is fixed in
        WebCore::CSSStyleSelector::adjustRenderStyle() by special-casing tables to reset the
        text-align property.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForTextAlign): Renamed KHTML_CENTER, KHTML_LEFT and KHTML_RIGHT to
        WEBKIT_CENTER, WEBKIT_LEFT and WEBKIT_RIGHT.
        * css/cssparser.cpp:
        (WebCore::CSSParser::parseValue): Ditto.
        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::adjustRenderStyle): Tables should not support -webkit-center,
        -webkit-left or -webkit-right values for text-align, so reset them back to auto.
        * css/html4.css: Removed "text-align: -webkit-auto;" property from tables selector.  It
        was previously added to css/quirks.css in r20731.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::determineHorizontalPosition): Renamed KHTML_* to WEBKIT_*.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calcHorizontalMargins): Ditto.
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::caretRect): Ditto.
        * rendering/RenderStyle.h: Ditto.
        (WebCore::):
        * rendering/bidi.cpp:
        (WebCore::RenderBlock::computeHorizontalPositionsForLine): Ditto.

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

26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/table-text-align-quirk-expected.checksum [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-quirk-expected.png [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-quirk-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-quirk.html [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-strict-expected.checksum [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-strict-expected.png [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-strict-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/table-text-align-strict.html [new file with mode: 0644]
LayoutTests/fast/table/border-collapsing/rtl-border-collapsing.html
LayoutTests/tables/mozilla/bugs/bug11384s-expected.checksum [new file with mode: 0644]
LayoutTests/tables/mozilla/bugs/bug11384s-expected.png [new file with mode: 0644]
LayoutTests/tables/mozilla/bugs/bug11384s-expected.txt [moved from LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.txt with 80% similarity]
LayoutTests/tables/mozilla/bugs/bug11384s.html [moved from LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s.html with 100% similarity]
LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.checksum [deleted file]
LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.png [deleted file]
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/css/cssparser.cpp
WebCore/css/cssstyleselector.cpp
WebCore/css/html4.css
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBox.cpp
WebCore/rendering/RenderFlow.cpp
WebCore/rendering/RenderStyle.h
WebCore/rendering/bidi.cpp

index 6bac3c7..7aa3d64 100644 (file)
@@ -1,3 +1,32 @@
+2007-04-13  David Kilzer  <ddkilzer@webkit.org>
+
+        Patch and review by hyatt.  Testing and landing by ddkilzer.
+
+        <rdar://problem/5078866>
+        tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)
+
+        Test tables/mozilla_expected_failures/bugs/bug11384s.html progressed after this fix, so
+        it was moved to tables/mozilla/bugs/bug11384s.html.
+
+        * fast/css/table-text-align-quirk-expected.checksum: Added.
+        * fast/css/table-text-align-quirk-expected.png: Added.
+        * fast/css/table-text-align-quirk-expected.txt: Added.
+        * fast/css/table-text-align-quirk.html: Added.
+        * fast/css/table-text-align-strict-expected.checksum: Added.
+        * fast/css/table-text-align-strict-expected.png: Added.
+        * fast/css/table-text-align-strict-expected.txt: Added.
+        * fast/css/table-text-align-strict.html: Added.
+        * fast/table/border-collapsing/rtl-border-collapsing.html: Replaced "text-align: -khtml-center"
+        style with "text-align: center" style.
+        * tables/mozilla/bugs/bug11384s-expected.checksum: Added.
+        * tables/mozilla/bugs/bug11384s-expected.png: Added.
+        * tables/mozilla/bugs/bug11384s-expected.txt: Added.
+        * tables/mozilla/bugs/bug11384s.html: Added.
+        * tables/mozilla_expected_failures/bugs/bug11384s-expected.checksum: Removed.
+        * tables/mozilla_expected_failures/bugs/bug11384s-expected.png: Removed.
+        * tables/mozilla_expected_failures/bugs/bug11384s-expected.txt: Removed.
+        * tables/mozilla_expected_failures/bugs/bug11384s.html: Removed.
+
 2007-04-13  Brady Eidson  <beidson@apple.com>
 
         Reviewed by a sanity check
diff --git a/LayoutTests/fast/css/table-text-align-quirk-expected.checksum b/LayoutTests/fast/css/table-text-align-quirk-expected.checksum
new file mode 100644 (file)
index 0000000..a767cbc
--- /dev/null
@@ -0,0 +1 @@
+dbabfcc3519bae867d8d2b3763e421b2
\ No newline at end of file
diff --git a/LayoutTests/fast/css/table-text-align-quirk-expected.png b/LayoutTests/fast/css/table-text-align-quirk-expected.png
new file mode 100644 (file)
index 0000000..c1e4cc2
Binary files /dev/null and b/LayoutTests/fast/css/table-text-align-quirk-expected.png differ
diff --git a/LayoutTests/fast/css/table-text-align-quirk-expected.txt b/LayoutTests/fast/css/table-text-align-quirk-expected.txt
new file mode 100644 (file)
index 0000000..e4bba50
--- /dev/null
@@ -0,0 +1,15 @@
+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 784x18
+        RenderText {#text} at (0,0) size 541x18
+          text run at (0,0) width 541: "The text below should be left-justified since text-align does not inherit in quirks mode."
+      RenderBlock {DIV} at (0,18) size 784x26
+        RenderTable {TABLE} at (0,0) size 108x26 [border: (1px solid #000000)]
+          RenderTableSection {TBODY} at (1,1) size 106x24
+            RenderTableRow {TR} at (0,2) size 106x20
+              RenderTableCell {TD} at (2,2) size 102x20 [r=0 c=0 rs=1 cs=1]
+                RenderText {#text} at (1,1) size 35x18
+                  text run at (1,1) width 35: "hello."
diff --git a/LayoutTests/fast/css/table-text-align-quirk.html b/LayoutTests/fast/css/table-text-align-quirk.html
new file mode 100644 (file)
index 0000000..745fdcf
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+<head>
+<title></title>
+</head>
+<body>
+<div>
+The text below should be left-justified since text-align does not inherit in quirks mode.
+</div>
+<div style="text-align: center;">
+<table style="border: 1px solid black;">
+  <tr>
+    <td style="width: 100px;">hello.</td>
+  </tr>
+</table>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/css/table-text-align-strict-expected.checksum b/LayoutTests/fast/css/table-text-align-strict-expected.checksum
new file mode 100644 (file)
index 0000000..874063e
--- /dev/null
@@ -0,0 +1 @@
+5f17828eb1d2f51d21c302a90949af19
\ No newline at end of file
diff --git a/LayoutTests/fast/css/table-text-align-strict-expected.png b/LayoutTests/fast/css/table-text-align-strict-expected.png
new file mode 100644 (file)
index 0000000..743782a
Binary files /dev/null and b/LayoutTests/fast/css/table-text-align-strict-expected.png differ
diff --git a/LayoutTests/fast/css/table-text-align-strict-expected.txt b/LayoutTests/fast/css/table-text-align-strict-expected.txt
new file mode 100644 (file)
index 0000000..0234e41
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x60
+  RenderBlock {HTML} at (0,0) size 800x60
+    RenderBody {BODY} at (8,8) size 784x44
+      RenderBlock {DIV} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 486x18
+          text run at (0,0) width 486: "The text below should be centered since text-align does inherit in strict mode."
+      RenderBlock {DIV} at (0,18) size 784x26
+        RenderTable {TABLE} at (0,0) size 108x26 [border: (1px solid #000000)]
+          RenderTableSection {TBODY} at (1,1) size 106x24
+            RenderTableRow {TR} at (0,2) size 106x20
+              RenderTableCell {TD} at (2,2) size 102x20 [r=0 c=0 rs=1 cs=1]
+                RenderText {#text} at (33,1) size 35x18
+                  text run at (33,1) width 35: "hello."
diff --git a/LayoutTests/fast/css/table-text-align-strict.html b/LayoutTests/fast/css/table-text-align-strict.html
new file mode 100644 (file)
index 0000000..d69037b
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+    "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title></title>
+</head>
+<body>
+<div>
+The text below should be centered since text-align does inherit in strict mode.
+</div>
+<div style="text-align: center;">
+<table style="border: 1px solid black;">
+  <tr>
+    <td style="width: 100px;">hello.</td>
+  </tr>
+</table>
+</div>
+</body>
+</html>
index 2d789f0..10806f5 100644 (file)
@@ -7,7 +7,7 @@ Collapsed borders appear on the wrong side or on the wrong cell in RTL tables</i
 The RTL table should be a mirror image of the LTR table.
 </p>
 <hr>
-<table cellpadding="4" cellspacing="0" style="text-align: -khtml-center;">
+<table cellpadding="4" cellspacing="0" style="text-align: center;">
 <tr>
 <td style="border-right: 1px solid black;">RTL</td>
 <td>LTR</td>
diff --git a/LayoutTests/tables/mozilla/bugs/bug11384s-expected.checksum b/LayoutTests/tables/mozilla/bugs/bug11384s-expected.checksum
new file mode 100644 (file)
index 0000000..c0ea16a
--- /dev/null
@@ -0,0 +1 @@
+db75d943a4739a8b9666e6b3616a7a8f
\ No newline at end of file
diff --git a/LayoutTests/tables/mozilla/bugs/bug11384s-expected.png b/LayoutTests/tables/mozilla/bugs/bug11384s-expected.png
new file mode 100644 (file)
index 0000000..c32880e
Binary files /dev/null and b/LayoutTests/tables/mozilla/bugs/bug11384s-expected.png differ
@@ -10,5 +10,5 @@ layer at (0,0) size 800x115
         RenderTableSection {TBODY} at (1,1) size 625x26
           RenderTableRow {TR} at (0,2) size 625x22
             RenderTableCell {TD} at (2,2) size 621x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
-              RenderText {#text} at (2,2) size 291x18
-                text run at (2,2) width 291: "The text should be center-aligned not the table"
+              RenderText {#text} at (165,2) size 291x18
+                text run at (165,2) width 291: "The text should be center-aligned not the table"
diff --git a/LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.checksum b/LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.checksum
deleted file mode 100644 (file)
index a704f19..0000000
+++ /dev/null
@@ -1 +0,0 @@
-68d1726b6d71564e419ec7a6eb3ab714
\ No newline at end of file
diff --git a/LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.png b/LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.png
deleted file mode 100644 (file)
index 3e45a8e..0000000
Binary files a/LayoutTests/tables/mozilla_expected_failures/bugs/bug11384s-expected.png and /dev/null differ
index 6542329..a01444b 100644 (file)
@@ -1,3 +1,40 @@
+2007-04-13  David Kilzer  <ddkilzer@webkit.org>
+
+        Patch and review by hyatt.  Testing and landing by ddkilzer.
+
+        <rdar://problem/5078866>
+        tables don't inherit text-align (in strict mode; they're not supposed to in quirks mode)
+
+        Test: fast/css/table-text-align-quirk.html
+              fast/css/table-text-align-strict.html
+
+        Previous commit (r20731) removed the wrong property from WebCore/css/html4.css.  However,
+        when the correct property was removed, it caused tables to inherit alignment properties
+        from tags like <center> and <div align="center">.  This is fixed in
+        WebCore::CSSStyleSelector::adjustRenderStyle() by special-casing tables to reset the
+        text-align property.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::valueForTextAlign): Renamed KHTML_CENTER, KHTML_LEFT and KHTML_RIGHT to
+        WEBKIT_CENTER, WEBKIT_LEFT and WEBKIT_RIGHT.
+        * css/cssparser.cpp:
+        (WebCore::CSSParser::parseValue): Ditto.
+        * css/cssstyleselector.cpp:
+        (WebCore::CSSStyleSelector::adjustRenderStyle): Tables should not support -webkit-center,
+        -webkit-left or -webkit-right values for text-align, so reset them back to auto.
+        * css/html4.css: Removed "text-align: -webkit-auto;" property from tables selector.  It
+        was previously added to css/quirks.css in r20731.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::determineHorizontalPosition): Renamed KHTML_* to WEBKIT_*.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::calcHorizontalMargins): Ditto.
+        * rendering/RenderFlow.cpp:
+        (WebCore::RenderFlow::caretRect): Ditto.
+        * rendering/RenderStyle.h: Ditto.
+        (WebCore::):
+        * rendering/bidi.cpp:
+        (WebCore::RenderBlock::computeHorizontalPositionsForLine): Ditto.
+
 2007-04-12  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Black Sheep
index d412b5a..7bfdf2d 100644 (file)
@@ -242,11 +242,11 @@ static PassRefPtr<CSSValue> valueForTextAlign(ETextAlign align)
             return new CSSPrimitiveValue(CSS_VAL_CENTER);
         case JUSTIFY:
             return new CSSPrimitiveValue(CSS_VAL_JUSTIFY);
-        case KHTML_LEFT:
+        case WEBKIT_LEFT:
             return new CSSPrimitiveValue(CSS_VAL__WEBKIT_LEFT);
-        case KHTML_RIGHT:
+        case WEBKIT_RIGHT:
             return new CSSPrimitiveValue(CSS_VAL__WEBKIT_RIGHT);
-        case KHTML_CENTER:
+        case WEBKIT_CENTER:
             return new CSSPrimitiveValue(CSS_VAL__WEBKIT_CENTER);
     }
     ASSERT_NOT_REACHED();
index e42f54a..1799d4c 100644 (file)
@@ -679,7 +679,7 @@ bool CSSParser::parseValue(int propId, bool important)
         break;
 
     case CSS_PROP_TEXT_ALIGN:
-        // left | right | center | justify | khtml_left | khtml_right | khtml_center | <string> | inherit
+        // left | right | center | justify | webkit_left | webkit_right | webkit_center | <string> | inherit
         if ((id >= CSS_VAL__WEBKIT_AUTO && id <= CSS_VAL__WEBKIT_CENTER) ||
              value->unit == CSSPrimitiveValue::CSS_STRING)
             valid_primitive = true;
index e53514f..996d2bf 100644 (file)
@@ -1026,6 +1026,10 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
                 style->setDisplay(style->isDisplayInlineType() ? INLINE_TABLE : TABLE);
         }
 
+        // Tables never support the -webkit-* values for text-align and will reset back to the default.
+        if (e && e->hasTagName(tableTag) && (style->textAlign() == WEBKIT_LEFT || style->textAlign() == WEBKIT_CENTER || style->textAlign() == WEBKIT_RIGHT))
+            style->setTextAlign(TAAUTO);
+
         // Frames and framesets never honor position:relative or position:absolute.  This is necessary to
         // fix a crash where a site tries to position these objects.  They also never honor display.
         if (e && (e->hasTagName(frameTag) || e->hasTagName(framesetTag))) {
index 588025c..96b2f3b 100644 (file)
@@ -165,7 +165,6 @@ h6 {
 table {
     display: table;
     border-collapse: separate;
-    text-align: -webkit-auto;
     border-spacing: 2px;
     border-color: gray
 }
index 6412f0b..739b180 100644 (file)
@@ -1005,7 +1005,7 @@ void RenderBlock::determineHorizontalPosition(RenderObject* child)
         // to shift over as necessary to dodge any floats that might get in the way.
         if (child->avoidsFloats()) {
             int leftOff = leftOffset(m_height);
-            if (style()->textAlign() != KHTML_CENTER && child->style()->marginLeft().type() != Auto) {
+            if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginLeft().type() != Auto) {
                 if (child->marginLeft() < 0)
                     leftOff += child->marginLeft();
                 chPos = max(chPos, leftOff); // Let the float sit in the child's margin if it can fit.
@@ -1027,7 +1027,7 @@ void RenderBlock::determineHorizontalPosition(RenderObject* child)
         int chPos = xPos - (child->width() + child->marginRight());
         if (child->avoidsFloats()) {
             int rightOff = rightOffset(m_height);
-            if (style()->textAlign() != KHTML_CENTER && child->style()->marginRight().type() != Auto) {
+            if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginRight().type() != Auto) {
                 if (child->marginRight() < 0)
                     rightOff -= child->marginRight();
                 chPos = min(chPos, rightOff - child->width()); // Let the float sit in the child's margin if it can fit.
index 38a87f4..c90142b 100644 (file)
@@ -1185,15 +1185,15 @@ void RenderBox::calcHorizontalMargins(const Length& marginLeft, const Length& ma
     }
 
     if ((marginLeft.isAuto() && marginRight.isAuto() && m_width < containerWidth)
-            || (!marginLeft.isAuto() && !marginRight.isAuto() && containingBlock()->style()->textAlign() == KHTML_CENTER)) {
+            || (!marginLeft.isAuto() && !marginRight.isAuto() && containingBlock()->style()->textAlign() == WEBKIT_CENTER)) {
         m_marginLeft = max(0, (containerWidth - m_width) / 2);
         m_marginRight = containerWidth - m_width - m_marginLeft;
     } else if ((marginRight.isAuto() && m_width < containerWidth)
-            || (!marginLeft.isAuto() && containingBlock()->style()->direction() == RTL && containingBlock()->style()->textAlign() == KHTML_LEFT)) {
+            || (!marginLeft.isAuto() && containingBlock()->style()->direction() == RTL && containingBlock()->style()->textAlign() == WEBKIT_LEFT)) {
         m_marginLeft = marginLeft.calcValue(containerWidth);
         m_marginRight = containerWidth - m_width - m_marginLeft;
     } else if ((marginLeft.isAuto() && m_width < containerWidth)
-            || (!marginRight.isAuto() && containingBlock()->style()->direction() == LTR && containingBlock()->style()->textAlign() == KHTML_RIGHT)) {
+            || (!marginRight.isAuto() && containingBlock()->style()->direction() == LTR && containingBlock()->style()->textAlign() == WEBKIT_RIGHT)) {
         m_marginRight = marginRight.calcValue(containerWidth);
         m_marginLeft = containerWidth - m_width - m_marginRight;
     } else {
index 13acc56..1069d1c 100644 (file)
@@ -605,14 +605,14 @@ IntRect RenderFlow::caretRect(int offset, EAffinity affinity, int* extraWidthToE
                 alignment = alignRight;
             break;
         case LEFT:
-        case KHTML_LEFT:
+        case WEBKIT_LEFT:
             break;
         case CENTER:
-        case KHTML_CENTER:
+        case WEBKIT_CENTER:
             alignment = alignCenter;
             break;
         case RIGHT:
-        case KHTML_RIGHT:
+        case WEBKIT_RIGHT:
             alignment = alignRight;
             break;
     }
index 4951718..dafc87a 100644 (file)
@@ -896,7 +896,7 @@ enum EWhiteSpace {
 };
 
 enum ETextAlign {
-    TAAUTO, LEFT, RIGHT, CENTER, JUSTIFY, KHTML_LEFT, KHTML_RIGHT, KHTML_CENTER
+    TAAUTO, LEFT, RIGHT, CENTER, JUSTIFY, WEBKIT_LEFT, WEBKIT_RIGHT, WEBKIT_CENTER
 };
 
 enum ETextTransform {
index 9bbe041..bf4b016 100644 (file)
@@ -978,7 +978,7 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, Bidi
     int x = leftOffset(m_height);
     switch(style()->textAlign()) {
         case LEFT:
-        case KHTML_LEFT:
+        case WEBKIT_LEFT:
             // The direction of the block should determine what happens with wide lines.  In
             // particular with RTL blocks, wide lines should still spill out to the left.
             if (style()->direction() == RTL && totWidth > availableWidth)
@@ -995,7 +995,7 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, Bidi
             if (style()->direction() == LTR)
                 break;
         case RIGHT:
-        case KHTML_RIGHT:
+        case WEBKIT_RIGHT:
             // Wide lines spill out of the block based off direction.
             // So even if text-align is right, if direction is LTR, wide lines should overflow out of the right
             // side of the block.
@@ -1004,7 +1004,7 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, Bidi
             numSpaces = 0;
             break;
         case CENTER:
-        case KHTML_CENTER:
+        case WEBKIT_CENTER:
             int xd = (availableWidth - totWidth)/2;
             x += xd > 0 ? xd : 0;
             numSpaces = 0;