Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Sep 2006 21:14:44 +0000 (21:14 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Sep 2006 21:14:44 +0000 (21:14 +0000)
commite47e2becc5cd3670b3c149a089e255f814a0c1e3
tree4daff78d290904d52c486fa31ff136e94a7f4a08
parent18941247bbfcc49a900099378ab1d1fcceeb50ff
    Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=11011
        External CSS is parsed as iso-8859-1 even though the main document is utf-8

        Test: fast/encoding/css-charset-default.xhtml

        * loader/CachedResourceClient.h:
        (WebCore::CachedResourceClient::setCSSStyleSheet):
        (WebCore::CachedResourceClient::setXSLStyleSheet):
        Divided setStyleSheet into setCSSStyleSheet and setXSLStyleSheet. The former
        takes an additional charset parameter, to be passed to CSSStyleSheet constructor.

        * css/CSSImportRule.cpp:
        (WebCore::CSSImportRule::setCSSStyleSheet):
        (WebCore::CSSImportRule::insertedIntoParent): Default to parent stylesheet's charset.
        * css/CSSImportRule.h:

        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::CSSStyleSheet):
        * css/CSSStyleSheet.h:
        Added an m_charset member to be used when loading child stylesheets. Removed an unused m_implicit
        member. Changed some String parameters to const String&.

        * css/StyleSheet.cpp:
        (WebCore::StyleSheet::StyleSheet):
        * css/StyleSheet.h:
        Changed some String parameters to const String&. Removed an unused (even unimplemented) constructor.

        * css/StyleSheetList.cpp:
        (WebCore::StyleSheetList::length):
        (WebCore::StyleSheetList::item):
        * css/StyleSheetList.h:
        Special-casing implicit stylesheets seemed to be dead code, removed.

        * dom/Document.cpp:
        (WebCore::Document::setCSSStyleSheet):
        (WebCore::Document::recalcStyleSelector):
        * dom/Document.h:
        Renamed setStyleSheet() to setCSSStyleSheet().

        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet): Pass a correct charset to requestCSSStyleSheet().
        (WebCore::ProcessingInstruction::setCSSStyleSheet):
        (WebCore::ProcessingInstruction::setXSLStyleSheet):
        (WebCore::ProcessingInstruction::parseStyleSheet):
        * dom/ProcessingInstruction.h:

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process): Default to document encoding if a charset attribute
        is not specified.
        (WebCore::HTMLLinkElement::setCSSStyleSheet):
        * html/HTMLLinkElement.h:

        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::childrenChanged):
        * ksvg2/svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::childrenChanged):
        Inherit URL and charset from the document.

        * loader/Cache.cpp:
        (WebCore::Cache::requestCSSStyleSheet):
        * loader/Cache.h:
        Adjust for setStyleSheet() renaming.

        * loader/CachedCSSStyleSheet.h: Removed an unused constructor.
        * loader/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::ref):
        (WebCore::CachedCSSStyleSheet::deref):
        (WebCore::CachedCSSStyleSheet::checkNotify):
        Pass the encoding to setCSSStyleSheet().

        * loader/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::ref):
        (WebCore::CachedXSLStyleSheet::checkNotify):
        * loader/DocLoader.cpp:
        (WebCore::DocLoader::requestCSSStyleSheet):
        * loader/DocLoader.h:
        * page/Frame.cpp:
        (WebCore::UserStyleSheetLoader::UserStyleSheetLoader):
        (WebCore::UserStyleSheetLoader::setCSSStyleSheet):
        * xml/XSLImportRule.cpp:
        (WebCore::XSLImportRule::setXSLStyleSheet):
        (WebCore::XSLImportRule::loadSheet):
        * xml/XSLImportRule.h:
        Adjust for setStyleSheet() renaming.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/encoding/css-charset-default-expected.txt [new file with mode: 0644]
LayoutTests/fast/encoding/css-charset-default.xhtml [new file with mode: 0644]
LayoutTests/fast/encoding/css-charset-import.css [new file with mode: 0644]
LayoutTests/fast/encoding/css-charset-inherit-iso-8859-5.css [new file with mode: 0644]
LayoutTests/fast/encoding/css-charset-inherit-koi-8.css [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSImportRule.cpp
WebCore/css/CSSImportRule.h
WebCore/css/CSSStyleSheet.cpp
WebCore/css/CSSStyleSheet.h
WebCore/css/StyleSheet.cpp
WebCore/css/StyleSheet.h
WebCore/css/StyleSheetList.cpp
WebCore/css/StyleSheetList.h
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/ProcessingInstruction.cpp
WebCore/dom/ProcessingInstruction.h
WebCore/html/HTMLLinkElement.cpp
WebCore/html/HTMLLinkElement.h
WebCore/html/HTMLStyleElement.cpp
WebCore/ksvg2/svg/SVGStyleElement.cpp
WebCore/loader/Cache.cpp
WebCore/loader/Cache.h
WebCore/loader/CachedCSSStyleSheet.cpp
WebCore/loader/CachedCSSStyleSheet.h
WebCore/loader/CachedResourceClient.h
WebCore/loader/CachedXSLStyleSheet.cpp
WebCore/loader/DocLoader.cpp
WebCore/loader/DocLoader.h
WebCore/page/Frame.cpp
WebCore/xml/XSLImportRule.cpp
WebCore/xml/XSLImportRule.h