Skip to content
  • hyatt@apple.com's avatar
    Fix for user stylesheet bugs where they get parsed using the wrong... · 0880de1d
    hyatt@apple.com authored
    Fix for user stylesheet bugs where they get parsed using the wrong compatibility mode.  This was a regression
    caused from Safari 3 -> 4 by the Acid3 fixes to create a real DOCTYPE in the DOM.
    
    Reviewed by Darin Adler.
    
    This patch makes style selector creation lazy, so that the selector isn't built unless someone asks for it.
    
    In order to avoid creating the style selector before the compatibility mode has been determined, document
    style is now created without having a dependence on an instantiated style selector.  The creation of the style
    is now done as a static method on CSSStyleSelector called styleForDocument, and a couple of font-related
    functions have been made static as well so that they can be used by this method.
    
    m_styleSelector on Document is now an OwnPtr.
    
    Added userscripts/mixed-case-stylesheet.html
    
    * css/CSSStyleSelector.cpp:
    (WebCore::CSSStyleSelector::styleForDocument):
    (WebCore::CSSStyleSelector::applyProperty):
    (WebCore::CSSStyleSelector::checkForGenericFamilyChange):
    (WebCore::CSSStyleSelector::setFontSize):
    (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
    (WebCore::CSSStyleSelector::fontSizeForKeyword):
    * css/CSSStyleSelector.h:
    * dom/Document.cpp:
    (WebCore::Document::Document):
    (WebCore::Document::~Document):
    (WebCore::Document::recalcStyle):
    (WebCore::Document::createStyleSelector):
    (WebCore::Document::attach):
    (WebCore::Document::setVisuallyOrdered):
    (WebCore::Document::recalcStyleSelector):
    * dom/Document.h:
    (WebCore::Document::styleSelector):
    (WebCore::Document::visuallyOrdered):
    * html/HTMLDocument.cpp:
    (WebCore::HTMLDocument::determineParseMode):
    * loader/PlaceholderDocument.cpp:
    (WebCore::PlaceholderDocument::attach):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0880de1d