Implement sharing of similar style objects. Cuts the # of style objects allocated on the PLT by more
	than half.

        Reviewed by kocienda

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::initElementAndPseudoState):
        (khtml::CSSStyleSelector::initForStyleResolve):
        (khtml::cleanpath):
        (khtml::checkPseudoState):
        (khtml::CSSStyleSelector::locateSiblingList):
        (khtml::CSSStyleSelector::canShareStyleWithElement):
        (khtml::CSSStyleSelector::locateSharedStyle):
        (khtml::CSSStyleSelector::styleForElement):
        (khtml::CSSStyleSelector::pseudoStyleForElement):
        (khtml::CSSStyleSelector::checkOneSelector):
        * khtml/css/cssstyleselector.h:
        * khtml/css/html4.css:
        * khtml/css/parser.cpp:
        * khtml/css/parser.y:
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::mapToEntry):
        (HTMLIFrameElementImpl::mapToEntry):
        * khtml/html/html_baseimpl.h:
        * khtml/html/html_blockimpl.cpp:
        (HTMLDivElementImpl::mapToEntry):
        (HTMLHRElementImpl::mapToEntry):
        (HTMLParagraphElementImpl::mapToEntry):
        (HTMLMarqueeElementImpl::mapToEntry):
        * khtml/html/html_blockimpl.h:
        * khtml/html/html_elementimpl.cpp:
        (HTMLNamedAttrMapImpl::declCount):
        (HTMLNamedAttrMapImpl::mapsEquivalent):
        (HTMLElementImpl::attributeChanged):
        (HTMLElementImpl::mapToEntry):
        * khtml/html/html_elementimpl.h:
        (DOM::HTMLElementImpl::isMappedAttribute):
        * khtml/html/html_formimpl.cpp:
        (HTMLInputElementImpl::mapToEntry):
        * khtml/html/html_formimpl.h:
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::mapToEntry):
        * khtml/html/html_imageimpl.h:
        * khtml/html/html_inlineimpl.cpp:
        (HTMLBRElementImpl::mapToEntry):
        (HTMLFontElementImpl::mapToEntry):
        * khtml/html/html_inlineimpl.h:
        * khtml/html/html_listimpl.cpp:
        (HTMLUListElementImpl::mapToEntry):
        (HTMLOListElementImpl::mapToEntry):
        (HTMLLIElementImpl::mapToEntry):
        * khtml/html/html_listimpl.h:
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::mapToEntry):
        (HTMLEmbedElementImpl::mapToEntry):
        (HTMLObjectElementImpl::mapToEntry):
        * khtml/html/html_objectimpl.h:
        * khtml/html/html_tableimpl.cpp:
        (HTMLTableElementImpl::mapToEntry):
        (HTMLTablePartElementImpl::mapToEntry):
        (HTMLTableCellElementImpl::mapToEntry):
        (HTMLTableColElementImpl::mapToEntry):
        (HTMLTableCaptionElementImpl::mapToEntry):
        * khtml/html/html_tableimpl.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::setStyle):
        * khtml/rendering/render_style.cpp:
        (m_affectedByAttributeSelectors):
        (RenderStyle::RenderStyle):
        * khtml/rendering/render_style.h:
        (khtml::):
        (khtml::RenderStyle::pseudoState):
        (khtml::RenderStyle::setPseudoState):
        (khtml::RenderStyle::affectedByAttributeSelectors):
        (khtml::RenderStyle::setAffectedByAttributeSelectors):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::DocumentImpl):
        * khtml/xml/dom_docimpl.h:
        (DOM::DocumentImpl::usesSiblingRules):
        (DOM::DocumentImpl::setUsesSiblingRules):


git-svn-id: svn://svn.chromium.org/blink/trunk@6514 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/WebCore/khtml/css/html4.css b/WebCore/khtml/css/html4.css
index f1d9b3e..a7d8aa8 100644
--- a/WebCore/khtml/css/html4.css
+++ b/WebCore/khtml/css/html4.css
@@ -170,9 +170,9 @@
 	border-color: gray;
 }
 
-TABLE[align="center"] { 
-    margin-left: auto; 
-    margin-right: auto;
+TABLE[align="center"] {
+        margin-left: auto;
+        margin-right: auto;
 }
 
 THEAD { 
@@ -231,14 +231,14 @@
         display: block;
         list-style-type: disc;
         margin: 1__qem 0 1em 0;
-        padding-left: 40px;
+        padding-left: 40px; /* For RTL, we need to implement padding-start */
 }
 
 OL {
         display: block;
         list-style-type: decimal;
         margin: 1__qem 0 1em 0;
-        padding-left: 40px;
+        padding-left: 40px; /* For RTL, we need to implement padding-start */
 }
 
 LI {
@@ -246,22 +246,18 @@
 }
 
 
-UL UL { 
+UL UL, OL UL { 
 	list-style-type: circle;
 }
 
-OL UL { 
-	list-style-type: circle;
-}
-
-UL UL UL { 
+OL OL UL, OL UL UL, UL OL UL, UL UL UL { 
 	list-style-type: square;
 }
       
 
 DD {
 	display: block;
-	margin-left: 40px;
+	margin-left: 40px; /* For RTL, we need to implement margin-start */
 }
 
 DL {
@@ -272,24 +268,13 @@
 DT {
 	display: block;
 }
- 
-/* for right to left */
-      
-*[dir="rtl"] UL, 
-*[dir="rtl"] OL,  
-*[dir="rtl"] DIR, 
-*[dir="rtl"] MENU, 
-*[dir="rtl"] DD { 
-	margin-right:40px; 
-	margin-left: auto;
-}
-      
+
 OL UL, 
 UL OL,
 UL UL, 
 OL OL { 
-	margin-top: auto; 
-	margin-bottom: auto; 
+	margin-top: 0; 
+	margin-bottom: 0; 
 }
 
 /*
@@ -437,12 +422,7 @@
 	direction: rtl; 
 	unicode-bidi: bidi-override;
 }
-
-/* ### this selector seems to be still broken ...
-      *[DIR="ltr"]    { direction: ltr; unicode-bidi: embed }
-      *[DIR="rtl"]    { direction: rtl; unicode-bidi: embed }
-*/
-      
+   
 /* Elements that are block-level in HTML4 */
 /* ### don't support unicode-bidi at the moment
       ADDRESS, BLOCKQUOTE, BODY, DD, DIV, DL, DT, FIELDSET,