2006-05-16 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2006 07:52:04 +0000 (07:52 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2006 07:52:04 +0000 (07:52 +0000)
        Reviewed by hyatt.

        Split css_base.* into separate files (one per class).
        http://bugzilla.opendarwin.org/show_bug.cgi?id=8935

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/kjs_css.cpp:
        * css/CSSBorderImageValue.cpp:
        * css/CSSBorderImageValue.h:
        * css/CSSCharsetRule.h:
        * css/CSSFontFaceRule.h:
        * css/CSSGrammar.y:
        * css/CSSImportRule.h:
        * css/CSSInheritedValue.cpp:
        * css/CSSInitialValue.cpp:
        * css/CSSMediaRule.h:
        * css/CSSMutableStyleDeclaration.h:
        * css/CSSNamespace.h: Added.
        (WebCore::CSSNamespace::CSSNamespace):
        (WebCore::CSSNamespace::namespaceForPrefix):
        * css/CSSPageRule.h:
        * css/CSSPrimitiveValue.h:
        * css/CSSProperty.cpp:
        * css/CSSProperty.h:
        * css/CSSRule.h:
        * css/CSSRuleList.cpp:
        * css/CSSSelector.cpp: Added.
        * css/CSSSelector.h: Added.
        (WebCore::CSSSelector::CSSSelector):
        * css/CSSStyleDeclaration.h:
        * css/CSSStyleRule.cpp:
        * css/CSSStyleRule.h:
        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::~CSSStyleSheet):
        * css/CSSStyleSheet.h:
        * css/CSSValue.h:
        * css/CSSValueList.cpp:
        * css/CSSValueList.h:
        * css/FontFamilyValue.cpp:
        * css/FontValue.cpp:
        * css/FontValue.h:
        * css/MediaList.h:
        * css/ShadowValue.cpp:
        * css/ShadowValue.h:
        * css/StyleBase.cpp: Added.
        (WebCore::StyleBase::stylesheet):
        * css/StyleBase.h: Added.
        (WebCore::StyleBase::StyleBase):
        * css/StyleList.cpp: Added.
        * css/StyleList.h: Added.
        * css/StyleSheet.h:
        * css/css_base.cpp: Removed.
        * css/css_base.h: Removed.
        * css/cssparser.cpp:
        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::matchRulesForList):
        * css/cssstyleselector.h:
        * dom/CSSMappedAttributeDeclaration.h:
        * ksvg2/svg/SVGColor.cpp:
        (WebCore::SVGColor::SVGColor):
        (WebCore::SVGColor::setRGBColor):
        (WebCore::SVGColor::setRGBColorICCColor):
        (WebCore::SVGColor::setColor):
        (WebCore::SVGColor::cssText):
        (WebCore::SVGColor::color):
        * ksvg2/svg/SVGColor.h:
        * ksvg2/svg/SVGStyledElement.cpp:
        (WebCore::SVGStyledElement::SVGStyledElement):
        (WebCore::SVGStyledElement::className):
        (WebCore::SVGStyledElement::createRenderer):
        (WebCore::SVGStyledElement::parseMappedAttribute):
        (WebCore::SVGStyledElement::notifyAttributeChange):
        (WebCore::SVGStyledElement::attributeChanged):
        (WebCore::SVGStyledElement::canvas):
        (WebCore::SVGStyledElement::updateCanvasItem):
        (WebCore::SVGStyledElement::pushAttributeContext):

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

49 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_css.cpp
WebCore/css/CSSBorderImageValue.cpp
WebCore/css/CSSBorderImageValue.h
WebCore/css/CSSCharsetRule.h
WebCore/css/CSSFontFaceRule.h
WebCore/css/CSSGrammar.y
WebCore/css/CSSImportRule.h
WebCore/css/CSSInheritedValue.cpp
WebCore/css/CSSInitialValue.cpp
WebCore/css/CSSMediaRule.h
WebCore/css/CSSMutableStyleDeclaration.h
WebCore/css/CSSNamespace.h [new file with mode: 0644]
WebCore/css/CSSPageRule.h
WebCore/css/CSSPrimitiveValue.h
WebCore/css/CSSProperty.cpp
WebCore/css/CSSProperty.h
WebCore/css/CSSRule.h
WebCore/css/CSSRuleList.cpp
WebCore/css/CSSSelector.cpp [moved from WebCore/css/css_base.cpp with 84% similarity]
WebCore/css/CSSSelector.h [moved from WebCore/css/css_base.h with 53% similarity]
WebCore/css/CSSStyleDeclaration.h
WebCore/css/CSSStyleRule.cpp
WebCore/css/CSSStyleRule.h
WebCore/css/CSSStyleSheet.cpp
WebCore/css/CSSStyleSheet.h
WebCore/css/CSSValue.h
WebCore/css/CSSValueList.cpp
WebCore/css/CSSValueList.h
WebCore/css/FontFamilyValue.cpp
WebCore/css/FontValue.cpp
WebCore/css/FontValue.h
WebCore/css/MediaList.h
WebCore/css/ShadowValue.cpp
WebCore/css/ShadowValue.h
WebCore/css/StyleBase.cpp [new file with mode: 0644]
WebCore/css/StyleBase.h [new file with mode: 0644]
WebCore/css/StyleList.cpp [new file with mode: 0644]
WebCore/css/StyleList.h [new file with mode: 0644]
WebCore/css/StyleSheet.h
WebCore/css/cssparser.cpp
WebCore/css/cssstyleselector.cpp
WebCore/css/cssstyleselector.h
WebCore/dom/CSSMappedAttributeDeclaration.h
WebCore/ksvg2/svg/SVGColor.cpp
WebCore/ksvg2/svg/SVGColor.h
WebCore/ksvg2/svg/SVGStyledElement.cpp

index 910fa7443d6a08ad65f292f77374bced9e7bc17d..7c47058f2db2788add1dde5d603369fefb58909b 100644 (file)
@@ -1,3 +1,82 @@
+2006-05-16  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by hyatt.
+
+        Split css_base.* into separate files (one per class).
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=8935
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/kjs_css.cpp:
+        * css/CSSBorderImageValue.cpp:
+        * css/CSSBorderImageValue.h:
+        * css/CSSCharsetRule.h:
+        * css/CSSFontFaceRule.h:
+        * css/CSSGrammar.y:
+        * css/CSSImportRule.h:
+        * css/CSSInheritedValue.cpp:
+        * css/CSSInitialValue.cpp:
+        * css/CSSMediaRule.h:
+        * css/CSSMutableStyleDeclaration.h:
+        * css/CSSNamespace.h: Added.
+        (WebCore::CSSNamespace::CSSNamespace):
+        (WebCore::CSSNamespace::namespaceForPrefix):
+        * css/CSSPageRule.h:
+        * css/CSSPrimitiveValue.h:
+        * css/CSSProperty.cpp:
+        * css/CSSProperty.h:
+        * css/CSSRule.h:
+        * css/CSSRuleList.cpp:
+        * css/CSSSelector.cpp: Added.
+        * css/CSSSelector.h: Added.
+        (WebCore::CSSSelector::CSSSelector):
+        * css/CSSStyleDeclaration.h:
+        * css/CSSStyleRule.cpp:
+        * css/CSSStyleRule.h:
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::~CSSStyleSheet):
+        * css/CSSStyleSheet.h:
+        * css/CSSValue.h:
+        * css/CSSValueList.cpp:
+        * css/CSSValueList.h:
+        * css/FontFamilyValue.cpp:
+        * css/FontValue.cpp:
+        * css/FontValue.h:
+        * css/MediaList.h:
+        * css/ShadowValue.cpp:
+        * css/ShadowValue.h:
+        * css/StyleBase.cpp: Added.
+        (WebCore::StyleBase::stylesheet):
+        * css/StyleBase.h: Added.
+        (WebCore::StyleBase::StyleBase):
+        * css/StyleList.cpp: Added.
+        * css/StyleList.h: Added.
+        * css/StyleSheet.h:
+        * css/css_base.cpp: Removed.
+        * css/css_base.h: Removed.
+        * css/cssparser.cpp:
+        * css/cssstyleselector.cpp:
+        (WebCore::CSSStyleSelector::matchRulesForList):
+        * css/cssstyleselector.h:
+        * dom/CSSMappedAttributeDeclaration.h:
+        * ksvg2/svg/SVGColor.cpp:
+        (WebCore::SVGColor::SVGColor):
+        (WebCore::SVGColor::setRGBColor):
+        (WebCore::SVGColor::setRGBColorICCColor):
+        (WebCore::SVGColor::setColor):
+        (WebCore::SVGColor::cssText):
+        (WebCore::SVGColor::color):
+        * ksvg2/svg/SVGColor.h:
+        * ksvg2/svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::SVGStyledElement):
+        (WebCore::SVGStyledElement::className):
+        (WebCore::SVGStyledElement::createRenderer):
+        (WebCore::SVGStyledElement::parseMappedAttribute):
+        (WebCore::SVGStyledElement::notifyAttributeChange):
+        (WebCore::SVGStyledElement::attributeChanged):
+        (WebCore::SVGStyledElement::canvas):
+        (WebCore::SVGStyledElement::updateCanvasItem):
+        (WebCore::SVGStyledElement::pushAttributeContext):
+
 2006-05-15  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by hyatt.
index d4e73e76f07fd3facb6a5b0f4d50f71750bc1f52..ba401453e055ad05dbbeb58d73387dd3bca3815e 100644 (file)
                        Name="css"\r
                        >\r
                        <File\r
-                               RelativePath="..\..\css\css_base.cpp"\r
+                               RelativePath="..\..\css\CSSSelector.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\css\css_base.h"\r
+                               RelativePath="..\..\css\CSSSelector.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\css\StyleBase.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\css\StyleBase.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\css\CSSNamespace.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\css\StyleList.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\css\StyleList.h"\r
                                >\r
                        </File>\r
                        <File\r
index 392f212eb42786fa631fc7881e4f85e960a06c57..b0f7271385b5e40c0a3b8d33ae704151c27e4d1a 100644 (file)
                A80E6DFC0A199067007FB8C5 /* CSSMutableStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6DFA0A199067007FB8C5 /* CSSMutableStyleDeclaration.h */; };
                A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6E0D0A19911C007FB8C5 /* CSSStyleDeclaration.h */; };
                A80E6E100A19911C007FB8C5 /* CSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6E0E0A19911C007FB8C5 /* CSSStyleDeclaration.cpp */; };
+               A80E734D0A199C77007FB8C5 /* StyleList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E73460A199C77007FB8C5 /* StyleList.cpp */; };
+               A80E734E0A199C77007FB8C5 /* CSSNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E73470A199C77007FB8C5 /* CSSNamespace.h */; };
+               A80E734F0A199C77007FB8C5 /* CSSSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E73480A199C77007FB8C5 /* CSSSelector.cpp */; };
+               A80E73500A199C77007FB8C5 /* StyleBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E73490A199C77007FB8C5 /* StyleBase.h */; };
+               A80E73510A199C77007FB8C5 /* StyleList.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E734A0A199C77007FB8C5 /* StyleList.h */; };
+               A80E73520A199C77007FB8C5 /* CSSSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E734B0A199C77007FB8C5 /* CSSSelector.h */; };
+               A80E73530A199C77007FB8C5 /* StyleBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E734C0A199C77007FB8C5 /* StyleBase.cpp */; };
                A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369AE097374F500D74463 /* HTMLIsIndexElement.h */; };
                A81369CB097374F600D74463 /* HTMLIsIndexElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */; };
                A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B0097374F500D74463 /* HTMLInputElement.h */; };
                BCC8D1740988301200140BF2 /* Pen.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC8D1720988301200140BF2 /* Pen.h */; };
                BCCD13200A0C0030001AFA8B /* FontData.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCCD131E0A0C0030001AFA8B /* FontData.mm */; };
                BCD75ABC0989A446003E28DF /* Image.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD75ABB0989A446003E28DF /* Image.h */; };
-               BCEA478D097CAAC80094C9E4 /* css_base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA477A097CAAC80094C9E4 /* css_base.cpp */; };
-               BCEA478E097CAAC80094C9E4 /* css_base.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477B097CAAC80094C9E4 /* css_base.h */; };
                BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */; };
                BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; };
                BCEA4798097CAAC80094C9E4 /* csshelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4785097CAAC80094C9E4 /* csshelper.cpp */; };
                A80E6DFA0A199067007FB8C5 /* CSSMutableStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSMutableStyleDeclaration.h; sourceTree = "<group>"; };
                A80E6E0D0A19911C007FB8C5 /* CSSStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSStyleDeclaration.h; sourceTree = "<group>"; };
                A80E6E0E0A19911C007FB8C5 /* CSSStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSStyleDeclaration.cpp; sourceTree = "<group>"; };
+               A80E73460A199C77007FB8C5 /* StyleList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleList.cpp; sourceTree = "<group>"; };
+               A80E73470A199C77007FB8C5 /* CSSNamespace.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSNamespace.h; sourceTree = "<group>"; };
+               A80E73480A199C77007FB8C5 /* CSSSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSSelector.cpp; sourceTree = "<group>"; };
+               A80E73490A199C77007FB8C5 /* StyleBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleBase.h; sourceTree = "<group>"; };
+               A80E734A0A199C77007FB8C5 /* StyleList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleList.h; sourceTree = "<group>"; };
+               A80E734B0A199C77007FB8C5 /* CSSSelector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSSelector.h; sourceTree = "<group>"; };
+               A80E734C0A199C77007FB8C5 /* StyleBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleBase.cpp; sourceTree = "<group>"; };
                A810E39308A4160F00333D98 /* KCanvasTreeDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasTreeDebug.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A810E39408A4160F00333D98 /* KCanvasTreeDebug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasTreeDebug.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8122C7E08D564B000844FA3 /* GetSVGDocument.idl */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = GetSVGDocument.idl; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BCC8D1720988301200140BF2 /* Pen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Pen.h; sourceTree = "<group>"; };
                BCCD131E0A0C0030001AFA8B /* FontData.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FontData.mm; sourceTree = "<group>"; };
                BCD75ABB0989A446003E28DF /* Image.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Image.h; sourceTree = "<group>"; };
-               BCEA477A097CAAC80094C9E4 /* css_base.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = css_base.cpp; sourceTree = "<group>"; };
-               BCEA477B097CAAC80094C9E4 /* css_base.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = css_base.h; sourceTree = "<group>"; };
                BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSComputedStyleDeclaration.cpp; sourceTree = "<group>"; };
                BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSComputedStyleDeclaration.h; sourceTree = "<group>"; };
                BCEA477E097CAAC80094C9E4 /* CSSGrammar.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y; sourceTree = "<group>"; };
                        children = (
                                A80E6CDA0A1989CA007FB8C5 /* Counter.h */,
                                930705C709E0C95F00B17FE4 /* Counter.idl */,
-                               BCEA477A097CAAC80094C9E4 /* css_base.cpp */,
-                               BCEA477B097CAAC80094C9E4 /* css_base.h */,
                                A80E6CBB0A1989CA007FB8C5 /* CSSBorderImageValue.cpp */,
                                A80E6CDD0A1989CA007FB8C5 /* CSSBorderImageValue.h */,
                                A80E6CCF0A1989CA007FB8C5 /* CSSCharsetRule.h */,
                                A80E6CD90A1989CA007FB8C5 /* CSSMediaRule.h */,
                                A80E6DF90A199067007FB8C5 /* CSSMutableStyleDeclaration.cpp */,
                                A80E6DFA0A199067007FB8C5 /* CSSMutableStyleDeclaration.h */,
+                               A80E73470A199C77007FB8C5 /* CSSNamespace.h */,
                                A80E6CCB0A1989CA007FB8C5 /* CSSPageRule.cpp */,
                                A80E6CD60A1989CA007FB8C5 /* CSSPageRule.h */,
                                BCEA4787097CAAC80094C9E4 /* cssparser.cpp */,
                                14CF7A7009F5CF9A00EB3665 /* CSSRule.idl */,
                                A80E6CDF0A1989CA007FB8C5 /* CSSRuleList.cpp */,
                                A80E6CC80A1989CA007FB8C5 /* CSSRuleList.h */,
+                               A80E73480A199C77007FB8C5 /* CSSSelector.cpp */,
+                               A80E734B0A199C77007FB8C5 /* CSSSelector.h */,
                                A80E6E0E0A19911C007FB8C5 /* CSSStyleDeclaration.cpp */,
                                A80E6E0D0A19911C007FB8C5 /* CSSStyleDeclaration.h */,
                                142011AE0A003117008303F9 /* CSSStyleDeclaration.idl */,
                                A80E6CE00A1989CA007FB8C5 /* RectImpl.h */,
                                A80E6CCA0A1989CA007FB8C5 /* ShadowValue.cpp */,
                                A80E6CBE0A1989CA007FB8C5 /* ShadowValue.h */,
+                               A80E734C0A199C77007FB8C5 /* StyleBase.cpp */,
+                               A80E73490A199C77007FB8C5 /* StyleBase.h */,
+                               A80E73460A199C77007FB8C5 /* StyleList.cpp */,
+                               A80E734A0A199C77007FB8C5 /* StyleList.h */,
                                A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */,
                                A8EA80040A19516E00A8EF5F /* StyleSheet.h */,
                                A8EA80030A19516E00A8EF5F /* StyleSheetList.cpp */,
                                BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */,
                                BC1A37C0097C715F0019F3D8 /* DOMViews.h in Headers */,
                                BC1A37C2097C715F0019F3D8 /* DOMViewsInternal.h in Headers */,
-                               BCEA478E097CAAC80094C9E4 /* css_base.h in Headers */,
                                BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
                                BCEA479B097CAAC80094C9E4 /* cssparser.h in Headers */,
                                BCEA479E097CAAC80094C9E4 /* cssstyleselector.h in Headers */,
                                A80E6D0D0A1989CA007FB8C5 /* CSSRule.h in Headers */,
                                A80E6DFC0A199067007FB8C5 /* CSSMutableStyleDeclaration.h in Headers */,
                                A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */,
+                               A80E734E0A199C77007FB8C5 /* CSSNamespace.h in Headers */,
+                               A80E73500A199C77007FB8C5 /* StyleBase.h in Headers */,
+                               A80E73510A199C77007FB8C5 /* StyleList.h in Headers */,
+                               A80E73520A199C77007FB8C5 /* CSSSelector.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC1A37BA097C715F0019F3D8 /* DOMInternal.mm in Sources */,
                                BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */,
                                BC1A37C1097C715F0019F3D8 /* DOMViews.mm in Sources */,
-                               BCEA478D097CAAC80094C9E4 /* css_base.cpp in Sources */,
                                BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */,
                                BCEA4798097CAAC80094C9E4 /* csshelper.cpp in Sources */,
                                BCEA479A097CAAC80094C9E4 /* cssparser.cpp in Sources */,
                                A80E6D090A1989CA007FB8C5 /* CSSRuleList.cpp in Sources */,
                                A80E6DFB0A199067007FB8C5 /* CSSMutableStyleDeclaration.cpp in Sources */,
                                A80E6E100A19911C007FB8C5 /* CSSStyleDeclaration.cpp in Sources */,
+                               A80E734D0A199C77007FB8C5 /* StyleList.cpp in Sources */,
+                               A80E734F0A199C77007FB8C5 /* CSSSelector.cpp in Sources */,
+                               A80E73530A199C77007FB8C5 /* StyleBase.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index f727cdc942a8fbcc90659a59d719f3855fb28d12..36181f0c307f99f2431320b579e0bca4c10a4c04 100644 (file)
@@ -40,7 +40,6 @@
 #include "JSCSSStyleDeclaration.h"
 #include "MediaList.h"
 #include "StyleSheetList.h"
-#include "css_base.h"
 #include "kjs_dom.h"
 
 #include "kjs_css.lut.h"
index dff511cffdec43d143fe3ea080eb42462e082228..13c71a4af29415c4d742460437649bc01bb1b87b 100644 (file)
@@ -23,6 +23,7 @@
 #include "CSSBorderImageValue.h"
 
 #include "CSSImageValue.h"
+#include "PlatformString.h"
 #include "RectImpl.h"
 
 namespace WebCore {
index a7823a02acc305aee9c6cf0da0f783f2e8013c0a..09f486461d7459454404a9a086c926778eace0e4 100644 (file)
@@ -24,6 +24,8 @@
 #define CSSBorderImageValue_H
 
 #include "CSSValue.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
index 8616c4b9154704a6bf4fe0d78c9412d090e98b01..ae12c766f4652edc7665158e2265bbe4cea93201 100644 (file)
@@ -25,6 +25,7 @@
 #define CSSCharsetRule_H
 
 #include "CSSRule.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
index 1324a669374663c9e52f6fd758f767323c51d7d2..f45f44c3ee2e4e2435949a417662e4ed5c6fc462 100644 (file)
@@ -25,6 +25,7 @@
 #define CSSFontFaceRule_H
 
 #include "CSSRule.h"
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
index 6f09033d9ad04d839c7a89a12b53d88ec3f8b139..5e2462ba0f2eca1e1016a57e3e0087c809c6531f 100644 (file)
@@ -28,6 +28,7 @@
 #include "CSSPrimitiveValue.h"
 #include "CSSRule.h"
 #include "CSSRuleList.h"
+#include "CSSSelector.h"
 #include "CSSStyleSheet.h"
 #include "Document.h"
 #include "HTMLNames.h"
index 078a446ed9bb359c3999e3311d007fd03ee29df1..0fbb7e40fa6c5e58b3f03ace0410b3ee4282ab13 100644 (file)
 
 #include "CSSRule.h"
 #include "CachedObjectClient.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
 class CachedCSSStyleSheet;
+class MediaList;
 
 class CSSImportRule : public CSSRule, public CachedObjectClient
 {
index 56c094409872b5458a23949d5ccd64fff747fe63..b1e14603188750aef3ffb3a7b52bada2d1c34cd8 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "CSSInheritedValue.h"
 
+#include "PlatformString.h"
+
 namespace WebCore {
 
 unsigned short CSSInheritedValue::cssValueType() const
index a5e5eec885d4793e213a78e9284e12863c0ce386..1c91b5950371607a4827bb108668e9d2ae4025f4 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "CSSInitialValue.h"
 
+#include "PlatformString.h"
+
 namespace WebCore {
 
 unsigned short CSSInitialValue::cssValueType() const
index d32c1fddce39536d674a29f6325337821727f98c..b4ec50f7880fdc601eeab533c2dac6004822d26f 100644 (file)
 #define CSSMediaRule_H
 
 #include "CSSRule.h"
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
 class CSSRuleList;
+class MediaList;
 
 class CSSMediaRule : public CSSRule
 {
@@ -48,7 +50,7 @@ public:
     virtual String cssText() const;
 
     /* Not part of the DOM */
-    unsigned append(CSSRule* rule);
+    unsigned append(CSSRule*);
 
 protected:
     RefPtr<MediaList> m_lstMedia;
index 04b8be3e1e2dcb1e3f3f16a3e6054c6ffe37d6d3..57d9bcaee31642c50efb17713ccea5a54f196672 100644 (file)
 #include "CSSStyleDeclaration.h"
 #include "CSSPrimitiveValue.h" // for CSSPrimitiveValue::UnitTypes
 #include "DeprecatedValueList.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
+class CSSProperty;
 class Node;
 
 class CSSMutableStyleDeclaration : public CSSStyleDeclaration
diff --git a/WebCore/css/CSSNamespace.h b/WebCore/css/CSSNamespace.h
new file mode 100644 (file)
index 0000000..b1e68e4
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the CSS implementation for KDE.
+ *
+ * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ *               1999 Waldo Bastian (bastian@kde.org)
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef CSSNamespace_H
+#define CSSNamespace_H
+
+#include "AtomicString.h"
+
+namespace WebCore {
+
+    struct CSSNamespace {
+        AtomicString m_prefix;
+        AtomicString m_uri;
+        CSSNamespace* m_parent;
+
+        CSSNamespace(const AtomicString& p, const AtomicString& u, CSSNamespace* parent) 
+            : m_prefix(p)
+            , m_uri(u)
+            , m_parent(parent) {}
+        ~CSSNamespace() { delete m_parent; }
+        
+        const AtomicString& uri() { return m_uri; }
+        const AtomicString& prefix() { return m_prefix; }
+        
+        CSSNamespace* namespaceForPrefix(const AtomicString& prefix)
+        {
+            if (prefix == m_prefix)
+                return this;
+            if (m_parent)
+                return m_parent->namespaceForPrefix(prefix);
+            return 0;
+        }
+    };
+}
+
+#endif
index 0202729d5343e7354a637b98c2b5d3a32d1b7139..4f5ae2134799d415af1defefa914de15c57fd152 100644 (file)
@@ -25,6 +25,7 @@
 #define CSSPageRule_H
 
 #include "CSSRule.h"
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
index 48fb4582e1b30f061a134ac7806c137939b192df..1341b86d6d152c3d1c836394fc4beee8fc7f2934 100644 (file)
@@ -24,6 +24,7 @@
 #define CSSPrimitiveValue_H
 
 #include "CSSValue.h"
+#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
@@ -32,6 +33,7 @@ class DashboardRegion;
 class Pair;
 class RectImpl;
 class RenderStyle;
+class StringImpl;
 
 typedef int ExceptionCode;
 
index 93625d0186e7685166046bd55fa41f6fe8cacc6d..f0378a13dd2893467d18002a7d7f8904adc9d526 100644 (file)
@@ -21,6 +21,7 @@
  */
 #include "config.h"
 #include "CSSProperty.h"
+#include "PlatformString.h"
 
 // Not in any header, so just declare it here for now.
 WebCore::String getPropertyName(unsigned short id);
index 49f20765f0da21d23d95e58bc1052c500e6c1381..6f87e8254d3a2c372a153a4ea155463fff2b1831 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "CSSValue.h"
 #include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
index 19d18b8e1a8672afd7dbfb0cfe08cd9ae52505ad..0abb0714911591418de13aedb075daadce32bd94 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef CSSRule_H
 #define CSSRule_H
 
-#include "css_base.h" // for StyleBase
+#include "StyleBase.h"
 
 namespace WebCore {
 
index bb2ce0dc50164513b60f01413e1a2bc0296b7686..a9f06945917cd7525b91a26babf77d8db08718c1 100644 (file)
@@ -24,7 +24,7 @@
 #include "CSSRuleList.h"
 
 #include "CSSRule.h"
-#include "css_base.h" // for StyleList
+#include "StyleList.h"
 
 namespace WebCore {
 
similarity index 84%
rename from WebCore/css/css_base.cpp
rename to WebCore/css/CSSSelector.cpp
index 74b1a23954d52d2565a3fff24b22a382503a1c40..b2447203d6ebf4007ae0b29b2ad0aafc39a5eea7 100644 (file)
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-
 #include "config.h"
-#include "css_base.h"
-
-#include "Document.h"
-#include "StyleSheet.h"
+#include "CSSSelector.h"
 
 namespace WebCore {
 
-void StyleBase::checkLoaded()
-{
-    if (parent())
-        parent()->checkLoaded();
-}
-
-StyleSheet* StyleBase::stylesheet()
-{
-    StyleBase *b = this;
-    while (b && !b->isStyleSheet())
-        b = b->parent();
-    return static_cast<StyleSheet *>(b);
-}
-
-String StyleBase::baseURL()
-{
-    // try to find the style sheet. If found look for its url.
-    // If it has none, look for the parentsheet, or the parentNode and
-    // try to find out about their url
-
-    StyleSheet* sheet = stylesheet();
-
-    if (!sheet)
-        return String();
-
-    if (!sheet->href().isNull())
-        return sheet->href();
-
-    // find parent
-    if (sheet->parent()) 
-        return sheet->parent()->baseURL();
-
-    if (!sheet->ownerNode()) 
-        return String();
-
-    return sheet->ownerNode()->document()->baseURL();
-}
-
-// ------------------------------------------------------------------------------
-
-void StyleList::append(PassRefPtr<StyleBase> child)
-{
-    StyleBase* c = child.get();
-    m_children.append(child);
-    c->insertedIntoParent();
-}
-
-void StyleList::insert(unsigned position, PassRefPtr<StyleBase> child)
-{
-    StyleBase* c = child.get();
-    if (position >= length())
-        m_children.append(child);
-    else
-        m_children.insert(position, child);
-    c->insertedIntoParent();
-}
-
-void StyleList::remove(unsigned position)
-{
-    if (position >= length())
-        return;
-    m_children.remove(position);
-}
-
-// --------------------------------------------------------------------------------
-
 void CSSSelector::print()
 {
     if (tagHistory)
@@ -241,7 +171,6 @@ void CSSSelector::extractPseudoType() const
         _pseudoType = PseudoOther;
 }
 
-
 bool CSSSelector::operator == (const CSSSelector &other)
 {
     const CSSSelector *sel1 = this;
@@ -337,6 +266,4 @@ String CSSSelector::selectorText() const
     return str;
 }
 
-// ----------------------------------------------------------------------------
-
 }
similarity index 53%
rename from WebCore/css/css_base.h
rename to WebCore/css/CSSSelector.h
index caecd3e68200957a182ef19b25df1ac1c3b67144..afbaf9de5edf26e7c1dfd5fa576983f9b0854678 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef CSS_BASE_H
-#define CSS_BASE_H
+#ifndef CSSSelector_H
+#define CSSSelector_H
 
 #include "QualifiedName.h"
-#include <wtf/Vector.h>
 
 namespace WebCore {
 
-    class StyleSheet;
-    class MediaList;
-
-    class CSSSelector;
-    class CSSProperty;
-    class CSSValue;
-    class CSSPrimitiveValue;
-    class CSSRule;
-    class CSSStyleRule;
-
-    class Document;
-
-    struct CSSNamespace {
-        AtomicString m_prefix;
-        AtomicString m_uri;
-        CSSNamespace* m_parent;
-
-        CSSNamespace(const AtomicString& p, const AtomicString& u, CSSNamespace* parent) 
-            :m_prefix(p), m_uri(u), m_parent(parent) {}
-        ~CSSNamespace() { delete m_parent; }
-        
-        const AtomicString& uri() { return m_uri; }
-        const AtomicString& prefix() { return m_prefix; }
-        
-        CSSNamespace* namespaceForPrefix(const AtomicString& prefix) {
-            if (prefix == m_prefix)
-                return this;
-            if (m_parent)
-                return m_parent->namespaceForPrefix(prefix);
-            return 0;
-        }
-    };
-    
 // this class represents a selector for a StyleRule
     class CSSSelector
     {
     public:
         CSSSelector()
-            : tagHistory(0), simpleSelector(0), nextSelector(0), attr(anyQName()), tag(anyQName()),
-              m_relation(Descendant), match(None), pseudoId(0), _pseudoType(PseudoNotParsed)
+            : tagHistory(0)
+            , simpleSelector(0)
+            , nextSelector(0)
+            , attr(anyQName())
+            , tag(anyQName())
+            , m_relation(Descendant)
+            , match(None)
+            , pseudoId(0)
+            , _pseudoType(PseudoNotParsed)
         {}
         
         CSSSelector(const QualifiedName& qName)
-            : tagHistory(0), simpleSelector(0), nextSelector(0), attr(anyQName()), tag(qName),
-              m_relation(Descendant), match(None), pseudoId(0), _pseudoType(PseudoNotParsed)
+            : tagHistory(0)
+            , simpleSelector(0)
+            , nextSelector(0)
+            , attr(anyQName())
+            , tag(qName)
+            , m_relation(Descendant)
+            , match(None)
+            , pseudoId(0)
+            , _pseudoType(PseudoNotParsed)
         {}
 
         ~CSSSelector() {
@@ -192,73 +172,6 @@ namespace WebCore {
     private:
         void extractPseudoType() const;
     };
-
-    // a style class which has a parent (almost all have)
-    class StyleBase : public Shared<StyleBase> {
-    public:
-        StyleBase(StyleBase* parent)
-            : m_parent(parent), m_strictParsing(!parent || parent->useStrictParsing()) { }
-        virtual ~StyleBase() { }
-
-        StyleBase* parent() const { return m_parent; }
-        void setParent(StyleBase* parent) { m_parent = parent; }
-
-        // returns the url of the style sheet this object belongs to
-        String baseURL();
-
-        virtual bool isStyleSheet() const { return false; }
-        virtual bool isCSSStyleSheet() const { return false; }
-        virtual bool isXSLStyleSheet() const { return false; }
-        virtual bool isStyleSheetList() const { return false; }
-        virtual bool isMediaList() { return false; }
-        virtual bool isRuleList() { return false; }
-        virtual bool isRule() { return false; }
-        virtual bool isStyleRule() { return false; }
-        virtual bool isCharetRule() { return false; }
-        virtual bool isImportRule() { return false; }
-        virtual bool isMediaRule() { return false; }
-        virtual bool isFontFaceRule() { return false; }
-        virtual bool isPageRule() { return false; }
-        virtual bool isUnknownRule() { return false; }
-        virtual bool isStyleDeclaration() { return false; }
-        virtual bool isValue() { return false; }
-        virtual bool isPrimitiveValue() const { return false; }
-        virtual bool isValueList() { return false; }
-        virtual bool isValueCustom() { return false; }
-
-        virtual bool parseString(const String&, bool /*strict*/ = false) { return false; }
-        virtual void checkLoaded();
-
-        void setStrictParsing(bool b) { m_strictParsing = b; }
-        bool useStrictParsing() const { return m_strictParsing; }
-
-        virtual void insertedIntoParent() { }
-
-        StyleSheet* stylesheet();
-
-    private:
-        StyleBase* m_parent;
-        bool m_strictParsing;
-    };
-
-    // a style class which has a list of children (StyleSheets for example)
-    class StyleList : public StyleBase {
-    public:
-        StyleList(StyleBase* parent) : StyleBase(parent) { }
-
-        unsigned length() { return m_children.size(); }
-        StyleBase* item(unsigned num) { return num < length() ? m_children[num].get() : 0; }
-
-        void append(PassRefPtr<StyleBase>);
-        void insert(unsigned position, PassRefPtr<StyleBase>);
-        void remove(unsigned position);
-
-    protected:
-        Vector<RefPtr<StyleBase> > m_children;
-    };
-
-    int getPropertyID(const char *tagStr, int len);
-
 }
 
 #endif
index 806c18e7c13e22e61ffcb0673d7140c308db8e52..5e103e328791055d6e84e706cbdba432806666c0 100644 (file)
 #ifndef CSSStyleDeclaration_H
 #define CSSStyleDeclaration_H
 
-#include "css_base.h" // for StyleBase
+#include "StyleBase.h"
+#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
 class CSSMutableStyleDeclaration;
+class CSSRule;
+class CSSValue;
 
 typedef int ExceptionCode;
 
@@ -35,7 +38,7 @@ class CSSStyleDeclaration : public StyleBase {
 public:
     virtual bool isStyleDeclaration();
 
-    static bool isPropertyName(const String& propertyName);
+    static bool isPropertyName(const String&);
 
     CSSRule* parentRule() const;
 
@@ -73,8 +76,8 @@ protected:
     CSSStyleDeclaration(CSSRule* parentRule = 0);
 
 private:
-    CSSStyleDeclaration(const CSSStyleDeclaration &);
-    CSSStyleDeclaration& operator=(const CSSStyleDeclaration &);
+    CSSStyleDeclaration(const CSSStyleDeclaration&);
+    CSSStyleDeclaration& operator=(const CSSStyleDeclaration&);
 };
 
 } // namespace
index 50d3633b1210917f4f087de55dc573664213d83a..57f4c7fb786dd7c39f2ac4510d0d075a0d7a8113 100644 (file)
@@ -24,6 +24,7 @@
 #include "CSSStyleRule.h"
 
 #include "CSSMutableStyleDeclaration.h"
+#include "CSSSelector.h"
 
 namespace WebCore {
 
index e729eebd764bd585558d22f74e87b6bbaf171b1f..6171a7e015b7718d4d0db9570ede2adaabbdfad2 100644 (file)
 #define CSSStyleRule_H
 
 #include "CSSRule.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
 class CSSMutableStyleDeclaration;
+class CSSSelector;
 
 class CSSStyleRule : public CSSRule
 {
index 4c805f680977209fbd1a600c7dcf6001f5b2b392..0d43f3b64d2ab0de294facce54b790188558fb67 100644 (file)
@@ -23,6 +23,7 @@
 #include "CSSStyleSheet.h"
 
 #include "CSSImportRule.h"
+#include "CSSNamespace.h"
 #include "cssparser.h"
 #include "CSSRuleList.h"
 #include "Document.h"
@@ -55,6 +56,11 @@ CSSStyleSheet::CSSStyleSheet(CSSRule *ownerRule, String href)
 {
 }
 
+CSSStyleSheet::~CSSStyleSheet()
+{
+    delete m_namespaces;
+}
+
 CSSRule *CSSStyleSheet::ownerRule() const
 {
     return (parent() && parent()->isRule()) ? static_cast<CSSRule*>(parent()) : 0;
index ace993d5ea38b09935e68fa22fd9af9b97b5725c..6dc343d59a1af54dbb12ecdbd021aca5b1cc8c09 100644 (file)
 
 namespace WebCore {
 
+class CSSNamespace;
 class CSSParser;
+class CSSRule;
 class CSSRuleList;
 class DocLoader;
+class Document;
 
 typedef int ExceptionCode;
 
@@ -40,7 +43,7 @@ public:
     CSSStyleSheet(CSSStyleSheet* parentSheet, String href = String());
     CSSStyleSheet(CSSRule* ownerRule, String href = String());
     
-    ~CSSStyleSheet() { delete m_namespaces; }
+    ~CSSStyleSheet();
     
     virtual bool isCSSStyleSheet() const { return true; }
 
index 4fdf5f47d7bde3c313267636b2d0578e2f641582..744358b67f65d4c1bb3bdc56c139c52dc5c75380 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef CSSValue_H
 #define CSSValue_H
 
-#include "css_base.h" // for StyleBase
+#include "StyleBase.h"
 
 namespace WebCore {
 
index caeeadbd016fb1ca3dda68983e6634b7ed228872..26b46f99934ca13f78f1220db5b2cffa0287d5d9 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "CSSValueList.h"
 
+#include "PlatformString.h"
+
 namespace WebCore {
 
 CSSValueList::~CSSValueList()
index 062fe04c7b304c1c45e864a2deb67a308eeb79e4..af87f8524fa4519f080143a20758b611b944af50 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "CSSValue.h"
 #include "DeprecatedPtrList.h"
+#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
index 910a1abcf3e5dc25f4d10b3b4dffe1d74d01c919..2e6b382dcd4fe697666c67e3ab66bc5364880c59 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "FontFamilyValue.h"
 
+#include "PlatformString.h"
 #include "RegularExpression.h"
 
 namespace WebCore {
index f39643ad2423fcd4ffb28d813b276d3d618267fb..4b2594aa59f5dec92b6639c5555ed5ded2d96c30 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "CSSValueList.h"
 #include "CSSPrimitiveValue.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
index 9bab2cd36eb2f3f937abcda686c6afa95d6ec041..c75d0e10945f07b5f4f79faca637ec88c146a812 100644 (file)
 #define FontValue_H
 
 #include "CSSValue.h"
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
+class CSSPrimitiveValue;
 class CSSValueList;
 
 class FontValue : public CSSValue
index 7d717f684d5c0fc3921dd0bd93d6c3ad8cd9e904..3691e216db460f5c23101b793562d7f56265a68f 100644 (file)
 #ifndef MediaList_H
 #define MediaList_H
 
-#include "css_base.h"
+#include "StyleBase.h"
 #include "DeprecatedValueList.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
 class CSSStyleSheet;
+class CSSRule;
 
 class MediaList : public StyleBase
 {
index 874be673849560a55e0d7113fa8f2cd31b751384..f5287faaf40326e046d0523fde54e6f4b573cdd0 100644 (file)
@@ -23,6 +23,7 @@
 #include "ShadowValue.h"
 
 #include "CSSPrimitiveValue.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
index 610bee91c4d1e2b89eb74528d8d3b4ea9e2b2084..40b7c00d8d0debf32d1b91ecd03baa54ea5c181c 100644 (file)
 #define ShadowValue_H
 
 #include "CSSValue.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
+class CSSPrimitiveValue;
+
 // Used for text-shadow and box-shadow
 class ShadowValue : public CSSValue
 {
diff --git a/WebCore/css/StyleBase.cpp b/WebCore/css/StyleBase.cpp
new file mode 100644 (file)
index 0000000..acd5aca
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ *               1999 Waldo Bastian (bastian@kde.org)
+ *               2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
+ *               2001-2003 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2002, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "StyleBase.h"
+
+#include "Document.h"
+#include "Node.h"
+#include "StyleSheet.h"
+
+namespace WebCore {
+
+void StyleBase::checkLoaded()
+{
+    if (parent())
+        parent()->checkLoaded();
+}
+
+StyleSheet* StyleBase::stylesheet()
+{
+    StyleBase *b = this;
+    while (b && !b->isStyleSheet())
+        b = b->parent();
+    return static_cast<StyleSheet*>(b);
+}
+
+String StyleBase::baseURL()
+{
+    // try to find the style sheet. If found look for its url.
+    // If it has none, look for the parentsheet, or the parentNode and
+    // try to find out about their url
+
+    StyleSheet* sheet = stylesheet();
+
+    if (!sheet)
+        return String();
+
+    if (!sheet->href().isNull())
+        return sheet->href();
+
+    // find parent
+    if (sheet->parent()) 
+        return sheet->parent()->baseURL();
+
+    if (!sheet->ownerNode()) 
+        return String();
+
+    return sheet->ownerNode()->document()->baseURL();
+}
+
+}
diff --git a/WebCore/css/StyleBase.h b/WebCore/css/StyleBase.h
new file mode 100644 (file)
index 0000000..ab6e25f
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * This file is part of the CSS implementation for KDE.
+ *
+ * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ *               1999 Waldo Bastian (bastian@kde.org)
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef StyleBase_H
+#define StyleBase_H
+
+#include "Shared.h"
+
+namespace WebCore {
+
+    class String;
+    class StyleSheet;
+
+    // a style class which has a parent (almost all have)
+    class StyleBase : public Shared<StyleBase> {
+    public:
+        StyleBase(StyleBase* parent)
+            : m_parent(parent)
+            , m_strictParsing(!parent || parent->useStrictParsing())
+        { }
+        virtual ~StyleBase() { }
+
+        StyleBase* parent() const { return m_parent; }
+        void setParent(StyleBase* parent) { m_parent = parent; }
+
+        // returns the url of the style sheet this object belongs to
+        String baseURL();
+
+        virtual bool isStyleSheet() const { return false; }
+        virtual bool isCSSStyleSheet() const { return false; }
+        virtual bool isXSLStyleSheet() const { return false; }
+        virtual bool isStyleSheetList() const { return false; }
+        virtual bool isMediaList() { return false; }
+        virtual bool isRuleList() { return false; }
+        virtual bool isRule() { return false; }
+        virtual bool isStyleRule() { return false; }
+        virtual bool isCharetRule() { return false; }
+        virtual bool isImportRule() { return false; }
+        virtual bool isMediaRule() { return false; }
+        virtual bool isFontFaceRule() { return false; }
+        virtual bool isPageRule() { return false; }
+        virtual bool isUnknownRule() { return false; }
+        virtual bool isStyleDeclaration() { return false; }
+        virtual bool isValue() { return false; }
+        virtual bool isPrimitiveValue() const { return false; }
+        virtual bool isValueList() { return false; }
+        virtual bool isValueCustom() { return false; }
+
+        virtual bool parseString(const String&, bool /*strict*/ = false) { return false; }
+        virtual void checkLoaded();
+
+        void setStrictParsing(bool b) { m_strictParsing = b; }
+        bool useStrictParsing() const { return m_strictParsing; }
+
+        virtual void insertedIntoParent() { }
+
+        StyleSheet* stylesheet();
+
+    private:
+        StyleBase* m_parent;
+        bool m_strictParsing;
+    };
+}
+
+#endif
diff --git a/WebCore/css/StyleList.cpp b/WebCore/css/StyleList.cpp
new file mode 100644 (file)
index 0000000..f48c53b
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ *               1999 Waldo Bastian (bastian@kde.org)
+ *               2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
+ *               2001-2003 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2002, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "StyleList.h"
+
+namespace WebCore {
+
+void StyleList::append(PassRefPtr<StyleBase> child)
+{
+    StyleBase* c = child.get();
+    m_children.append(child);
+    c->insertedIntoParent();
+}
+
+void StyleList::insert(unsigned position, PassRefPtr<StyleBase> child)
+{
+    StyleBase* c = child.get();
+    if (position >= length())
+        m_children.append(child);
+    else
+        m_children.insert(position, child);
+    c->insertedIntoParent();
+}
+
+void StyleList::remove(unsigned position)
+{
+    if (position >= length())
+        return;
+    m_children.remove(position);
+}
+
+}
diff --git a/WebCore/css/StyleList.h b/WebCore/css/StyleList.h
new file mode 100644 (file)
index 0000000..db35cb1
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * This file is part of the CSS implementation for KDE.
+ *
+ * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ *               1999 Waldo Bastian (bastian@kde.org)
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef StyleList_H
+#define StyleList_H
+
+#include "StyleBase.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+    // a style class which has a list of children (StyleSheets for example)
+    class StyleList : public StyleBase {
+    public:
+        StyleList(StyleBase* parent) : StyleBase(parent) { }
+
+        unsigned length() { return m_children.size(); }
+        StyleBase* item(unsigned num) { return num < length() ? m_children[num].get() : 0; }
+
+        void append(PassRefPtr<StyleBase>);
+        void insert(unsigned position, PassRefPtr<StyleBase>);
+        void remove(unsigned position);
+
+    protected:
+        Vector<RefPtr<StyleBase> > m_children;
+    };
+}
+
+#endif
index 6177f069e7c367d778faeb32ec1a08a8c63151e3..4f09c7590d5946793ed56d8b63cccb6d40180ee6 100644 (file)
 #ifndef StyleSheet_H
 #define StyleSheet_H
 
-#include "css_base.h"
+#include "StyleList.h"
+#include "PlatformString.h"
 
 namespace WebCore {
 
 class Node;
 class CachedCSSStyleSheet;
+class MediaList;
 
 class StyleSheet : public StyleList {
 public:
index 7629fc9e39e76a26e6d100a5ec256ced47238681..ee3ffc23291cc2e70c6756045471c1be76fcbe6a 100644 (file)
@@ -35,6 +35,7 @@
 #include "CSSProperty.h"
 #include "CSSPropertyNames.h"
 #include "CSSRuleList.h"
+#include "CSSSelector.h"
 #include "CSSStyleRule.h"
 #include "CSSStyleSheet.h"
 #include "CSSQuirkPrimitiveValue.h"
index c0fade000a41e29b23ccbc12841fff9d02ef8350..53f296c77f8c7b879471f2913df126d43009f490 100644 (file)
@@ -31,6 +31,7 @@
 #include "CSSProperty.h"
 #include "CSSPropertyNames.h"
 #include "CSSRuleList.h"
+#include "CSSSelector.h"
 #include "CSSStyleRule.h"
 #include "CSSStyleSheet.h"
 #include "CSSValueKeywords.h"
@@ -372,8 +373,7 @@ void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& l
     }
 }
 
-void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules,
-                                         int& firstRuleIndex, int& lastRuleIndex)
+void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules, int& firstRuleIndex, int& lastRuleIndex)
 {
     if (!rules) return;
     for (CSSRuleData* d = rules->first(); d; d = d->next()) {
index bf003465c7152cbebba112d784feb9cbea916b8b..7c84976fbb9a2cbe4ecdebe2c443fae7cca52a63 100644 (file)
@@ -32,12 +32,14 @@ class KURL;
 namespace WebCore {
 
 class CSSMutableStyleDeclaration;
+class CSSPrimitiveValue;
 class CSSProperty;
 class CSSRuleData;
 class CSSRuleDataList;
 class CSSRuleList;
 class CSSRuleSet;
 class CSSSelector;
+class CSSStyleRule;
 class CSSStyleSheet;
 class CSSValue;
 class Document;
index d53a614a262b2db118ef2e7e3e4c2755dda25e36..5aab2eb83f98b6430bd6fac9bdf1aa3b04a04111 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "CSSMutableStyleDeclaration.h"
 #include "MappedAttributeEntry.h"
+#include "QualifiedName.h"
 
 namespace WebCore {
 
index 4d85aa6df73c147278f53835fa25465a36e665a7..cbc7909c6b8d46663e449e37431f3ad6842d2d03 100644 (file)
 
 #include "config.h"
 #if SVG_SUPPORT
-#include "DeprecatedStringList.h"
-
-
-#include "ksvg.h"
 #include "SVGColor.h"
-#include "SVGDOMImplementation.h"
+
+#include "DeprecatedStringList.h"
 #include "RGBColor.h"
+#include "SVGDOMImplementation.h"
+#include "ksvg.h"
 
-using namespace WebCore;
+namespace WebCore {
 
 SVGColor::SVGColor() : CSSValue()
 {
     m_colorType = SVG_COLORTYPE_UNKNOWN;
 }
 
-SVGColor::SVGColor(StringImpl *rgbColor) : CSSValue()
+SVGColor::SVGColor(StringImplrgbColor) : CSSValue()
 {
     m_colorType = SVG_COLORTYPE_RGBCOLOR;
     setRGBColor(rgbColor);
@@ -216,58 +215,53 @@ static const Color cmap[] =
 };
 #endif
 
-void SVGColor::setRGBColor(StringImpl *rgbColor)
+void SVGColor::setRGBColor(StringImplrgbColor)
 {
     m_rgbColor = rgbColor;
 
-    if(m_rgbColor.isNull())
+    if (m_rgbColor.isNull())
         return;
 
     DeprecatedString parse = m_rgbColor.deprecatedString().stripWhiteSpace();
-    if(parse.startsWith("rgb("))
-    {
+    if (parse.startsWith("rgb(")) {
         DeprecatedStringList colors = DeprecatedStringList::split(',', parse);
         DeprecatedString r = colors[0].right((colors[0].length() - 4));
         DeprecatedString g = colors[1];
         DeprecatedString b = colors[2].left((colors[2].length() - 1));
     
-        if(r.contains("%")) {
+        if (r.contains("%")) {
             r = r.left(r.length() - 1);
             r = DeprecatedString::number(int((double(255 * r.toDouble()) / 100.0)));
         }
 
-        if(g.contains("%"))
-        {
+        if (g.contains("%")) {
             g = g.left(g.length() - 1);
             g = DeprecatedString::number(int((double(255 * g.toDouble()) / 100.0)));
         }
     
-        if(b.contains("%"))
-        {
+        if (b.contains("%")) {
             b = b.left(b.length() - 1);
             b = DeprecatedString::number(int((double(255 * b.toDouble()) / 100.0)));
         }
 
         m_qColor = Color(r.toInt(), g.toInt(), b.toInt());
-    }
-    else
-    {
+    } else {
         String colorName = m_rgbColor.lower();
         DeprecatedString name = colorName.deprecatedString();
 //        int col = WebCore::getValueID(name.ascii(), name.length());
-//        if(col == 0)
+//        if (col == 0)
             m_qColor = Color(name);
 //        else
 //            m_qColor = cmap[col - SVGCSS_VAL_ALICEBLUE];
     }
 }
 
-void SVGColor::setRGBColorICCColor(StringImpl * /* rgbColor */, StringImpl * /* iccColor */)
+void SVGColor::setRGBColorICCColor(StringImpl* /* rgbColor */, StringImpl* /* iccColor */)
 {
     // TODO: implement me!
 }
 
-void SVGColor::setColor(unsigned short colorType, StringImpl * /* rgbColor */ , StringImpl * /* iccColor */)
+void SVGColor::setColor(unsigned short colorType, StringImpl* /* rgbColor */ , StringImpl* /* iccColor */)
 {
     // TODO: implement me!
     m_colorType = colorType;
@@ -275,17 +269,19 @@ void SVGColor::setColor(unsigned short colorType, StringImpl * /* rgbColor */ ,
 
 String SVGColor::cssText() const
 {
-    if(m_colorType == SVG_COLORTYPE_RGBCOLOR)
+    if (m_colorType == SVG_COLORTYPE_RGBCOLOR)
         return m_rgbColor;
 
     return String();
 }
 
-const Color &SVGColor::color() const
+const ColorSVGColor::color() const
 {
     return m_qColor;
 }
 
+}
+
 // vim:ts=4:noet
 #endif // SVG_SUPPORT
 
index 04535546c1c84be8d509ba21715aa916e641f8b6..ee6afda5bdd0e6b08dcd05d22db2dd2fa3a5be00 100644 (file)
 
 #include "CSSValue.h"
 #include "Color.h"
+#include "PlatformString.h"
 
 namespace WebCore
 {
     class RGBColor;
+    class StringImpl;
 
     class SVGColor : public CSSValue
     {
index 81e9adf6164ad969aa34202bd5b720c4bfb2e3e3..d55df4083372557bddaba42e5fb79971aa75805c 100644 (file)
@@ -26,7 +26,9 @@
 
 #include "Attr.h"
 #include "Document.h"
+#include "KCanvasCreator.h"
 #include "KCanvasRenderingStyle.h"
+#include "KRenderingDevice.h"
 #include "PlatformString.h"
 #include "RenderCanvas.h"
 #include "RenderPath.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
 #include "SVGSVGElement.h"
-#include "css_base.h"
 #include "ksvg.h"
 #include "ksvgcssproperties.h"
-#include <kcanvas/KCanvasCreator.h>
-#include <kcanvas/device/KRenderingDevice.h>
+
 #include <wtf/Assertions.h>
 
 namespace WebCore {
 
+// Defined in CSSGrammar.y, but not in any header, so just declare it here for now.
+int getPropertyID(const char* str, int len);
+
 using namespace SVGNames;
 
-SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document *doc)
-: SVGElement(tagName, doc)
+SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* doc)
+    : SVGElement(tagName, doc)
+    , m_updateVectorial(false)
 {
-    m_updateVectorial = false;
 }
 
 SVGStyledElement::~SVGStyledElement()
 {
 }
 
-SVGAnimatedString *SVGStyledElement::className() const
+SVGAnimatedStringSVGStyledElement::className() const
 {
-    return lazy_create(m_className, (SVGStyledElement *)0); // TODO: use notification context?
+    return lazy_create(m_className, (SVGStyledElement*)0); // TODO: use notification context?
 }
 
-RenderObject *SVGStyledElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* SVGStyledElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
     RefPtr<KCanvasPath> pathData = toPathData();
     if (!pathData)
@@ -72,7 +75,7 @@ RenderObject *SVGStyledElement::createRenderer(RenderArena *arena, RenderStyle *
     return renderingDevice()->createItem(arena, style, this, pathData.get());
 }
 
-void SVGStyledElement::parseMappedAttribute(MappedAttribute *attr)
+void SVGStyledElement::parseMappedAttribute(MappedAttributeattr)
 {
     const String& value = attr->value();
     // id and class are handled by StyledElement
@@ -80,7 +83,7 @@ void SVGStyledElement::parseMappedAttribute(MappedAttribute *attr)
     int propId = getPropertyID(qProp.ascii(), qProp.length());
     if (propId == 0)
         propId = SVG::getSVGCSSPropertyID(qProp.ascii(), qProp.length());
-    if(propId > 0) {
+    if (propId > 0) {
         addCSSProperty(attr, propId, value);
         setChanged();
         return;
@@ -92,15 +95,14 @@ void SVGStyledElement::parseMappedAttribute(MappedAttribute *attr)
 void SVGStyledElement::notifyAttributeChange() const
 {
     // For most cases we need to handle vectorial data changes (ie. rect x changed)
-    if(!ownerDocument()->parsing())
-    {
+    if (!ownerDocument()->parsing()) {
         // TODO: Use a more optimized way of updating, means not calling updateCanvasItem() here!
-        const_cast<SVGStyledElement *>(this)->m_updateVectorial = true;
-        const_cast<SVGStyledElement *>(this)->updateCanvasItem();
+        const_cast<SVGStyledElement*>(this)->m_updateVectorial = true;
+        const_cast<SVGStyledElement*>(this)->updateCanvasItem();
     }
 }
 
-void SVGStyledElement::attributeChanged(Attribute *attr, bool preserveDecls)
+void SVGStyledElement::attributeChanged(Attributeattr, bool preserveDecls)
 {
     // FIXME: Eventually subclasses from SVGElement should implement
     // attributeChanged() instead of notifyAttributeChange()
@@ -110,36 +112,36 @@ void SVGStyledElement::attributeChanged(Attribute *attr, bool preserveDecls)
     notifyAttributeChange();
 }
 
-RenderCanvas *SVGStyledElement::canvas() const
+RenderCanvasSVGStyledElement::canvas() const
 {
-    return static_cast<RenderCanvas *>(document()->renderer());
+    return static_cast<RenderCanvas*>(document()->renderer());
 }
 
 void SVGStyledElement::updateCanvasItem()
 {
-    if(!m_updateVectorial || !renderer() || !renderer()->isRenderPath())
+    if (!m_updateVectorial || !renderer() || !renderer()->isRenderPath())
         return;
     
-    RenderPath *renderPath = static_cast<RenderPath *>(renderer());
+    RenderPath* renderPath = static_cast<RenderPath*>(renderer());
     bool renderSection = false;
     
-    SVGElement *parentElement = svg_dynamic_cast(parentNode());
-    if(parentElement && parentElement->renderer() && parentElement->isStyled()
+    SVGElementparentElement = svg_dynamic_cast(parentNode());
+    if (parentElement && parentElement->renderer() && parentElement->isStyled()
         && parentElement->childShouldCreateRenderer(this))
         renderSection = true;
 
     renderPath->setPath(toPathData());
 
-    if(renderSection)
+    if (renderSection)
         renderPath->setNeedsLayout(true);
 
     m_updateVectorial = false;
 }
 
-const SVGStyledElement *SVGStyledElement::pushAttributeContext(const SVGStyledElement *)
+const SVGStyledElement* SVGStyledElement::pushAttributeContext(const SVGStyledElement*)
 {
-    if(canvas())
-        static_cast<RenderPath *>(renderer())->setPath(toPathData());
+    if (canvas())
+        static_cast<RenderPath*>(renderer())->setPath(toPathData());
 
     return 0;
 }