2006-05-15 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
Split css_stylesheetimpl.* into separate files (one per class).
http://bugzilla.opendarwin.org/show_bug.cgi?id=8933
* WebCore.vcproj/WebCore/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSStyleSheet.cpp: Added.
(WebCore::CSSStyleSheet::CSSStyleSheet):
(WebCore::CSSStyleSheet::addRule):
(WebCore::CSSStyleSheet::deleteRule):
(WebCore::CSSStyleSheet::parseString):
(WebCore::CSSStyleSheet::docLoader):
* css/CSSStyleSheet.h: Added.
* css/MediaList.cpp: Added.
(WebCore::MediaList::MediaList):
(WebCore::MediaList::contains):
(WebCore::MediaList::parentStyleSheet):
(WebCore::MediaList::parentRule):
(WebCore::MediaList::deleteMedium):
(WebCore::MediaList::setMediaText):
* css/MediaList.h: Added.
* css/StyleSheet.cpp: Added.
(WebCore::StyleSheet::StyleSheet):
(WebCore::StyleSheet::parentStyleSheet):
(WebCore::StyleSheet::setMedia):
* css/StyleSheet.h: Added.
(WebCore::StyleSheet::ownerNode):
* css/StyleSheetList.cpp: Added.
(WebCore::StyleSheetList::~StyleSheetList):
(WebCore::StyleSheetList::add):
(WebCore::StyleSheetList::remove):
(WebCore::StyleSheetList::item):
* css/StyleSheetList.h: Added.
* css/css_stylesheetimpl.cpp: Removed.
* css/css_stylesheetimpl.h: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9d526f8..0596e82 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -6,6 +6,45 @@
2006-05-15 Eric Seidel <eseidel@apple.com>
+ Reviewed by mjs.
+
+ Split css_stylesheetimpl.* into separate files (one per class).
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=8933
+
+ * WebCore.vcproj/WebCore/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSStyleSheet.cpp: Added.
+ (WebCore::CSSStyleSheet::CSSStyleSheet):
+ (WebCore::CSSStyleSheet::addRule):
+ (WebCore::CSSStyleSheet::deleteRule):
+ (WebCore::CSSStyleSheet::parseString):
+ (WebCore::CSSStyleSheet::docLoader):
+ * css/CSSStyleSheet.h: Added.
+ * css/MediaList.cpp: Added.
+ (WebCore::MediaList::MediaList):
+ (WebCore::MediaList::contains):
+ (WebCore::MediaList::parentStyleSheet):
+ (WebCore::MediaList::parentRule):
+ (WebCore::MediaList::deleteMedium):
+ (WebCore::MediaList::setMediaText):
+ * css/MediaList.h: Added.
+ * css/StyleSheet.cpp: Added.
+ (WebCore::StyleSheet::StyleSheet):
+ (WebCore::StyleSheet::parentStyleSheet):
+ (WebCore::StyleSheet::setMedia):
+ * css/StyleSheet.h: Added.
+ (WebCore::StyleSheet::ownerNode):
+ * css/StyleSheetList.cpp: Added.
+ (WebCore::StyleSheetList::~StyleSheetList):
+ (WebCore::StyleSheetList::add):
+ (WebCore::StyleSheetList::remove):
+ (WebCore::StyleSheetList::item):
+ * css/StyleSheetList.h: Added.
+ * css/css_stylesheetimpl.cpp: Removed.
+ * css/css_stylesheetimpl.h: Removed.
+
+2006-05-15 Eric Seidel <eseidel@apple.com>
+
* WebCore.xcodeproj/project.pbxproj: build fix.
2006-05-15 Eric Seidel <eseidel@apple.com>
diff --git a/WebCore/WebCore.vcproj/WebCore/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
index 03dda96..f329526 100644
--- a/WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
@@ -1831,11 +1831,35 @@
>
</File>
<File
- RelativePath="..\..\css\css_stylesheetimpl.cpp"
+ RelativePath="..\..\css\CSSStyleSheet.cpp"
>
</File>
<File
- RelativePath="..\..\css\css_stylesheetimpl.h"
+ RelativePath="..\..\css\CSSStyleSheet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\css\MediaList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\css\MediaList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\css\StyleSheetList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\css\StyleSheetList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\css\StyleSheet.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\css\StyleSheet.h"
>
</File>
<File
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 0fada59..3296442 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1164,6 +1164,14 @@
A8EA7F710A194AFD00A8EF5F /* Notation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7F690A194AFD00A8EF5F /* Notation.h */; };
A8EA7F730A194AFD00A8EF5F /* EntityReference.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7F6B0A194AFD00A8EF5F /* EntityReference.h */; };
A8EA7F750A194AFD00A8EF5F /* Entity.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7F6D0A194AFD00A8EF5F /* Entity.h */; };
+ A8EA80070A19516E00A8EF5F /* CSSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7FFF0A19516E00A8EF5F /* CSSStyleSheet.h */; };
+ A8EA80080A19516E00A8EF5F /* CSSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80000A19516E00A8EF5F /* CSSStyleSheet.cpp */; };
+ A8EA80090A19516E00A8EF5F /* MediaList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80010A19516E00A8EF5F /* MediaList.cpp */; };
+ A8EA800A0A19516E00A8EF5F /* StyleSheetList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80020A19516E00A8EF5F /* StyleSheetList.h */; };
+ A8EA800B0A19516E00A8EF5F /* StyleSheetList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80030A19516E00A8EF5F /* StyleSheetList.cpp */; };
+ A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80040A19516E00A8EF5F /* StyleSheet.h */; };
+ A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */; };
+ A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; };
A8FD8B86087CB44C00DC3707 /* KWQWMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A85D7A8C0879EC64006A9172 /* KWQWMatrix.cpp */; };
A8FD8B87087CB45700DC3707 /* KWQWMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */; };
A8FEFB0A0979F472005839FD /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB080979F472005839FD /* RenderForeignObject.h */; };
@@ -1260,8 +1268,6 @@
BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; };
BCEA4792097CAAC80094C9E4 /* css_ruleimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA477F097CAAC80094C9E4 /* css_ruleimpl.cpp */; };
BCEA4793097CAAC80094C9E4 /* css_ruleimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4780097CAAC80094C9E4 /* css_ruleimpl.h */; };
- BCEA4794097CAAC80094C9E4 /* css_stylesheetimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4781097CAAC80094C9E4 /* css_stylesheetimpl.cpp */; };
- BCEA4795097CAAC80094C9E4 /* css_stylesheetimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4782097CAAC80094C9E4 /* css_stylesheetimpl.h */; };
BCEA4796097CAAC80094C9E4 /* css_valueimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4783097CAAC80094C9E4 /* css_valueimpl.cpp */; };
BCEA4797097CAAC80094C9E4 /* css_valueimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4784097CAAC80094C9E4 /* css_valueimpl.h */; };
BCEA4798097CAAC80094C9E4 /* csshelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4785097CAAC80094C9E4 /* csshelper.cpp */; };
@@ -2652,6 +2658,14 @@
A8EA7F6B0A194AFD00A8EF5F /* EntityReference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EntityReference.h; sourceTree = "<group>"; };
A8EA7F6C0A194AFD00A8EF5F /* EntityReference.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = EntityReference.cpp; sourceTree = "<group>"; };
A8EA7F6D0A194AFD00A8EF5F /* Entity.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Entity.h; sourceTree = "<group>"; };
+ A8EA7FFF0A19516E00A8EF5F /* CSSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSStyleSheet.h; sourceTree = "<group>"; };
+ A8EA80000A19516E00A8EF5F /* CSSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSStyleSheet.cpp; sourceTree = "<group>"; };
+ A8EA80010A19516E00A8EF5F /* MediaList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaList.cpp; sourceTree = "<group>"; };
+ A8EA80020A19516E00A8EF5F /* StyleSheetList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleSheetList.h; sourceTree = "<group>"; };
+ A8EA80030A19516E00A8EF5F /* StyleSheetList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetList.cpp; sourceTree = "<group>"; };
+ A8EA80040A19516E00A8EF5F /* StyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleSheet.h; sourceTree = "<group>"; };
+ A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
+ A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
A8FEFB080979F472005839FD /* RenderForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderForeignObject.h; sourceTree = "<group>"; };
A8FEFB090979F472005839FD /* RenderForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderForeignObject.cpp; sourceTree = "<group>"; };
A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGForeignObjectElement.cpp; sourceTree = "<group>"; };
@@ -2757,8 +2771,6 @@
BCEA477E097CAAC80094C9E4 /* CSSGrammar.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y; sourceTree = "<group>"; };
BCEA477F097CAAC80094C9E4 /* css_ruleimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = css_ruleimpl.cpp; sourceTree = "<group>"; };
BCEA4780097CAAC80094C9E4 /* css_ruleimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = css_ruleimpl.h; sourceTree = "<group>"; };
- BCEA4781097CAAC80094C9E4 /* css_stylesheetimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = css_stylesheetimpl.cpp; sourceTree = "<group>"; };
- BCEA4782097CAAC80094C9E4 /* css_stylesheetimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = css_stylesheetimpl.h; sourceTree = "<group>"; };
BCEA4783097CAAC80094C9E4 /* css_valueimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = css_valueimpl.cpp; sourceTree = "<group>"; };
BCEA4784097CAAC80094C9E4 /* css_valueimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = css_valueimpl.h; sourceTree = "<group>"; };
BCEA4785097CAAC80094C9E4 /* csshelper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = csshelper.cpp; sourceTree = "<group>"; };
@@ -4504,14 +4516,11 @@
F523D18402DE42E8018635CA /* css */ = {
isa = PBXGroup;
children = (
- 142011AE0A003117008303F9 /* CSSStyleDeclaration.idl */,
930705C709E0C95F00B17FE4 /* Counter.idl */,
BCEA477A097CAAC80094C9E4 /* css_base.cpp */,
BCEA477B097CAAC80094C9E4 /* css_base.h */,
BCEA477F097CAAC80094C9E4 /* css_ruleimpl.cpp */,
BCEA4780097CAAC80094C9E4 /* css_ruleimpl.h */,
- BCEA4781097CAAC80094C9E4 /* css_stylesheetimpl.cpp */,
- BCEA4782097CAAC80094C9E4 /* css_stylesheetimpl.h */,
BCEA4783097CAAC80094C9E4 /* css_valueimpl.cpp */,
BCEA4784097CAAC80094C9E4 /* css_valueimpl.h */,
BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */,
@@ -4524,8 +4533,11 @@
9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */,
BCEA4789097CAAC80094C9E4 /* CSSPropertyNames.in */,
14CF7A7009F5CF9A00EB3665 /* CSSRule.idl */,
+ 142011AE0A003117008303F9 /* CSSStyleDeclaration.idl */,
BCEA478A097CAAC80094C9E4 /* cssstyleselector.cpp */,
BCEA478B097CAAC80094C9E4 /* cssstyleselector.h */,
+ A8EA80000A19516E00A8EF5F /* CSSStyleSheet.cpp */,
+ A8EA7FFF0A19516E00A8EF5F /* CSSStyleSheet.h */,
14CF787109F587CA00EB3665 /* CSSValue.idl */,
BCEA478C097CAAC80094C9E4 /* CSSValueKeywords.in */,
93CA4C9909DF93FA00DF8677 /* html4.css */,
@@ -4533,7 +4545,13 @@
93CA4C9B09DF93FA00DF8677 /* makeprop */,
93CA4C9C09DF93FA00DF8677 /* maketokenizer */,
93CA4C9D09DF93FA00DF8677 /* makevalues */,
+ A8EA80010A19516E00A8EF5F /* MediaList.cpp */,
+ A8EA80060A19516E00A8EF5F /* MediaList.h */,
93CA4C9F09DF93FA00DF8677 /* quirks.css */,
+ A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */,
+ A8EA80040A19516E00A8EF5F /* StyleSheet.h */,
+ A8EA80030A19516E00A8EF5F /* StyleSheetList.cpp */,
+ A8EA80020A19516E00A8EF5F /* StyleSheetList.h */,
93CA4CA209DF93FA00DF8677 /* svg.css */,
93CA4CA309DF93FA00DF8677 /* tokenizer.flex */,
);
@@ -5159,7 +5177,6 @@
BCEA478E097CAAC80094C9E4 /* css_base.h in Headers */,
BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
BCEA4793097CAAC80094C9E4 /* css_ruleimpl.h in Headers */,
- BCEA4795097CAAC80094C9E4 /* css_stylesheetimpl.h in Headers */,
BCEA4797097CAAC80094C9E4 /* css_valueimpl.h in Headers */,
BCEA479B097CAAC80094C9E4 /* cssparser.h in Headers */,
BCEA479E097CAAC80094C9E4 /* cssstyleselector.h in Headers */,
@@ -5508,6 +5525,10 @@
A8EA7F710A194AFD00A8EF5F /* Notation.h in Headers */,
A8EA7F730A194AFD00A8EF5F /* EntityReference.h in Headers */,
A8EA7F750A194AFD00A8EF5F /* Entity.h in Headers */,
+ A8EA80070A19516E00A8EF5F /* CSSStyleSheet.h in Headers */,
+ A8EA800A0A19516E00A8EF5F /* StyleSheetList.h in Headers */,
+ A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */,
+ A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5993,7 +6014,6 @@
BCEA478D097CAAC80094C9E4 /* css_base.cpp in Sources */,
BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */,
BCEA4792097CAAC80094C9E4 /* css_ruleimpl.cpp in Sources */,
- BCEA4794097CAAC80094C9E4 /* css_stylesheetimpl.cpp in Sources */,
BCEA4796097CAAC80094C9E4 /* css_valueimpl.cpp in Sources */,
BCEA4798097CAAC80094C9E4 /* csshelper.cpp in Sources */,
BCEA479A097CAAC80094C9E4 /* cssparser.cpp in Sources */,
@@ -6315,6 +6335,10 @@
A8EA7EBF0A1945D000A8EF5F /* Notation.cpp in Sources */,
A8EA7EC10A1945D000A8EF5F /* EntityReference.cpp in Sources */,
A8EA7EC30A1945D000A8EF5F /* Entity.cpp in Sources */,
+ A8EA80080A19516E00A8EF5F /* CSSStyleSheet.cpp in Sources */,
+ A8EA80090A19516E00A8EF5F /* MediaList.cpp in Sources */,
+ A8EA800B0A19516E00A8EF5F /* StyleSheetList.cpp in Sources */,
+ A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/bindings/js/kjs_css.cpp b/WebCore/bindings/js/kjs_css.cpp
index 1efa397..06890b1 100644
--- a/WebCore/bindings/js/kjs_css.cpp
+++ b/WebCore/bindings/js/kjs_css.cpp
@@ -25,14 +25,15 @@
#include "Document.h"
#include "HTMLNames.h"
+#include "HTMLStyleElement.h"
#include "JSCSSPrimitiveValue.h"
#include "JSCSSRule.h"
#include "JSCSSStyleDeclaration.h"
+#include "MediaList.h"
+#include "StyleSheetList.h"
#include "css_base.h"
#include "css_ruleimpl.h"
-#include "css_stylesheetimpl.h"
#include "css_valueimpl.h"
-#include "HTMLStyleElement.h"
#include "kjs_dom.h"
#include "kjs_css.lut.h"
@@ -102,7 +103,7 @@
const ClassInfo DOMCSSStyleDeclaration::info = { "CSSStyleDeclaration", 0, &DOMCSSStyleDeclarationTable, 0 };
-DOMCSSStyleDeclaration::DOMCSSStyleDeclaration(ExecState *exec, CSSStyleDeclaration *s)
+DOMCSSStyleDeclaration::DOMCSSStyleDeclaration(ExecState* exec, CSSStyleDeclaration *s)
: m_impl(s)
{
setPrototype(DOMCSSStyleDeclarationProto::self(exec));
@@ -113,15 +114,15 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-JSValue *DOMCSSStyleDeclaration::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMCSSStyleDeclaration::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration *>(slot.slotBase());
+ DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration*>(slot.slotBase());
return jsStringOrNull(thisObj->m_impl->item(slot.index()));
}
-JSValue *DOMCSSStyleDeclaration::cssPropertyGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMCSSStyleDeclaration::cssPropertyGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration *>(slot.slotBase());
+ DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration*>(slot.slotBase());
// Set up pixelOrPos boolean to handle the fact that
// pixelTop returns "CSS Top" as number value in unit pixels
@@ -141,7 +142,7 @@
return jsString(thisObj->m_impl->getPropertyValue(prop));
}
-bool DOMCSSStyleDeclaration::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMCSSStyleDeclaration::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
const HashEntry* entry = Lookup::findEntry(&DOMCSSStyleDeclarationTable, propertyName);
@@ -165,7 +166,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-JSValue *DOMCSSStyleDeclaration::getValueProperty(ExecState *exec, int token)
+JSValue* DOMCSSStyleDeclaration::getValueProperty(ExecState* exec, int token)
{
switch (token) {
case CssText:
@@ -180,7 +181,7 @@
}
}
-void DOMCSSStyleDeclaration::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr )
+void DOMCSSStyleDeclaration::put(ExecState* exec, const Identifier &propertyName, JSValue* value, int attr )
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMCSSStyleDeclaration::put " << propertyName << endl;
@@ -217,12 +218,12 @@
}
}
-JSValue *DOMCSSStyleDeclarationProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* DOMCSSStyleDeclarationProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSStyleDeclaration::info))
return throwError(exec, TypeError);
DOMExceptionTranslator exception(exec);
- CSSStyleDeclaration &styleDecl = *static_cast<DOMCSSStyleDeclaration *>(thisObj)->impl();
+ CSSStyleDeclaration &styleDecl = *static_cast<DOMCSSStyleDeclaration*>(thisObj)->impl();
UString str = args[0]->toString(exec);
WebCore::String s = str;
@@ -249,7 +250,7 @@
}
}
-JSValue *toJS(ExecState *exec, CSSStyleDeclaration *s)
+JSValue* toJS(ExecState* exec, CSSStyleDeclaration *s)
{
return cacheDOMObject<CSSStyleDeclaration, WebCore::JSCSSStyleDeclaration>(exec, s);
}
@@ -284,14 +285,14 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-bool DOMStyleSheet::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMStyleSheet::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<DOMStyleSheet, DOMObject>(exec, &DOMStyleSheetTable, this, propertyName, slot);
}
-JSValue *DOMStyleSheet::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMStyleSheet::getValueProperty(ExecState* exec, int token) const
{
- StyleSheet &styleSheet = *m_impl;
+ StyleSheet& styleSheet = *m_impl;
switch (token) {
case Type:
return jsStringOrNull(styleSheet.type());
@@ -311,7 +312,7 @@
return NULL;
}
-void DOMStyleSheet::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void DOMStyleSheet::put(ExecState* exec, const Identifier &propertyName, JSValue* value, int attr)
{
if (propertyName == "disabled") {
m_impl->setDisabled(value->toBoolean(exec));
@@ -320,17 +321,17 @@
DOMObject::put(exec, propertyName, value, attr);
}
-JSValue* toJS(ExecState *exec, PassRefPtr<StyleSheet> ss)
+JSValue* toJS(ExecState* exec, PassRefPtr<StyleSheet> ss)
{
DOMObject *ret;
if (!ss)
return jsNull();
- ScriptInterpreter *interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
+ ScriptInterpreter *interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
if ((ret = interp->getDOMObject(ss.get())))
return ret;
else {
if (ss->isCSSStyleSheet())
- ret = new DOMCSSStyleSheet(exec, static_cast<CSSStyleSheet *>(ss.get()));
+ ret = new DOMCSSStyleSheet(exec, static_cast<CSSStyleSheet*>(ss.get()));
else
ret = new DOMStyleSheet(exec, ss.get());
interp->putDOMObject(ss.get(), ret);
@@ -361,7 +362,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-JSValue *DOMStyleSheetList::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMStyleSheetList::getValueProperty(ExecState* exec, int token) const
{
switch(token) {
case Length:
@@ -372,20 +373,20 @@
}
}
-JSValue *DOMStyleSheetList::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMStyleSheetList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList *>(slot.slotBase());
+ DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList*>(slot.slotBase());
return toJS(exec, thisObj->m_impl->item(slot.index()));
}
-JSValue *DOMStyleSheetList::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMStyleSheetList::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList *>(slot.slotBase());
+ DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList*>(slot.slotBase());
Element *element = thisObj->m_doc->getElementById(propertyName);
- return toJS(exec, static_cast<HTMLStyleElement *>(element)->sheet());
+ return toJS(exec, static_cast<HTMLStyleElement*>(element)->sheet());
}
-bool DOMStyleSheetList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMStyleSheetList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
const HashEntry* entry = Lookup::findEntry(&DOMStyleSheetListTable, propertyName);
@@ -424,13 +425,13 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-JSValue *toJS(ExecState *exec, StyleSheetList *ssl, Document *doc)
+JSValue* toJS(ExecState* exec, StyleSheetList *ssl, Document *doc)
{
// Can't use the cacheDOMObject macro because of the doc argument
DOMObject *ret;
if (!ssl)
return jsNull();
- ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
+ ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
if ((ret = interp->getDOMObject(ssl)))
return ret;
else {
@@ -440,11 +441,11 @@
}
}
-JSValue *DOMStyleSheetListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* DOMStyleSheetListFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMStyleSheetList::info))
return throwError(exec, TypeError);
- StyleSheetList &styleSheetList = *static_cast<DOMStyleSheetList *>(thisObj)->impl();
+ StyleSheetList &styleSheetList = *static_cast<DOMStyleSheetList*>(thisObj)->impl();
if (id == DOMStyleSheetList::Item)
return toJS(exec, styleSheetList.item(args[0]->toInt32(exec)));
return jsUndefined();
@@ -469,7 +470,7 @@
KJS_IMPLEMENT_PROTOFUNC(DOMMediaListProtoFunc)
KJS_IMPLEMENT_PROTOTYPE("DOMMediaList", DOMMediaListProto, DOMMediaListProtoFunc)
-DOMMediaList::DOMMediaList(ExecState *exec, MediaList *ml)
+DOMMediaList::DOMMediaList(ExecState* exec, MediaList *ml)
: m_impl(ml)
{
setPrototype(DOMMediaListProto::self(exec));
@@ -480,7 +481,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-JSValue *DOMMediaList::getValueProperty(ExecState *exec, int token)
+JSValue* DOMMediaList::getValueProperty(ExecState* exec, int token)
{
switch (token) {
case MediaText:
@@ -493,13 +494,13 @@
}
}
-JSValue *DOMMediaList::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMMediaList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMMediaList *thisObj = static_cast<DOMMediaList *>(slot.slotBase());
+ DOMMediaList *thisObj = static_cast<DOMMediaList*>(slot.slotBase());
return jsStringOrNull(thisObj->m_impl->item(slot.index()));
}
-bool DOMMediaList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMMediaList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
const HashEntry* entry = Lookup::findEntry(&DOMMediaListTable, propertyName);
if (entry) {
@@ -517,7 +518,7 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void DOMMediaList::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void DOMMediaList::put(ExecState* exec, const Identifier &propertyName, JSValue* value, int attr)
{
MediaList &mediaList = *m_impl;
if (propertyName == "mediaText")
@@ -526,16 +527,16 @@
DOMObject::put(exec, propertyName, value, attr);
}
-JSValue *toJS(ExecState *exec, MediaList *ml)
+JSValue* toJS(ExecState* exec, MediaList *ml)
{
return cacheDOMObject<MediaList, DOMMediaList>(exec, ml);
}
-JSValue *KJS::DOMMediaListProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* KJS::DOMMediaListProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMMediaList::info))
return throwError(exec, TypeError);
- MediaList &mediaList = *static_cast<DOMMediaList *>(thisObj)->impl();
+ MediaList &mediaList = *static_cast<DOMMediaList*>(thisObj)->impl();
switch (id) {
case DOMMediaList::Item:
return jsStringOrNull(mediaList.item(args[0]->toInt32(exec)));
@@ -573,7 +574,7 @@
KJS_IMPLEMENT_PROTOFUNC(DOMCSSStyleSheetProtoFunc)
KJS_IMPLEMENT_PROTOTYPE("DOMCSSStyleSheet",DOMCSSStyleSheetProto,DOMCSSStyleSheetProtoFunc) // warning, use _WITH_PARENT if DOMStyleSheet gets a proto
-DOMCSSStyleSheet::DOMCSSStyleSheet(ExecState *exec, CSSStyleSheet *ss)
+DOMCSSStyleSheet::DOMCSSStyleSheet(ExecState* exec, CSSStyleSheet *ss)
: DOMStyleSheet(ss)
{
setPrototype(DOMCSSStyleSheetProto::self(exec));
@@ -583,31 +584,31 @@
{
}
-JSValue *DOMCSSStyleSheet::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMCSSStyleSheet::getValueProperty(ExecState* exec, int token) const
{
switch (token) {
case OwnerRule:
- return toJS(exec, static_cast<CSSStyleSheet *>(impl())->ownerRule());
+ return toJS(exec, static_cast<CSSStyleSheet*>(impl())->ownerRule());
case CssRules:
case Rules:
- return toJS(exec, static_cast<CSSStyleSheet *>(impl())->cssRules());
+ return toJS(exec, static_cast<CSSStyleSheet*>(impl())->cssRules());
default:
assert(0);
return jsUndefined();
}
}
-bool DOMCSSStyleSheet::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMCSSStyleSheet::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<DOMCSSStyleSheet, DOMStyleSheet>(exec, &DOMCSSStyleSheetTable, this, propertyName, slot);
}
-JSValue *DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSStyleSheet::info))
return throwError(exec, TypeError);
DOMExceptionTranslator exception(exec);
- CSSStyleSheet &styleSheet = *static_cast<CSSStyleSheet *>(static_cast<DOMCSSStyleSheet *>(thisObj)->impl());
+ CSSStyleSheet &styleSheet = *static_cast<CSSStyleSheet*>(static_cast<DOMCSSStyleSheet*>(thisObj)->impl());
switch (id) {
case DOMCSSStyleSheet::InsertRule:
return jsNumber(styleSheet.insertRule(args[0]->toString(exec), args[1]->toInt32(exec), exception));
@@ -650,7 +651,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-JSValue *DOMCSSRuleList::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMCSSRuleList::getValueProperty(ExecState* exec, int token) const
{
switch (token) {
case Length:
@@ -661,13 +662,13 @@
}
}
-JSValue *DOMCSSRuleList::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMCSSRuleList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMCSSRuleList *thisObj = static_cast<DOMCSSRuleList *>(slot.slotBase());
+ DOMCSSRuleList *thisObj = static_cast<DOMCSSRuleList*>(slot.slotBase());
return toJS(exec, thisObj->m_impl->item(slot.index()));
}
-bool DOMCSSRuleList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMCSSRuleList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
const HashEntry* entry = Lookup::findEntry(&DOMCSSRuleListTable, propertyName);
@@ -691,11 +692,11 @@
return DOMObject::getOwnPropertySlot(exec, propertyName, slot);
}
-JSValue *DOMCSSRuleListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* DOMCSSRuleListFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSRuleList::info))
return throwError(exec, TypeError);
- CSSRuleList &cssRuleList = *static_cast<DOMCSSRuleList *>(thisObj)->impl();
+ CSSRuleList &cssRuleList = *static_cast<DOMCSSRuleList*>(thisObj)->impl();
switch (id) {
case DOMCSSRuleList::Item:
return toJS(exec,cssRuleList.item(args[0]->toInt32(exec)));
@@ -704,7 +705,7 @@
}
}
-JSValue *toJS(ExecState *exec, CSSRuleList *rl)
+JSValue* toJS(ExecState* exec, CSSRuleList *rl)
{
return cacheDOMObject<CSSRuleList, DOMCSSRuleList>(exec, rl);
}
@@ -785,7 +786,7 @@
encoding DOMCSSRule::Charset_Encoding DontDelete
@end
*/
-bool DOMCSSRule::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMCSSRule::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
// first try the properties specific to this rule type
const HashEntry* entry = Lookup::findEntry(DOMCSSRule::classInfo()->propHashTable, propertyName);
@@ -798,7 +799,7 @@
return getStaticPropertySlot<DOMCSSRuleFunc, DOMCSSRule, DOMObject>(exec, &DOMCSSRuleTable, this, propertyName, slot);
}
-JSValue *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMCSSRule::getValueProperty(ExecState* exec, int token) const
{
CSSRule &cssRule = *m_impl;
switch (token) {
@@ -813,37 +814,37 @@
// for STYLE_RULE:
case Style_SelectorText:
- return jsStringOrNull(static_cast<CSSStyleRule *>(m_impl.get())->selectorText());
+ return jsStringOrNull(static_cast<CSSStyleRule*>(m_impl.get())->selectorText());
case Style_Style:
- return toJS(exec, static_cast<CSSStyleRule *>(m_impl.get())->style());
+ return toJS(exec, static_cast<CSSStyleRule*>(m_impl.get())->style());
// for MEDIA_RULE:
case Media_Media:
- return toJS(exec, static_cast<CSSMediaRule *>(m_impl.get())->media());
+ return toJS(exec, static_cast<CSSMediaRule*>(m_impl.get())->media());
case Media_CssRules:
- return toJS(exec, static_cast<CSSMediaRule *>(m_impl.get())->cssRules());
+ return toJS(exec, static_cast<CSSMediaRule*>(m_impl.get())->cssRules());
// for FONT_FACE_RULE:
case FontFace_Style:
- return toJS(exec, static_cast<CSSFontFaceRule *>(m_impl.get())->style());
+ return toJS(exec, static_cast<CSSFontFaceRule*>(m_impl.get())->style());
// for PAGE_RULE:
case Page_SelectorText:
- return jsStringOrNull(static_cast<CSSPageRule *>(m_impl.get())->selectorText());
+ return jsStringOrNull(static_cast<CSSPageRule*>(m_impl.get())->selectorText());
case Page_Style:
- return toJS(exec, static_cast<CSSPageRule *>(m_impl.get())->style());
+ return toJS(exec, static_cast<CSSPageRule*>(m_impl.get())->style());
// for IMPORT_RULE:
case Import_Href:
- return jsStringOrNull(static_cast<CSSImportRule *>(m_impl.get())->href());
+ return jsStringOrNull(static_cast<CSSImportRule*>(m_impl.get())->href());
case Import_Media:
- return toJS(exec, static_cast<CSSImportRule *>(m_impl.get())->media());
+ return toJS(exec, static_cast<CSSImportRule*>(m_impl.get())->media());
case Import_StyleSheet:
- return toJS(exec, static_cast<CSSImportRule *>(m_impl.get())->styleSheet());
+ return toJS(exec, static_cast<CSSImportRule*>(m_impl.get())->styleSheet());
// for CHARSET_RULE:
case Charset_Encoding:
- return jsStringOrNull(static_cast<CSSCharsetRule *>(m_impl.get())->encoding());
+ return jsStringOrNull(static_cast<CSSCharsetRule*>(m_impl.get())->encoding());
default:
assert(0);
@@ -851,7 +852,7 @@
return jsUndefined();
}
-void DOMCSSRule::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void DOMCSSRule::put(ExecState* exec, const Identifier &propertyName, JSValue* value, int attr)
{
const HashTable* table = DOMCSSRule::classInfo()->propHashTable; // get the right hashtable
const HashEntry* entry = Lookup::findEntry(table, propertyName);
@@ -870,31 +871,31 @@
lookupPut<DOMCSSRule, DOMObject>(exec, propertyName, value, attr, &DOMCSSRuleTable, this);
}
-void DOMCSSRule::putValueProperty(ExecState *exec, int token, JSValue *value, int)
+void DOMCSSRule::putValueProperty(ExecState* exec, int token, JSValue* value, int)
{
switch (token) {
// for STYLE_RULE:
case Style_SelectorText:
- static_cast<CSSStyleRule *>(m_impl.get())->setSelectorText(value->toString(exec));
+ static_cast<CSSStyleRule*>(m_impl.get())->setSelectorText(value->toString(exec));
return;
// for PAGE_RULE:
case Page_SelectorText:
- static_cast<CSSPageRule *>(m_impl.get())->setSelectorText(value->toString(exec));
+ static_cast<CSSPageRule*>(m_impl.get())->setSelectorText(value->toString(exec));
return;
// for CHARSET_RULE:
case Charset_Encoding:
- static_cast<CSSCharsetRule *>(m_impl.get())->setEncoding(value->toString(exec));
+ static_cast<CSSCharsetRule*>(m_impl.get())->setEncoding(value->toString(exec));
return;
}
}
-JSValue *DOMCSSRuleFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* DOMCSSRuleFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSRule::info))
return throwError(exec, TypeError);
- CSSRule &cssRule = *static_cast<DOMCSSRule *>(thisObj)->impl();
+ CSSRule &cssRule = *static_cast<DOMCSSRule*>(thisObj)->impl();
if (cssRule.type() == CSSRule::MEDIA_RULE) {
CSSMediaRule &rule = static_cast<CSSMediaRule &>(cssRule);
@@ -907,7 +908,7 @@
return jsUndefined();
}
-JSValue *toJS(ExecState *exec, CSSRule *r)
+JSValue* toJS(ExecState* exec, CSSRule *r)
{
return cacheDOMObject<CSSRule, JSCSSRule>(exec, r);
}
@@ -932,7 +933,7 @@
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
-JSValue *DOMCSSValue::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMCSSValue::getValueProperty(ExecState* exec, int token) const
{
CSSValue &cssValue = *m_impl;
switch (token) {
@@ -946,12 +947,12 @@
}
}
-bool DOMCSSValue::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMCSSValue::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<DOMCSSValue, DOMObject>(exec, &DOMCSSValueTable, this, propertyName, slot);
}
-void DOMCSSValue::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void DOMCSSValue::put(ExecState* exec, const Identifier &propertyName, JSValue* value, int attr)
{
CSSValue &cssValue = *m_impl;
if (propertyName == "cssText")
@@ -965,19 +966,19 @@
return 0;
}
-JSValue *toJS(ExecState *exec, CSSValue *v)
+JSValue* toJS(ExecState* exec, CSSValue *v)
{
DOMObject *ret;
if (!v)
return jsNull();
- ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
+ ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
if ((ret = interp->getDOMObject(v)))
return ret;
else {
if (v->isValueList())
- ret = new DOMCSSValueList(exec, static_cast<CSSValueList *>(v));
+ ret = new DOMCSSValueList(exec, static_cast<CSSValueList*>(v));
else if (v->isPrimitiveValue())
- ret = new JSCSSPrimitiveValue(exec, static_cast<CSSPrimitiveValue *>(v));
+ ret = new JSCSSPrimitiveValue(exec, static_cast<CSSPrimitiveValue*>(v));
else
ret = new DOMCSSValue(exec,v);
interp->putDOMObject(v, ret);
@@ -997,26 +998,26 @@
*/
KJS_IMPLEMENT_PROTOFUNC(DOMCSSValueListFunc) // not really a proto, but doesn't matter
-DOMCSSValueList::DOMCSSValueList(ExecState *exec, CSSValueList *v)
+DOMCSSValueList::DOMCSSValueList(ExecState* exec, CSSValueList *v)
: DOMCSSValue(exec, v)
{
}
-JSValue *DOMCSSValueList::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMCSSValueList::getValueProperty(ExecState* exec, int token) const
{
assert(token == Length);
- return jsNumber(static_cast<CSSValueList *>(impl())->length());
+ return jsNumber(static_cast<CSSValueList*>(impl())->length());
}
-JSValue *DOMCSSValueList::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* DOMCSSValueList::indexGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
- DOMCSSValueList *thisObj = static_cast<DOMCSSValueList *>(slot.slotBase());
- return toJS(exec, static_cast<CSSValueList *>(thisObj->impl())->item(slot.index()));
+ DOMCSSValueList *thisObj = static_cast<DOMCSSValueList*>(slot.slotBase());
+ return toJS(exec, static_cast<CSSValueList*>(thisObj->impl())->item(slot.index()));
}
-bool DOMCSSValueList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMCSSValueList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
- CSSValueList &valueList = *static_cast<CSSValueList *>(impl());
+ CSSValueList &valueList = *static_cast<CSSValueList*>(impl());
const HashEntry* entry = Lookup::findEntry(&DOMCSSValueListTable, propertyName);
if (entry) {
if (entry->attr & Function)
@@ -1035,11 +1036,11 @@
return DOMCSSValue::getOwnPropertySlot(exec, propertyName, slot);
}
-JSValue *DOMCSSValueListFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* DOMCSSValueListFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
{
if (!thisObj->inherits(&KJS::DOMCSSValue::info))
return throwError(exec, TypeError);
- CSSValueList &valueList = *static_cast<CSSValueList *>(static_cast<DOMCSSValueList *>(thisObj)->impl());
+ CSSValueList &valueList = *static_cast<CSSValueList*>(static_cast<DOMCSSValueList*>(thisObj)->impl());
switch (id) {
case DOMCSSValueList::Item:
return toJS(exec,valueList.item(args[0]->toInt32(exec)));
@@ -1064,12 +1065,12 @@
//rgbColors.remove(rgbColor.handle());
}
-bool DOMRGBColor::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMRGBColor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<DOMRGBColor, DOMObject>(exec, &DOMRGBColorTable, this, propertyName, slot);
}
-JSValue *DOMRGBColor::getValueProperty(ExecState* exec, int token) const
+JSValue* DOMRGBColor::getValueProperty(ExecState* exec, int token) const
{
int color = m_color;
switch (token) {
@@ -1086,7 +1087,7 @@
}
}
-JSValue *getDOMRGBColor(ExecState *, unsigned c)
+JSValue* getDOMRGBColor(ExecState *, unsigned c)
{
// ### implement equals for RGBColor since they're not refcounted objects
return new DOMRGBColor(c);
@@ -1108,12 +1109,12 @@
ScriptInterpreter::forgetDOMObject(m_rect.get());
}
-bool DOMRect::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool DOMRect::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<DOMRect, DOMObject>(exec, &DOMRectTable, this, propertyName, slot);
}
-JSValue *DOMRect::getValueProperty(ExecState *exec, int token) const
+JSValue* DOMRect::getValueProperty(ExecState* exec, int token) const
{
RectImpl &rect = *m_rect;
switch (token) {
@@ -1130,7 +1131,7 @@
}
}
-JSValue *toJS(ExecState *exec, RectImpl *r)
+JSValue* toJS(ExecState* exec, RectImpl *r)
{
return cacheDOMObject<RectImpl, DOMRect>(exec, r);
}
diff --git a/WebCore/bindings/js/kjs_css.h b/WebCore/bindings/js/kjs_css.h
index dd916e2..cac5896 100644
--- a/WebCore/bindings/js/kjs_css.h
+++ b/WebCore/bindings/js/kjs_css.h
@@ -49,23 +49,23 @@
class DOMCSSStyleDeclaration : public DOMObject {
public:
virtual ~DOMCSSStyleDeclaration();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- JSValue *getValueProperty(ExecState *exec, int token);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
+ JSValue* getValueProperty(ExecState*, int token);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
enum { CssText, Length, ParentRule };
enum { GetPropertyValue, GetPropertyCSSValue, RemoveProperty,
GetPropertyPriority, GetPropertyShorthand, IsPropertyImplicit, SetProperty, Item };
- WebCore::CSSStyleDeclaration *impl() const { return m_impl.get(); }
+ WebCore::CSSStyleDeclaration* impl() const { return m_impl.get(); }
private:
- static JSValue *indexGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
- static JSValue *cssPropertyGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
+ static JSValue *cssPropertyGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
// Don't use this class directly -- use JSCSSStyleDeclaration instead
friend class WebCore::JSCSSStyleDeclaration;
- DOMCSSStyleDeclaration(ExecState *exec, WebCore::CSSStyleDeclaration *s);
+ DOMCSSStyleDeclaration(ExecState*, WebCore::CSSStyleDeclaration *s);
RefPtr<WebCore::CSSStyleDeclaration> m_impl;
};
@@ -74,19 +74,19 @@
class DOMStyleSheet : public DOMObject {
public:
- DOMStyleSheet(ExecState *, WebCore::StyleSheet *ss);
+ DOMStyleSheet(ExecState*, WebCore::StyleSheet *ss);
virtual ~DOMStyleSheet();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- virtual bool toBoolean(ExecState *) const { return true; }
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
+ virtual bool toBoolean(ExecState*) const { return true; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Type, Disabled, OwnerNode, ParentStyleSheet, Href, Title, Media };
- WebCore::StyleSheet *impl() const { return m_impl.get(); }
+ WebCore::StyleSheet* impl() const { return m_impl.get(); }
protected:
// Constructor for derived classes; doesn't set up a prototype.
- DOMStyleSheet(WebCore::StyleSheet *ss);
+ DOMStyleSheet(WebCore::StyleSheet*);
private:
RefPtr<WebCore::StyleSheet> m_impl;
};
@@ -95,42 +95,42 @@
class DOMStyleSheetList : public DOMObject {
public:
- DOMStyleSheetList(ExecState *, WebCore::StyleSheetList *ssl, WebCore::Document *doc);
+ DOMStyleSheetList(ExecState*, WebCore::StyleSheetList*, WebCore::Document*);
virtual ~DOMStyleSheetList();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState* ) const { return true; }
static const ClassInfo info;
- WebCore::StyleSheetList *impl() const { return m_impl.get(); }
+ WebCore::StyleSheetList* impl() const { return m_impl.get(); }
enum { Item, Length };
private:
- static JSValue *indexGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
- static JSValue *nameGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
+ static JSValue *indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
+ static JSValue *nameGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
RefPtr<WebCore::StyleSheetList> m_impl;
RefPtr<WebCore::Document> m_doc;
};
// The document is only used for get-stylesheet-by-name (make optional if necessary)
- JSValue *toJS(ExecState *exec, WebCore::StyleSheetList *ss, WebCore::Document *doc);
+ JSValue *toJS(ExecState*, WebCore::StyleSheetList*, WebCore::Document*);
class DOMMediaList : public DOMObject {
public:
- DOMMediaList(ExecState *, WebCore::MediaList *ml);
+ DOMMediaList(ExecState*, WebCore::MediaList*);
virtual ~DOMMediaList();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token);
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token);
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
virtual bool toBoolean(ExecState* ) const { return true; }
static const ClassInfo info;
enum { MediaText, Length,
Item, DeleteMedium, AppendMedium };
- WebCore::MediaList *impl() const { return m_impl.get(); }
+ WebCore::MediaList* impl() const { return m_impl.get(); }
private:
- static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
RefPtr<WebCore::MediaList> m_impl;
};
@@ -138,10 +138,10 @@
class DOMCSSStyleSheet : public DOMStyleSheet {
public:
- DOMCSSStyleSheet(ExecState *exec, WebCore::CSSStyleSheet *ss);
+ DOMCSSStyleSheet(ExecState*, WebCore::CSSStyleSheet*);
virtual ~DOMCSSStyleSheet();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -150,17 +150,17 @@
class DOMCSSRuleList : public DOMObject {
public:
- DOMCSSRuleList(ExecState *, WebCore::CSSRuleList *rl);
+ DOMCSSRuleList(ExecState*, WebCore::CSSRuleList*);
virtual ~DOMCSSRuleList();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Item, Length };
- WebCore::CSSRuleList *impl() const { return m_impl.get(); }
+ WebCore::CSSRuleList* impl() const { return m_impl.get(); }
private:
- static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
RefPtr<WebCore::CSSRuleList> m_impl;
};
@@ -169,12 +169,12 @@
class DOMCSSRule : public DOMObject {
public:
- DOMCSSRule(ExecState*, WebCore::CSSRule* r);
+ DOMCSSRule(ExecState*, WebCore::CSSRule*);
virtual ~DOMCSSRule();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- void putValueProperty(ExecState *exec, int token, JSValue *value, int attr);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
+ void putValueProperty(ExecState*, int token, JSValue*, int attr);
virtual const ClassInfo* classInfo() const;
static const ClassInfo info;
static const ClassInfo style_info, media_info, fontface_info, page_info, import_info, charset_info;
@@ -182,7 +182,7 @@
Media_Media, Media_InsertRule, Media_DeleteRule, Media_CssRules,
FontFace_Style, Page_SelectorText, Page_Style,
Import_Href, Import_Media, Import_StyleSheet, Charset_Encoding };
- WebCore::CSSRule *impl() const { return m_impl.get(); }
+ WebCore::CSSRule* impl() const { return m_impl.get(); }
private:
RefPtr<WebCore::CSSRule> m_impl;
};
@@ -191,15 +191,15 @@
class DOMCSSValue : public DOMObject {
public:
- DOMCSSValue(ExecState *, WebCore::CSSValue *v) : m_impl(v) { }
+ DOMCSSValue(ExecState*, WebCore::CSSValue* v) : m_impl(v) { }
virtual ~DOMCSSValue();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue*, int attr = None);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { CssText, CssValueType };
- WebCore::CSSValue *impl() const { return m_impl.get(); }
+ WebCore::CSSValue* impl() const { return m_impl.get(); }
protected:
// Constructor for derived classes; doesn't set up a prototype.
DOMCSSValue(WebCore::CSSValue *v) : m_impl(v) { }
@@ -213,23 +213,23 @@
class DOMCSSValueList : public DOMCSSValue {
public:
- DOMCSSValueList(ExecState *exec, WebCore::CSSValueList *l);
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
+ DOMCSSValueList(ExecState*, WebCore::CSSValueList *l);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { Length, Item };
private:
- static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
+ static JSValue *indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
};
class DOMRGBColor : public DOMObject {
public:
DOMRGBColor(unsigned color) : m_color(color) { }
~DOMRGBColor();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
@@ -238,14 +238,14 @@
unsigned m_color;
};
- JSValue *getDOMRGBColor(ExecState *exec, unsigned color);
+ JSValue* getDOMRGBColor(ExecState*, unsigned color);
class DOMRect : public DOMObject {
public:
- DOMRect(ExecState *, WebCore::RectImpl *r) : m_rect(r) { }
+ DOMRect(ExecState*, WebCore::RectImpl* r) : m_rect(r) { }
~DOMRect();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ JSValue* getValueProperty(ExecState*, int token) const;
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
diff --git a/WebCore/bindings/js/kjs_dom.cpp b/WebCore/bindings/js/kjs_dom.cpp
index aa4c277..4730618 100644
--- a/WebCore/bindings/js/kjs_dom.cpp
+++ b/WebCore/bindings/js/kjs_dom.cpp
@@ -56,7 +56,6 @@
#include "Range.h"
#include "RenderCanvas.h"
#include "css_ruleimpl.h"
-#include "css_stylesheetimpl.h"
#include "dom2_eventsimpl.h"
#include "kjs_css.h"
#include "kjs_events.h"
diff --git a/WebCore/bindings/js/kjs_window.cpp b/WebCore/bindings/js/kjs_window.cpp
index 763dd8a..52f53c8 100644
--- a/WebCore/bindings/js/kjs_window.cpp
+++ b/WebCore/bindings/js/kjs_window.cpp
@@ -48,7 +48,6 @@
#include "Screen.h"
#include "SelectionController.h"
#include "css_ruleimpl.h"
-#include "css_stylesheetimpl.h"
#include "dom2_eventsimpl.h"
#include "htmlediting.h"
#include "kjs_css.h"
diff --git a/WebCore/bindings/objc/DOM.mm b/WebCore/bindings/objc/DOM.mm
index 0ee061f..6de9259 100644
--- a/WebCore/bindings/objc/DOM.mm
+++ b/WebCore/bindings/objc/DOM.mm
@@ -28,6 +28,7 @@
#import "CDATASection.h"
#import "Comment.h"
+#import "CSSStyleSheet.h"
#import "DOMEventsInternal.h"
#import "DOMImplementationFront.h"
#import "DOMInternal.h"
@@ -43,7 +44,6 @@
#import "NodeList.h"
#import "Notation.h"
#import "ProcessingInstruction.h"
-#import "css_stylesheetimpl.h"
#import "csshelper.h"
#import "Range.h"
#import "HTMLNames.h"
diff --git a/WebCore/bindings/objc/DOMCSS.mm b/WebCore/bindings/objc/DOMCSS.mm
index 388a57d..e39637d 100644
--- a/WebCore/bindings/objc/DOMCSS.mm
+++ b/WebCore/bindings/objc/DOMCSS.mm
@@ -26,15 +26,18 @@
#import "config.h"
#import "DOMCSS.h"
+#import "CSSStyleSheet.h"
#import "DOMInternal.h"
#import "DOMWindow.h"
#import "Document.h"
#import "FoundationExtras.h"
#import "HTMLLinkElement.h"
#import "HTMLStyleElement.h"
+#import "MediaList.h"
#import "ProcessingInstruction.h"
+#import "StyleSheet.h"
+#import "StyleSheetList.h"
#import "css_ruleimpl.h"
-#import "css_stylesheetimpl.h"
#import <objc/objc-class.h>
using namespace WebCore;
diff --git a/WebCore/bindings/objc/DOMImplementationFront.cpp b/WebCore/bindings/objc/DOMImplementationFront.cpp
index b758c58..de3d792 100644
--- a/WebCore/bindings/objc/DOMImplementationFront.cpp
+++ b/WebCore/bindings/objc/DOMImplementationFront.cpp
@@ -21,10 +21,10 @@
#include "config.h"
#include "DOMImplementationFront.h"
+#include "CSSStyleSheet.h"
#include "DocumentType.h"
#include "DOMImplementation.h"
#include "HTMLDocument.h"
-#include "css_stylesheetimpl.h"
namespace WebCore {
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index e529bfb..27b98d7 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -146,9 +146,7 @@
# When we're finished with the one-file-per-class
# reorganization, we don't need these special cases.
- if ($type eq "CSSStyleSheet" or $type eq "StyleSheet") {
- $implIncludes{"css_stylesheetimpl.h"} = 1;
- } elsif ($type eq "CSSRuleList" or
+ if ($type eq "CSSRuleList" or
$type eq "CSSRule") {
$implIncludes{"css_ruleimpl.h"} = 1;
} elsif ($type eq "CSSPrimitiveValue" or
@@ -982,14 +980,15 @@
$implIncludes{"kjs_dom.h"} = 1;
return "toJS(exec, $value)";
} elsif ($type eq "CSSStyleSheet" or $type eq "StyleSheet" or $type eq "MediaList") {
- $implIncludes{"css_stylesheetimpl.h"} = 1;
+ $implIncludes{"CSSStyleSheet.h"} = 1;
+ $implIncludes{"MediaList.h"} = 1;
$implIncludes{"css_ruleimpl.h"} = 1;
$implIncludes{"kjs_css.h"} = 1;
- return "toJS(exec, $value)";
+ return "toJS(exec, $value)";
} elsif ($type eq "StyleSheetList") {
- $implIncludes{"css_stylesheetimpl.h"} = 1;
- $implIncludes{"kjs_css.h"} = 1;
- return "toJS(exec, $value, impl)";
+ $implIncludes{"StyleSheetList.h"} = 1;
+ $implIncludes{"kjs_css.h"} = 1;
+ return "toJS(exec, $value, impl)";
} elsif ($type eq "CSSRuleList") {
$implIncludes{"css_ruleimpl.h"} = 1;
return "toJS(exec, $value)";
diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y
index 969a9f1..9f53919 100644
--- a/WebCore/css/CSSGrammar.y
+++ b/WebCore/css/CSSGrammar.y
@@ -24,13 +24,14 @@
#include "config.h"
+#include "CSSStyleSheet.h"
#include "Document.h"
+#include "HTMLNames.h"
+#include "MediaList.h"
+#include "PlatformString.h"
#include "css_ruleimpl.h"
-#include "css_stylesheetimpl.h"
#include "css_valueimpl.h"
#include "cssparser.h"
-#include "PlatformString.h"
-#include "HTMLNames.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp
new file mode 100644
index 0000000..0a3318d
--- /dev/null
+++ b/WebCore/css/CSSStyleSheet.cpp
@@ -0,0 +1,186 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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.
+ */
+#include "config.h"
+#include "CSSStyleSheet.h"
+
+#include "css_ruleimpl.h"
+#include "CSSParser.h"
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "Node.h"
+
+namespace WebCore {
+
+CSSStyleSheet::CSSStyleSheet(CSSStyleSheet* parentSheet, String href)
+ : StyleSheet(parentSheet, href)
+ , m_doc(parentSheet ? parentSheet->doc() : 0)
+ , m_implicit(false)
+ , m_namespaces(0)
+{
+}
+
+CSSStyleSheet::CSSStyleSheet(Node *parentNode, String href, bool _implicit)
+ : StyleSheet(parentNode, href)
+ , m_doc(parentNode->document())
+ , m_implicit(_implicit)
+ , m_namespaces(0)
+{
+}
+
+CSSStyleSheet::CSSStyleSheet(CSSRule *ownerRule, String href)
+ : StyleSheet(ownerRule, href)
+ , m_doc(0)
+ , m_implicit(false)
+ , m_namespaces(0)
+{
+}
+
+CSSRule *CSSStyleSheet::ownerRule() const
+{
+ return (parent() && parent()->isRule()) ? static_cast<CSSRule *>(parent()) : 0;
+}
+
+unsigned CSSStyleSheet::insertRule(const String& rule, unsigned index, ExceptionCode& ec)
+{
+ ec = 0;
+ if (index > length()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+ CSSParser p(useStrictParsing());
+ RefPtr<CSSRule> r = p.parseRule(this, rule);
+
+ if (!r) {
+ ec = SYNTAX_ERR;
+ return 0;
+ }
+
+ // ###
+ // HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the specified index e.g. if an
+ //@import rule is inserted after a standard rule set or other at-rule.
+ insert(index, r.release());
+
+ styleSheetChanged();
+
+ return index;
+}
+
+unsigned CSSStyleSheet::addRule(const String &selector, const String &style, int index, ExceptionCode& ec)
+{
+ if (index == -1)
+ index = length();
+ return insertRule(selector + " { " + style + " }", index, ec);
+}
+
+CSSRuleList *CSSStyleSheet::cssRules()
+{
+ return new CSSRuleList(this);
+}
+
+void CSSStyleSheet::deleteRule(unsigned index, ExceptionCode& ec)
+{
+ if (index >= length()) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ ec = 0;
+ remove(index);
+ styleSheetChanged();
+}
+
+void CSSStyleSheet::addNamespace(CSSParser* p, const AtomicString& prefix, const AtomicString& uri)
+{
+ if (uri.isEmpty())
+ return;
+
+ m_namespaces = new CSSNamespace(prefix, uri, m_namespaces);
+
+ if (prefix.isEmpty())
+ // Set the default namespace on the parser so that selectors that omit namespace info will
+ // be able to pick it up easily.
+ p->defaultNamespace = uri;
+}
+
+const AtomicString& CSSStyleSheet::determineNamespace(const AtomicString& prefix)
+{
+ if (prefix.isEmpty())
+ return nullAtom; // No namespace. If an element/attribute has a namespace, we won't match it.
+ else if (prefix == starAtom)
+ return starAtom; // We'll match any namespace.
+ else if (m_namespaces) {
+ CSSNamespace* ns = m_namespaces->namespaceForPrefix(prefix);
+ if (ns)
+ return ns->uri();
+ }
+ return nullAtom; // Assume we wont match any namespaces.
+}
+
+bool CSSStyleSheet::parseString(const String &string, bool strict)
+{
+ setStrictParsing(strict);
+ CSSParser p(strict);
+ p.parseSheet(this, string);
+ return true;
+}
+
+bool CSSStyleSheet::isLoading()
+{
+ unsigned len = length();
+ for (unsigned i = 0; i < len; ++i) {
+ StyleBase* rule = item(i);
+ if (rule->isImportRule() && static_cast<CSSImportRule*>(rule)->isLoading())
+ return true;
+ }
+ return false;
+}
+
+void CSSStyleSheet::checkLoaded()
+{
+ if (isLoading())
+ return;
+ if (parent())
+ parent()->checkLoaded();
+ if (m_parentNode)
+ m_parentNode->sheetLoaded();
+}
+
+DocLoader *CSSStyleSheet::docLoader()
+{
+ if (!m_doc) // doc is 0 for the user- and default-sheet!
+ return 0;
+
+ // ### remove? (clients just use sheet->doc()->docLoader())
+ return m_doc->docLoader();
+}
+
+void CSSStyleSheet::styleSheetChanged()
+{
+ /* FIXME: We don't need to do everything updateStyleSelector does,
+ * basically we just need to recreate the document's selector with the
+ * already existing style sheets.
+ */
+ if (m_doc)
+ m_doc->updateStyleSelector();
+}
+
+}
diff --git a/WebCore/css/CSSStyleSheet.h b/WebCore/css/CSSStyleSheet.h
new file mode 100644
index 0000000..ace993d
--- /dev/null
+++ b/WebCore/css/CSSStyleSheet.h
@@ -0,0 +1,78 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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 CSSStyleSheet_H
+#define CSSStyleSheet_H
+
+#include "StyleSheet.h"
+
+namespace WebCore {
+
+class CSSParser;
+class CSSRuleList;
+class DocLoader;
+
+typedef int ExceptionCode;
+
+class CSSStyleSheet : public StyleSheet
+{
+public:
+ CSSStyleSheet(Node* parentNode, String href = String(), bool _implicit = false);
+ CSSStyleSheet(CSSStyleSheet* parentSheet, String href = String());
+ CSSStyleSheet(CSSRule* ownerRule, String href = String());
+
+ ~CSSStyleSheet() { delete m_namespaces; }
+
+ virtual bool isCSSStyleSheet() const { return true; }
+
+ virtual String type() const { return "text/css"; }
+
+ CSSRule* ownerRule() const;
+ CSSRuleList* cssRules();
+ unsigned insertRule(const String& rule, unsigned index, ExceptionCode&);
+ void deleteRule(unsigned index, ExceptionCode&);
+ unsigned addRule(const String& selector, const String& style, int index, ExceptionCode&);
+ void removeRule(unsigned index, ExceptionCode& ec) { deleteRule(index, ec); }
+
+ void addNamespace(CSSParser*, const AtomicString& prefix, const AtomicString& uri);
+ const AtomicString& determineNamespace(const AtomicString& prefix);
+
+ virtual void styleSheetChanged();
+
+ virtual bool parseString(const String&, bool strict = true);
+
+ virtual bool isLoading();
+
+ virtual void checkLoaded();
+ DocLoader* docLoader();
+ Document* doc() { return m_doc; }
+ bool implicit() { return m_implicit; }
+
+protected:
+ Document* m_doc;
+ bool m_implicit;
+ CSSNamespace* m_namespaces;
+};
+
+} // namespace
+
+#endif
diff --git a/WebCore/css/MediaList.cpp b/WebCore/css/MediaList.cpp
new file mode 100644
index 0000000..7bc580a
--- /dev/null
+++ b/WebCore/css/MediaList.cpp
@@ -0,0 +1,95 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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.
+ */
+#include "config.h"
+#include "MediaList.h"
+
+#include "CSSStyleSheet.h"
+#include "css_ruleimpl.h"
+#include "DeprecatedStringList.h"
+
+namespace WebCore {
+
+MediaList::MediaList(CSSStyleSheet* parentSheet)
+ : StyleBase(parentSheet)
+{
+}
+
+MediaList::MediaList(CSSStyleSheet* parentSheet, const String& media)
+ : StyleBase(parentSheet)
+{
+ setMediaText(media);
+}
+
+MediaList::MediaList(CSSRule* parentRule, const String& media)
+ : StyleBase(parentRule)
+{
+ setMediaText(media);
+}
+
+bool MediaList::contains(const String& medium) const
+{
+ return m_lstMedia.count() == 0 || m_lstMedia.contains(medium) || m_lstMedia.contains("all");
+}
+
+CSSStyleSheet *MediaList::parentStyleSheet() const
+{
+ return parent()->isCSSStyleSheet() ? static_cast<CSSStyleSheet*>(parent()) : 0;
+}
+
+CSSRule *MediaList::parentRule() const
+{
+ return parent()->isRule() ? static_cast<CSSRule*>(parent()) : 0;
+}
+
+void MediaList::deleteMedium(const String& oldMedium)
+{
+ for (DeprecatedValueList<String>::Iterator it = m_lstMedia.begin(); it != m_lstMedia.end(); ++it) {
+ if ((*it) == oldMedium) {
+ m_lstMedia.remove(it);
+ return;
+ }
+ }
+}
+
+WebCore::String MediaList::mediaText() const
+{
+ String text = "";
+ for (DeprecatedValueList<String>::ConstIterator it = m_lstMedia.begin(); it != m_lstMedia.end(); ++it) {
+ if (text.length() > 0)
+ text += ", ";
+ text += *it;
+ }
+ return text;
+}
+
+void MediaList::setMediaText(const WebCore::String& value)
+{
+ m_lstMedia.clear();
+ DeprecatedStringList list = DeprecatedStringList::split(',', value.deprecatedString());
+ for (DeprecatedStringList::Iterator it = list.begin(); it != list.end(); ++it) {
+ String medium = (*it).stripWhiteSpace();
+ if (!medium.isEmpty())
+ m_lstMedia.append(medium);
+ }
+}
+
+}
diff --git a/WebCore/css/MediaList.h b/WebCore/css/MediaList.h
new file mode 100644
index 0000000..7d717f6
--- /dev/null
+++ b/WebCore/css/MediaList.h
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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 MediaList_H
+#define MediaList_H
+
+#include "css_base.h"
+#include "DeprecatedValueList.h"
+
+namespace WebCore {
+
+class CSSStyleSheet;
+
+class MediaList : public StyleBase
+{
+public:
+ MediaList() : StyleBase(0) {}
+ MediaList(CSSStyleSheet* parentSheet);
+ MediaList(CSSStyleSheet* parentSheet, const String& media);
+ MediaList(CSSRule* parentRule, const String& media);
+
+ virtual bool isMediaList() { return true; }
+
+ CSSStyleSheet* parentStyleSheet() const;
+ CSSRule* parentRule() const;
+ unsigned length() const { return m_lstMedia.count(); }
+ String item(unsigned index) const { return m_lstMedia[index]; }
+ void deleteMedium(const String& oldMedium);
+ void appendMedium(const String& newMedium) { m_lstMedia.append(newMedium); }
+
+ String mediaText() const;
+ void setMediaText(const String&);
+
+ /**
+ * Check if the list contains either the requested medium, or the
+ * catch-all "all" media type. Returns true when found, false otherwise.
+ * Since not specifying media types should be treated as "all" according
+ * to DOM specs, an empty list always returns true.
+ *
+ * _NOT_ part of the DOM!
+ */
+ bool contains(const String& medium) const;
+
+protected:
+ DeprecatedValueList<String> m_lstMedia;
+};
+
+} // namespace
+
+#endif
diff --git a/WebCore/css/StyleSheet.cpp b/WebCore/css/StyleSheet.cpp
new file mode 100644
index 0000000..699121c
--- /dev/null
+++ b/WebCore/css/StyleSheet.cpp
@@ -0,0 +1,70 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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.
+ */
+#include "config.h"
+#include "StyleSheet.h"
+
+#include "MediaList.h"
+
+namespace WebCore {
+
+StyleSheet::StyleSheet(StyleSheet* parentSheet, String href)
+ : StyleList(parentSheet)
+ , m_parentNode(0)
+ , m_strHref(href)
+ , m_disabled(false)
+{
+}
+
+
+StyleSheet::StyleSheet(Node* parentNode, String href)
+ : StyleList(0)
+ , m_parentNode(parentNode)
+ , m_strHref(href)
+ , m_disabled(false)
+{
+}
+
+StyleSheet::StyleSheet(StyleBase* owner, String href)
+ : StyleList(owner)
+ , m_parentNode(0)
+ , m_strHref(href)
+ , m_disabled(false)
+{
+}
+
+StyleSheet::~StyleSheet()
+{
+ if (m_media)
+ m_media->setParent(0);
+}
+
+StyleSheet* StyleSheet::parentStyleSheet() const
+{
+ return (parent() && parent()->isStyleSheet()) ? static_cast<StyleSheet*>(parent()) : 0;
+}
+
+void StyleSheet::setMedia(MediaList* media)
+{
+ m_media = media;
+}
+
+}
diff --git a/WebCore/css/StyleSheet.h b/WebCore/css/StyleSheet.h
new file mode 100644
index 0000000..6177f06
--- /dev/null
+++ b/WebCore/css/StyleSheet.h
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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 StyleSheet_H
+#define StyleSheet_H
+
+#include "css_base.h"
+
+namespace WebCore {
+
+class Node;
+class CachedCSSStyleSheet;
+
+class StyleSheet : public StyleList {
+public:
+ StyleSheet(Node* ownerNode, String href = String());
+ StyleSheet(StyleSheet* parentSheet, String href = String());
+ StyleSheet(StyleBase* owner, String href = String());
+ StyleSheet(CachedCSSStyleSheet*, String href = String());
+ virtual ~StyleSheet();
+
+ virtual bool isStyleSheet() const { return true; }
+
+ virtual String type() const { return String(); }
+
+ bool disabled() const { return m_disabled; }
+ void setDisabled(bool disabled) { m_disabled = disabled; styleSheetChanged(); }
+
+ Node* ownerNode() const { return m_parentNode; }
+ StyleSheet *parentStyleSheet() const;
+ String href() const { return m_strHref; }
+ String title() const { return m_strTitle; }
+ MediaList* media() const { return m_media.get(); }
+ void setMedia(MediaList*);
+
+ virtual bool isLoading() { return false; }
+
+ virtual void styleSheetChanged() { }
+
+protected:
+ Node* m_parentNode;
+ String m_strHref;
+ String m_strTitle;
+ RefPtr<MediaList> m_media;
+ bool m_disabled;
+};
+
+} // namespace
+
+#endif
diff --git a/WebCore/css/StyleSheetList.cpp b/WebCore/css/StyleSheetList.cpp
new file mode 100644
index 0000000..c2fe360
--- /dev/null
+++ b/WebCore/css/StyleSheetList.cpp
@@ -0,0 +1,75 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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.
+ */
+#include "config.h"
+#include "StyleSheetList.h"
+
+#include "CSSStyleSheet.h"
+
+namespace WebCore {
+
+StyleSheetList::~StyleSheetList()
+{
+ for (DeprecatedPtrListIterator<StyleSheet> it (styleSheets); it.current(); ++it)
+ it.current()->deref();
+}
+
+void StyleSheetList::add(StyleSheet* s)
+{
+ if (!styleSheets.containsRef(s)) {
+ s->ref();
+ styleSheets.append(s);
+ }
+}
+
+void StyleSheetList::remove(StyleSheet* s)
+{
+ if (styleSheets.removeRef(s))
+ s->deref();
+}
+
+unsigned StyleSheetList::length() const
+{
+ // hack so implicit BODY stylesheets don't get counted here
+ unsigned l = 0;
+ DeprecatedPtrListIterator<StyleSheet> it(styleSheets);
+ for (; it.current(); ++it) {
+ if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheet*>(it.current())->implicit())
+ l++;
+ }
+ return l;
+}
+
+StyleSheet *StyleSheetList::item (unsigned index)
+{
+ unsigned l = 0;
+ DeprecatedPtrListIterator<StyleSheet> it(styleSheets);
+ for (; it.current(); ++it) {
+ if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheet*>(it.current())->implicit()) {
+ if (l == index)
+ return it.current();
+ l++;
+ }
+ }
+ return 0;
+}
+
+}
diff --git a/WebCore/css/StyleSheetList.h b/WebCore/css/StyleSheetList.h
new file mode 100644
index 0000000..12ea677
--- /dev/null
+++ b/WebCore/css/StyleSheetList.h
@@ -0,0 +1,50 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * (C) 1999-2003 Lars Knoll (knoll@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 StyleSheetList_H
+#define StyleSheetList_H
+
+#include "Shared.h"
+#include "DeprecatedPtrList.h"
+
+namespace WebCore {
+
+class StyleSheet;
+
+class StyleSheetList : public Shared<StyleSheetList>
+{
+public:
+ ~StyleSheetList();
+
+ // the following two ignore implicit stylesheets
+ unsigned length() const;
+ StyleSheet* item(unsigned index);
+
+ void add(StyleSheet*);
+ void remove(StyleSheet*);
+
+ DeprecatedPtrList<StyleSheet> styleSheets;
+};
+
+} // namespace
+
+#endif
diff --git a/WebCore/css/css_base.cpp b/WebCore/css/css_base.cpp
index 6e5d974..bc9d38e 100644
--- a/WebCore/css/css_base.cpp
+++ b/WebCore/css/css_base.cpp
@@ -27,14 +27,15 @@
#include "css_base.h"
#include "Document.h"
-#include "css_stylesheetimpl.h"
#include "css_valueimpl.h"
+#include "StyleSheet.h"
namespace WebCore {
void StyleBase::checkLoaded()
{
- if (parent()) parent()->checkLoaded();
+ if (parent())
+ parent()->checkLoaded();
}
StyleSheet* StyleBase::stylesheet()
@@ -51,18 +52,19 @@
// If it has none, look for the parentsheet, or the parentNode and
// try to find out about their url
- StyleSheet *sheet = stylesheet();
+ StyleSheet* sheet = stylesheet();
- if(!sheet) return String();
+ if (!sheet)
+ return String();
- if(!sheet->href().isNull())
+ if (!sheet->href().isNull())
return sheet->href();
// find parent
- if(sheet->parent())
+ if (sheet->parent())
return sheet->parent()->baseURL();
- if(!sheet->ownerNode())
+ if (!sheet->ownerNode())
return String();
return sheet->ownerNode()->document()->baseURL();
@@ -126,7 +128,7 @@
case None:
break;
}
- if(tagHistory)
+ if (tagHistory)
s += tagHistory->specificity();
// make sure it doesn't overflow
return s & 0xffffff;
@@ -241,13 +243,13 @@
}
-bool CSSSelector::operator == ( const CSSSelector &other )
+bool CSSSelector::operator == (const CSSSelector &other)
{
const CSSSelector *sel1 = this;
const CSSSelector *sel2 = &other;
- while ( sel1 && sel2 ) {
- if ( sel1->tag != sel2->tag || sel1->attr != sel2->attr ||
+ while (sel1 && sel2) {
+ if (sel1->tag != sel2->tag || sel1->attr != sel2->attr ||
sel1->relation() != sel2->relation() || sel1->match != sel2->match ||
sel1->value != sel2->value ||
sel1->pseudoType() != sel2->pseudoType())
@@ -255,7 +257,7 @@
sel1 = sel1->tagHistory;
sel2 = sel2->tagHistory;
}
- if ( sel1 || sel2 )
+ if (sel1 || sel2)
return false;
return true;
}
diff --git a/WebCore/css/css_ruleimpl.cpp b/WebCore/css/css_ruleimpl.cpp
index 5b25e85..eb5a8c0 100644
--- a/WebCore/css/css_ruleimpl.cpp
+++ b/WebCore/css/css_ruleimpl.cpp
@@ -26,21 +26,22 @@
#include "Cache.h"
#include "CachedCSSStyleSheet.h"
+#include "CSSStyleSheet.h"
#include "DocLoader.h"
-#include "css_stylesheetimpl.h"
+#include "MediaList.h"
#include "cssparser.h"
#include <KURL.h>
namespace WebCore {
-CSSStyleSheet *CSSRule::parentStyleSheet() const
+CSSStyleSheet* CSSRule::parentStyleSheet() const
{
- return (parent() && parent()->isCSSStyleSheet()) ? static_cast<CSSStyleSheet *>(parent()) : 0;
+ return (parent() && parent()->isCSSStyleSheet()) ? static_cast<CSSStyleSheet*>(parent()) : 0;
}
-CSSRule *CSSRule::parentRule() const
+CSSRule* CSSRule::parentRule() const
{
- return (parent() && parent()->isRule()) ? static_cast<CSSRule *>(parent()) : 0;
+ return (parent() && parent()->isRule()) ? static_cast<CSSRule*>(parent()) : 0;
}
String CSSRule::cssText() const
@@ -244,7 +245,7 @@
for (unsigned i = 0; i < len; ++i) {
StyleBase *style = lst->item(i);
if (style->isRule())
- append(static_cast<CSSRule *>(style));
+ append(static_cast<CSSRule*>(style));
}
}
}
diff --git a/WebCore/css/css_stylesheetimpl.cpp b/WebCore/css/css_stylesheetimpl.cpp
deleted file mode 100644
index a9bd586..0000000
--- a/WebCore/css/css_stylesheetimpl.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-/**
- * This file is part of the DOM implementation for KDE.
- *
- * (C) 1999-2003 Lars Knoll (knoll@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.
- */
-
-#include "config.h"
-#include "css_stylesheetimpl.h"
-
-#include "ExceptionCode.h"
-#include "PlatformString.h"
-#include "css_ruleimpl.h"
-#include "css_valueimpl.h"
-#include "cssparser.h"
-#include "HTMLDocument.h"
-#include "loader.h"
-
-namespace WebCore {
-
-// --------------------------------------------------------------------------------
-
-StyleSheet::StyleSheet(StyleSheet *parentSheet, String href)
- : StyleList(parentSheet)
-{
- m_disabled = false;
- m_parentNode = 0;
- m_strHref = href;
-}
-
-
-StyleSheet::StyleSheet(WebCore::Node *parentNode, String href)
- : StyleList(0)
-{
- m_parentNode = parentNode;
- m_disabled = false;
- m_strHref = href;
-}
-
-StyleSheet::StyleSheet(StyleBase *owner, String href)
- : StyleList(owner)
-{
- m_disabled = false;
- m_parentNode = 0;
- m_strHref = href;
-}
-
-StyleSheet::~StyleSheet()
-{
- if (m_media)
- m_media->setParent(0);
-}
-
-StyleSheet *StyleSheet::parentStyleSheet() const
-{
- return (parent() && parent()->isStyleSheet()) ? static_cast<StyleSheet *>(parent()) : 0;
-}
-
-void StyleSheet::setMedia(MediaList *media)
-{
- m_media = media;
-}
-
-// -----------------------------------------------------------------------
-
-
-CSSStyleSheet::CSSStyleSheet(CSSStyleSheet *parentSheet, String href)
- : StyleSheet(parentSheet, href)
-{
- m_doc = parentSheet ? parentSheet->doc() : 0;
- m_implicit = false;
- m_namespaces = 0;
-}
-
-CSSStyleSheet::CSSStyleSheet(Node *parentNode, String href, bool _implicit)
- : StyleSheet(parentNode, href)
-{
- m_doc = parentNode->document();
- m_implicit = _implicit;
- m_namespaces = 0;
-}
-
-CSSStyleSheet::CSSStyleSheet(CSSRule *ownerRule, String href)
- : StyleSheet(ownerRule, href)
-{
- m_doc = 0;
- m_implicit = false;
- m_namespaces = 0;
-}
-
-CSSRule *CSSStyleSheet::ownerRule() const
-{
- return (parent() && parent()->isRule()) ? static_cast<CSSRule *>(parent()) : 0;
-}
-
-unsigned CSSStyleSheet::insertRule(const String& rule, unsigned index, ExceptionCode& ec)
-{
- ec = 0;
- if (index > length()) {
- ec = INDEX_SIZE_ERR;
- return 0;
- }
- CSSParser p(useStrictParsing());
- RefPtr<CSSRule> r = p.parseRule(this, rule);
-
- if (!r) {
- ec = SYNTAX_ERR;
- return 0;
- }
-
- // ###
- // HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the specified index e.g. if an
- //@import rule is inserted after a standard rule set or other at-rule.
- insert(index, r.release());
-
- styleSheetChanged();
-
- return index;
-}
-
-unsigned CSSStyleSheet::addRule( const String &selector, const String &style, int index, ExceptionCode& ec)
-{
- if (index == -1)
- index = length();
- return insertRule(selector + " { " + style + " }", index, ec);
-}
-
-CSSRuleList *CSSStyleSheet::cssRules()
-{
- return new CSSRuleList(this);
-}
-
-void CSSStyleSheet::deleteRule( unsigned index, ExceptionCode& ec)
-{
- if (index >= length()) {
- ec = INDEX_SIZE_ERR;
- return;
- }
-
- ec = 0;
- remove(index);
- styleSheetChanged();
-}
-
-void CSSStyleSheet::addNamespace(CSSParser* p, const AtomicString& prefix, const AtomicString& uri)
-{
- if (uri.isEmpty())
- return;
-
- m_namespaces = new CSSNamespace(prefix, uri, m_namespaces);
-
- if (prefix.isEmpty())
- // Set the default namespace on the parser so that selectors that omit namespace info will
- // be able to pick it up easily.
- p->defaultNamespace = uri;
-}
-
-const AtomicString& CSSStyleSheet::determineNamespace(const AtomicString& prefix)
-{
- if (prefix.isEmpty())
- return nullAtom; // No namespace. If an element/attribute has a namespace, we won't match it.
- else if (prefix == starAtom)
- return starAtom; // We'll match any namespace.
- else if (m_namespaces) {
- CSSNamespace* ns = m_namespaces->namespaceForPrefix(prefix);
- if (ns)
- return ns->uri();
- }
- return nullAtom; // Assume we wont match any namespaces.
-}
-
-bool CSSStyleSheet::parseString(const String &string, bool strict)
-{
- setStrictParsing(strict);
- CSSParser p( strict );
- p.parseSheet( this, string );
- return true;
-}
-
-bool CSSStyleSheet::isLoading()
-{
- unsigned len = length();
- for (unsigned i = 0; i < len; ++i) {
- StyleBase* rule = item(i);
- if (rule->isImportRule() && static_cast<CSSImportRule*>(rule)->isLoading())
- return true;
- }
- return false;
-}
-
-void CSSStyleSheet::checkLoaded()
-{
- if (isLoading())
- return;
- if (parent())
- parent()->checkLoaded();
- if (m_parentNode)
- m_parentNode->sheetLoaded();
-}
-
-WebCore::DocLoader *CSSStyleSheet::docLoader()
-{
- if ( !m_doc ) // doc is 0 for the user- and default-sheet!
- return 0;
-
- // ### remove? (clients just use sheet->doc()->docLoader())
- return m_doc->docLoader();
-}
-
-void CSSStyleSheet::styleSheetChanged()
-{
- /* FIXME: We don't need to do everything updateStyleSelector does,
- * basically we just need to recreate the document's selector with the
- * already existing style sheets.
- */
- if (m_doc)
- m_doc->updateStyleSelector();
-}
-
-// ---------------------------------------------------------------------------
-
-
-StyleSheetList::~StyleSheetList()
-{
- for ( DeprecatedPtrListIterator<StyleSheet> it ( styleSheets ); it.current(); ++it )
- it.current()->deref();
-}
-
-void StyleSheetList::add( StyleSheet* s )
-{
- if ( !styleSheets.containsRef( s ) ) {
- s->ref();
- styleSheets.append( s );
- }
-}
-
-void StyleSheetList::remove( StyleSheet* s )
-{
- if ( styleSheets.removeRef( s ) )
- s->deref();
-}
-
-unsigned StyleSheetList::length() const
-{
- // hack so implicit BODY stylesheets don't get counted here
- unsigned l = 0;
- DeprecatedPtrListIterator<StyleSheet> it(styleSheets);
- for (; it.current(); ++it) {
- if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheet*>(it.current())->implicit())
- l++;
- }
- return l;
-}
-
-StyleSheet *StyleSheetList::item ( unsigned index )
-{
- unsigned l = 0;
- DeprecatedPtrListIterator<StyleSheet> it(styleSheets);
- for (; it.current(); ++it) {
- if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheet*>(it.current())->implicit()) {
- if (l == index)
- return it.current();
- l++;
- }
- }
- return 0;
-}
-
-// --------------------------------------------------------------------------------------------
-
-MediaList::MediaList( CSSStyleSheet *parentSheet,
- const String &media )
- : StyleBase( parentSheet )
-{
- setMediaText( media );
-}
-
-MediaList::MediaList( CSSRule *parentRule, const String &media )
- : StyleBase(parentRule)
-{
- setMediaText( media );
-}
-
-bool MediaList::contains( const String &medium ) const
-{
- return m_lstMedia.count() == 0 || m_lstMedia.contains( medium ) ||
- m_lstMedia.contains( "all" );
-}
-
-CSSStyleSheet *MediaList::parentStyleSheet() const
-{
- return parent()->isCSSStyleSheet() ? static_cast<CSSStyleSheet *>(parent()) : 0;
-}
-
-CSSRule *MediaList::parentRule() const
-{
- return parent()->isRule() ? static_cast<CSSRule *>(parent()) : 0;
-}
-
-void MediaList::deleteMedium( const String &oldMedium )
-{
- for ( DeprecatedValueList<String>::Iterator it = m_lstMedia.begin(); it != m_lstMedia.end(); ++it ) {
- if ((*it) == oldMedium) {
- m_lstMedia.remove( it );
- return;
- }
- }
-}
-
-WebCore::String MediaList::mediaText() const
-{
- String text = "";
- for (DeprecatedValueList<String>::ConstIterator it = m_lstMedia.begin(); it != m_lstMedia.end(); ++it) {
- if (text.length() > 0)
- text += ", ";
- text += *it;
- }
- return text;
-}
-
-void MediaList::setMediaText(const WebCore::String &value)
-{
- m_lstMedia.clear();
- DeprecatedStringList list = DeprecatedStringList::split(',', value.deprecatedString());
- for (DeprecatedStringList::Iterator it = list.begin(); it != list.end(); ++it) {
- String medium = (*it).stripWhiteSpace();
- if (!medium.isEmpty())
- m_lstMedia.append(medium);
- }
-}
-
-}
diff --git a/WebCore/css/css_stylesheetimpl.h b/WebCore/css/css_stylesheetimpl.h
deleted file mode 100644
index 093b7a4..0000000
--- a/WebCore/css/css_stylesheetimpl.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * This file is part of the DOM implementation for KDE.
- *
- * (C) 1999-2003 Lars Knoll (knoll@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 CSS_css_stylesheetimpl_h_
-#define CSS_css_stylesheetimpl_h_
-
-#include "css_base.h"
-#include "DeprecatedPtrList.h"
-#include "DeprecatedValueList.h"
-
-namespace WebCore {
-
-class CSSParser;
-class CSSRule;
-class CSSRuleList;
-class CSSStyleRule;
-class CSSStyleSheet;
-class CSSValue;
-class CachedCSSStyleSheet;
-class DocLoader;
-class Document;
-class MediaList;
-class Node;
-class StyleSheet;
-
-typedef int ExceptionCode;
-
-class StyleSheet : public StyleList {
-public:
- StyleSheet(Node *ownerNode, String href = String());
- StyleSheet(StyleSheet *parentSheet, String href = String());
- StyleSheet(StyleBase *owner, String href = String());
- StyleSheet(CachedCSSStyleSheet *cached, String href = String());
- virtual ~StyleSheet();
-
- virtual bool isStyleSheet() const { return true; }
-
- virtual String type() const { return String(); }
-
- bool disabled() const { return m_disabled; }
- void setDisabled(bool disabled) { m_disabled = disabled; styleSheetChanged(); }
-
- Node *ownerNode() const { return m_parentNode; }
- StyleSheet *parentStyleSheet() const;
- String href() const { return m_strHref; }
- String title() const { return m_strTitle; }
- MediaList* media() const { return m_media.get(); }
- void setMedia(MediaList*);
-
- virtual bool isLoading() { return false; }
-
- virtual void styleSheetChanged() { }
-
-protected:
- Node *m_parentNode;
- String m_strHref;
- String m_strTitle;
- RefPtr<MediaList> m_media;
- bool m_disabled;
-};
-
-class CSSStyleSheet : public StyleSheet
-{
-public:
- CSSStyleSheet(Node *parentNode, String href = String(), bool _implicit = false);
- CSSStyleSheet(CSSStyleSheet *parentSheet, String href = String());
- CSSStyleSheet(CSSRule *ownerRule, String href = String());
-
- ~CSSStyleSheet() { delete m_namespaces; }
-
- virtual bool isCSSStyleSheet() const { return true; }
-
- virtual String type() const { return "text/css"; }
-
- CSSRule *ownerRule() const;
- CSSRuleList *cssRules();
- unsigned insertRule(const String &rule, unsigned index, ExceptionCode&);
- void deleteRule(unsigned index, ExceptionCode&);
- unsigned addRule(const String &selector, const String &style, int index, ExceptionCode&);
- void removeRule(unsigned index, ExceptionCode& ec) { deleteRule(index, ec); }
-
- void addNamespace(CSSParser* p, const AtomicString& prefix, const AtomicString& uri);
- const AtomicString& determineNamespace(const AtomicString& prefix);
-
- virtual void styleSheetChanged();
-
- virtual bool parseString(const String&, bool strict = true);
-
- virtual bool isLoading();
-
- virtual void checkLoaded();
- DocLoader* docLoader();
- Document* doc() { return m_doc; }
- bool implicit() { return m_implicit; }
-
-protected:
- Document* m_doc;
- bool m_implicit;
- CSSNamespace* m_namespaces;
-};
-
-// ----------------------------------------------------------------------------
-
-class StyleSheetList : public Shared<StyleSheetList>
-{
-public:
- ~StyleSheetList();
-
- // the following two ignore implicit stylesheets
- unsigned length() const;
- StyleSheet* item(unsigned index);
-
- void add(StyleSheet* s);
- void remove(StyleSheet* s);
-
- DeprecatedPtrList<StyleSheet> styleSheets;
-};
-
-// ----------------------------------------------------------------------------
-
-class MediaList : public StyleBase
-{
-public:
- MediaList() : StyleBase(0) {}
- MediaList(CSSStyleSheet* parentSheet) : StyleBase(parentSheet) {}
- MediaList(CSSStyleSheet* parentSheet, const String& media);
- MediaList(CSSRule* parentRule, const String& media);
-
- virtual bool isMediaList() { return true; }
-
- CSSStyleSheet* parentStyleSheet() const;
- CSSRule* parentRule() const;
- unsigned length() const { return m_lstMedia.count(); }
- String item(unsigned index) const { return m_lstMedia[index]; }
- void deleteMedium(const String& oldMedium);
- void appendMedium(const String& newMedium) { m_lstMedia.append(newMedium); }
-
- String mediaText() const;
- void setMediaText(const String&);
-
- /**
- * Check if the list contains either the requested medium, or the
- * catch-all "all" media type. Returns true when found, false otherwise.
- * Since not specifying media types should be treated as "all" according
- * to DOM specs, an empty list always returns true.
- *
- * _NOT_ part of the DOM!
- */
- bool contains(const String& medium) const;
-
-protected:
- DeprecatedValueList<String> m_lstMedia;
-};
-
-} // namespace
-
-#endif
diff --git a/WebCore/css/css_valueimpl.cpp b/WebCore/css/css_valueimpl.cpp
index 2a1a004..cca086b 100644
--- a/WebCore/css/css_valueimpl.cpp
+++ b/WebCore/css/css_valueimpl.cpp
@@ -29,10 +29,10 @@
#include "Document.h"
#include "ExceptionCode.h"
#include "HTMLElement.h"
-#include "css_stylesheetimpl.h"
#include "cssparser.h"
#include "CSSPropertyNames.h"
#include "cssstyleselector.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "RegularExpression.h"
diff --git a/WebCore/css/cssparser.cpp b/WebCore/css/cssparser.cpp
index fb4e466..e9380b8 100644
--- a/WebCore/css/cssparser.cpp
+++ b/WebCore/css/cssparser.cpp
@@ -26,10 +26,11 @@
#include "Document.h"
#include "css_ruleimpl.h"
-#include "css_stylesheetimpl.h"
#include "csshelper.h"
#include "CSSPropertyNames.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
+#include "MediaList.h"
#define YYDEBUG 0
diff --git a/WebCore/css/cssstyleselector.cpp b/WebCore/css/cssstyleselector.cpp
index e837359..888d48d 100644
--- a/WebCore/css/cssstyleselector.cpp
+++ b/WebCore/css/cssstyleselector.cpp
@@ -25,6 +25,7 @@
#include "cssstyleselector.h"
#include "CSSPropertyNames.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "CachedImage.h"
#include "Frame.h"
@@ -34,9 +35,10 @@
#include "HTMLNames.h"
#include "History.h"
#include "KWQKHTMLSettings.h"
+#include "MediaList.h"
#include "RenderTheme.h"
+#include "StyleSheetList.h"
#include "UserAgentStyleSheets.h"
-#include "css_stylesheetimpl.h"
#include "loader.h"
using namespace std;
diff --git a/WebCore/dom/DOMImplementation.cpp b/WebCore/dom/DOMImplementation.cpp
index 8a2281c..17f6cd1 100644
--- a/WebCore/dom/DOMImplementation.cpp
+++ b/WebCore/dom/DOMImplementation.cpp
@@ -25,11 +25,12 @@
#include "config.h"
#include "DOMImplementation.h"
+#include "CSSStyleSheet.h"
#include "DocumentType.h"
#include "Element.h"
#include "ExceptionCode.h"
-#include "css_stylesheetimpl.h"
#include "HTMLDocument.h"
+#include "MediaList.h"
#include "RegularExpression.h"
#include "TextDocument.h"
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 7ee6059..a619083 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -27,6 +27,7 @@
#include "AccessibilityObjectCache.h"
#include "CDATASection.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "Comment.h"
#include "DOMImplementation.h"
@@ -63,6 +64,7 @@
#include "SegmentedString.h"
#include "SelectionController.h"
#include "StringHash.h"
+#include "StyleSheetList.h"
#include "SystemTime.h"
#include "TextIterator.h"
#include "css_valueimpl.h"
diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp
index fd4d67b..ce69cd5 100644
--- a/WebCore/dom/ProcessingInstruction.cpp
+++ b/WebCore/dom/ProcessingInstruction.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "ProcessingInstruction.h"
+#include "CSSStyleSheet.h"
#include "CachedCSSStyleSheet.h"
#include "CachedXSLStyleSheet.h"
#include "Document.h"
diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp
index aa0d887..647e346 100644
--- a/WebCore/dom/StyledElement.cpp
+++ b/WebCore/dom/StyledElement.cpp
@@ -26,10 +26,10 @@
#include "config.h"
#include "StyledElement.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "Document.h"
#include "HTMLNames.h"
-#include "css_stylesheetimpl.h"
using namespace std;
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp
index 0a8def6..c0db4c5 100644
--- a/WebCore/html/HTMLBodyElement.cpp
+++ b/WebCore/html/HTMLBodyElement.cpp
@@ -25,9 +25,10 @@
#include "config.h"
#include "HTMLBodyElement.h"
-#include "css_stylesheetimpl.h"
+#include "css_valueimpl.h" // for CSSMutableStyleDeclaration
#include "CSSPropertyNames.h"
#include "cssstyleselector.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "Document.h"
#include "EventNames.h"
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 5f6dca3..0e33d6d 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -31,7 +31,6 @@
#include "ExceptionCode.h"
#include "Frame.h"
#include "css_ruleimpl.h"
-#include "css_stylesheetimpl.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "dom2_eventsimpl.h"
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index 4968b0f..cd62141 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -30,6 +30,7 @@
#include "Frame.h"
#include "FrameTree.h"
#include "HTMLNames.h"
+#include "MediaList.h"
#include "csshelper.h"
namespace WebCore {
@@ -91,6 +92,11 @@
}
}
+StyleSheet* HTMLLinkElement::sheet() const
+{
+ return m_sheet.get();
+}
+
void HTMLLinkElement::parseMappedAttribute(MappedAttribute *attr)
{
if (attr->name() == relAttr) {
@@ -197,12 +203,12 @@
process();
}
-void HTMLLinkElement::setStyleSheet(const String &url, const String &sheetStr)
+void HTMLLinkElement::setStyleSheet(const String& url, const String& sheetStr)
{
m_sheet = new CSSStyleSheet(this, url);
m_sheet->parseString(sheetStr, !document()->inCompatMode());
- MediaList *media = new MediaList(m_sheet.get(), m_media);
+ MediaList* media = new MediaList(m_sheet.get(), m_media);
m_sheet->setMedia(media);
m_loading = false;
@@ -247,7 +253,7 @@
return getAttribute(charsetAttr);
}
-void HTMLLinkElement::setCharset(const String &value)
+void HTMLLinkElement::setCharset(const String& value)
{
setAttribute(charsetAttr, value);
}
@@ -257,7 +263,7 @@
return document()->completeURL(getAttribute(hrefAttr));
}
-void HTMLLinkElement::setHref(const String &value)
+void HTMLLinkElement::setHref(const String& value)
{
setAttribute(hrefAttr, value);
}
@@ -267,7 +273,7 @@
return getAttribute(hreflangAttr);
}
-void HTMLLinkElement::setHreflang(const String &value)
+void HTMLLinkElement::setHreflang(const String& value)
{
setAttribute(hreflangAttr, value);
}
@@ -277,7 +283,7 @@
return getAttribute(mediaAttr);
}
-void HTMLLinkElement::setMedia(const String &value)
+void HTMLLinkElement::setMedia(const String& value)
{
setAttribute(mediaAttr, value);
}
@@ -287,7 +293,7 @@
return getAttribute(relAttr);
}
-void HTMLLinkElement::setRel(const String &value)
+void HTMLLinkElement::setRel(const String& value)
{
setAttribute(relAttr, value);
}
@@ -297,7 +303,7 @@
return getAttribute(revAttr);
}
-void HTMLLinkElement::setRev(const String &value)
+void HTMLLinkElement::setRev(const String& value)
{
setAttribute(revAttr, value);
}
@@ -307,7 +313,7 @@
return getAttribute(targetAttr);
}
-void HTMLLinkElement::setTarget(const String &value)
+void HTMLLinkElement::setTarget(const String& value)
{
setAttribute(targetAttr, value);
}
@@ -317,7 +323,7 @@
return getAttribute(typeAttr);
}
-void HTMLLinkElement::setType(const String &value)
+void HTMLLinkElement::setType(const String& value)
{
setAttribute(typeAttr, value);
}
diff --git a/WebCore/html/HTMLLinkElement.h b/WebCore/html/HTMLLinkElement.h
index a4fa412..dcc9c18 100644
--- a/WebCore/html/HTMLLinkElement.h
+++ b/WebCore/html/HTMLLinkElement.h
@@ -25,7 +25,8 @@
#define HTMLLinkElement_H
#include "HTMLElement.h"
-#include "css_stylesheetimpl.h"
+#include "CachedObjectClient.h"
+#include "CSSStyleSheet.h"
namespace WebCore {
@@ -67,7 +68,7 @@
String type() const;
void setType(const String&);
- StyleSheet* sheet() const { return m_sheet.get(); }
+ StyleSheet* sheet() const;
// overload from HTMLElement
virtual void parseMappedAttribute(MappedAttribute*);
diff --git a/WebCore/html/HTMLStyleElement.cpp b/WebCore/html/HTMLStyleElement.cpp
index 1c0ab10..92a4e0c 100644
--- a/WebCore/html/HTMLStyleElement.cpp
+++ b/WebCore/html/HTMLStyleElement.cpp
@@ -26,6 +26,7 @@
#include "Document.h"
#include "HTMLNames.h"
+#include "MediaList.h"
namespace WebCore {
@@ -37,6 +38,11 @@
{
}
+StyleSheet* HTMLStyleElement::sheet() const
+{
+ return m_sheet.get();
+}
+
// other stuff...
void HTMLStyleElement::parseMappedAttribute(MappedAttribute *attr)
{
@@ -83,7 +89,7 @@
m_loading = true;
m_sheet = new CSSStyleSheet(this);
m_sheet->parseString(text, !document()->inCompatMode());
- MediaList *media = new MediaList(m_sheet.get(), m_media);
+ MediaList* media = new MediaList(m_sheet.get(), m_media);
m_sheet->setMedia(media);
m_loading = false;
}
diff --git a/WebCore/html/HTMLStyleElement.h b/WebCore/html/HTMLStyleElement.h
index c095e80..b5aedc1 100644
--- a/WebCore/html/HTMLStyleElement.h
+++ b/WebCore/html/HTMLStyleElement.h
@@ -25,20 +25,20 @@
#define HTMLStyleElement_H
#include "HTMLElement.h"
-#include "css_stylesheetimpl.h"
+#include "CSSStyleSheet.h"
namespace WebCore {
class HTMLStyleElement : public HTMLElement
{
public:
- HTMLStyleElement(Document *doc);
+ HTMLStyleElement(Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 1; }
virtual bool checkDTD(const Node* newChild) { return newChild->isTextNode(); }
- StyleSheet *sheet() const { return m_sheet.get(); }
+ StyleSheet* sheet() const;
// overload from HTMLElement
virtual void parseMappedAttribute(MappedAttribute*);
diff --git a/WebCore/html/HTMLTableElement.cpp b/WebCore/html/HTMLTableElement.cpp
index cd7c1cf..ca9b7bf 100644
--- a/WebCore/html/HTMLTableElement.cpp
+++ b/WebCore/html/HTMLTableElement.cpp
@@ -28,7 +28,7 @@
#include "csshelper.h"
#include "CSSPropertyNames.h"
-#include "css_stylesheetimpl.h"
+#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
#include "Document.h"
#include "ExceptionCode.h"
diff --git a/WebCore/ksvg2/svg/SVGDOMImplementation.cpp b/WebCore/ksvg2/svg/SVGDOMImplementation.cpp
index 3f64c0a..cde4988 100644
--- a/WebCore/ksvg2/svg/SVGDOMImplementation.cpp
+++ b/WebCore/ksvg2/svg/SVGDOMImplementation.cpp
@@ -25,14 +25,15 @@
#if SVG_SUPPORT
#include "SVGDOMImplementation.h"
+#include "CSSStyleSheet.h"
#include "Document.h"
#include "DocumentType.h"
#include "ExceptionCode.h"
+#include "MediaList.h"
#include "PlatformString.h"
#include "SVGDocument.h"
#include "SVGRenderStyle.h"
#include "SVGSVGElement.h"
-#include "css_stylesheetimpl.h"
#include "ksvg.h"
#include <wtf/HashSet.h>
diff --git a/WebCore/ksvg2/svg/SVGDocument.cpp b/WebCore/ksvg2/svg/SVGDocument.cpp
index fc36162..56804689 100644
--- a/WebCore/ksvg2/svg/SVGDocument.cpp
+++ b/WebCore/ksvg2/svg/SVGDocument.cpp
@@ -40,7 +40,6 @@
#include "SVGTitleElement.h"
#include "SVGZoomEvent.h"
#include "Shared.h"
-#include "css_stylesheetimpl.h"
#include "cssstyleselector.h"
#include "ksvg.h"
#include <assert.h>
diff --git a/WebCore/ksvg2/svg/SVGElement.cpp b/WebCore/ksvg2/svg/SVGElement.cpp
index 8d1d393..cbcdac5 100644
--- a/WebCore/ksvg2/svg/SVGElement.cpp
+++ b/WebCore/ksvg2/svg/SVGElement.cpp
@@ -30,7 +30,6 @@
#include "SVGDOMImplementation.h"
#include "SVGNames.h"
#include "SVGSVGElement.h"
-#include "css_stylesheetimpl.h"
#include "HTMLNames.h"
#include "ksvg.h"
#include "PlatformString.h"
diff --git a/WebCore/ksvg2/svg/SVGStyleElement.cpp b/WebCore/ksvg2/svg/SVGStyleElement.cpp
index b80e886..a4a7f00 100644
--- a/WebCore/ksvg2/svg/SVGStyleElement.cpp
+++ b/WebCore/ksvg2/svg/SVGStyleElement.cpp
@@ -25,13 +25,14 @@
#if SVG_SUPPORT
#include "SVGStyleElement.h"
+#include "CSSStyleSheet.h"
+#include "DeprecatedString.h"
#include "Document.h"
#include "ExceptionCode.h"
+#include "MediaList.h"
#include "PlatformString.h"
-#include "DeprecatedString.h"
-#include "css_stylesheetimpl.h"
-using namespace WebCore;
+namespace WebCore {
SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document *doc) : SVGElement(tagName, doc)
{
@@ -104,7 +105,7 @@
m_sheet = new CSSStyleSheet(this);
m_sheet->parseString(textContent()); // SVG css is always parsed in strict mode
- MediaList *mediaList = new MediaList(m_sheet.get(), _media);
+ MediaList* mediaList = new MediaList(m_sheet.get(), _media);
m_sheet->setMedia(mediaList);
m_loading = false;
}
@@ -118,5 +119,7 @@
return false;
}
+}
+
// vim:ts=4:noet
#endif // SVG_SUPPORT
diff --git a/WebCore/xml/XSLStyleSheet.h b/WebCore/xml/XSLStyleSheet.h
index 1a67835..da44ea3 100644
--- a/WebCore/xml/XSLStyleSheet.h
+++ b/WebCore/xml/XSLStyleSheet.h
@@ -20,18 +20,19 @@
*
*/
-#ifndef xsl_stylesheetimpl_h_
-#define xsl_stylesheetimpl_h_
+#ifndef XSLStyleSheet_H
+#define XSLStyleSheet_H
#ifdef KHTML_XSLT
#include "CachedObjectClient.h"
-#include "css/css_stylesheetimpl.h"
+#include "StyleSheet.h"
#include <libxml/parser.h>
#include <libxslt/transform.h>
namespace WebCore {
+class DocLoader;
class XSLImportRule;
class CachedXSLStyleSheet;