LayoutTests:
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: http://svn.webkit.org/repository/webkit/trunk@20889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp
index 9bbe041..bf4b016 100644
--- a/WebCore/rendering/bidi.cpp
+++ b/WebCore/rendering/bidi.cpp
@@ -978,7 +978,7 @@
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 @@
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 @@
numSpaces = 0;
break;
case CENTER:
- case KHTML_CENTER:
+ case WEBKIT_CENTER:
int xd = (availableWidth - totWidth)/2;
x += xd > 0 ? xd : 0;
numSpaces = 0;