webengine/osswebengine/WebCore/css/cssstyleselector.cpp
changeset 13 10e98eab6f85
parent 0 dd21522fd290
child 68 92a765b5b3e7
equal deleted inserted replaced
8:7c90e6132015 13:10e98eab6f85
    20  * along with this library; see the file COPYING.LIB.  If not, write to
    20  * along with this library; see the file COPYING.LIB.  If not, write to
    21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    21  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    22  * Boston, MA 02110-1301, USA.
    22  * Boston, MA 02110-1301, USA.
    23  */
    23  */
    24 
    24 
    25 #include "config.h"
       
    26 #include "CSSStyleSelector.h"
    25 #include "CSSStyleSelector.h"
    27 
    26 
    28 #include "CSSBorderImageValue.h"
    27 #include "CSSBorderImageValue.h"
    29 #include "CSSCursorImageValue.h"
    28 #include "CSSCursorImageValue.h"
    30 #include "CSSImageValue.h"
    29 #include "CSSImageValue.h"
   222 CSSStyleSheet *CSSStyleSelector::svgSheet = 0;
   221 CSSStyleSheet *CSSStyleSelector::svgSheet = 0;
   223 #endif
   222 #endif
   224 
   223 
   225 static CSSStyleSelector::Encodedurl *currentEncodedURL = 0;
   224 static CSSStyleSelector::Encodedurl *currentEncodedURL = 0;
   226 static PseudoState pseudoState;
   225 static PseudoState pseudoState;
       
   226 
       
   227 struct defaultStyleNACleaner {
       
   228     ~defaultStyleNACleaner() {
       
   229         delete CSSStyleSelector::styleNotYetAvailable;
       
   230         CSSStyleSelector::styleNotYetAvailable = 0;
       
   231     }
       
   232 };
       
   233 struct defaultStyleNACleaner styleNACleaner;
   227 
   234 
   228 CSSStyleSelector::CSSStyleSelector(Document* doc, const String& userStyleSheet, StyleSheetList *styleSheets, bool _strictParsing)
   235 CSSStyleSelector::CSSStyleSelector(Document* doc, const String& userStyleSheet, StyleSheetList *styleSheets, bool _strictParsing)
   229 {
   236 {
   230     init();
   237     init();
   231     
   238     
  3624         int id = primitiveValue->getIdent();
  3631         int id = primitiveValue->getIdent();
  3625         EAppearance appearance;
  3632         EAppearance appearance;
  3626         if (id == CSS_VAL_NONE)
  3633         if (id == CSS_VAL_NONE)
  3627             appearance = NoAppearance;
  3634             appearance = NoAppearance;
  3628         else
  3635         else
       
  3636 #if PLATFORM ( SYMBIAN )
       
  3637         {
       
  3638         if (id == CSS_VAL_SEARCHFIELD)
       
  3639             id = CSS_VAL_TEXTFIELD;  
       
  3640 #endif
  3629             appearance = EAppearance(id - CSS_VAL_CHECKBOX + 1);
  3641             appearance = EAppearance(id - CSS_VAL_CHECKBOX + 1);
       
  3642 #if PLATFORM ( SYMBIAN )
       
  3643         }
       
  3644 #endif
  3630         style->setAppearance(appearance);
  3645         style->setAppearance(appearance);
  3631         return;
  3646         return;
  3632     }
  3647     }
  3633     case CSS_PROP__WEBKIT_BINDING: {
  3648     case CSS_PROP__WEBKIT_BINDING: {
  3634 #if ENABLE(XBL)
  3649 #if ENABLE(XBL)
  4988 bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname)
  5003 bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname)
  4989 {
  5004 {
  4990     return m_selectorAttrs.contains(attrname.impl());
  5005     return m_selectorAttrs.contains(attrname.impl());
  4991 }
  5006 }
  4992 
  5007 
       
  5008 #if PLATFORM(SYMBIAN)
       
  5009 void CSSStyleSelector::deleteDefaultStyle()
       
  5010 {
       
  5011     delete defaultStyle;
       
  5012     defaultStyle = 0;
       
  5013     delete defaultQuirksStyle;
       
  5014     defaultQuirksStyle = 0;
       
  5015     delete defaultPrintStyle;
       
  5016     defaultPrintStyle = 0;
       
  5017     delete defaultViewSourceStyle;
       
  5018     defaultViewSourceStyle = 0;
       
  5019 
       
  5020     defaultSheet->deref();
       
  5021 //    delete defaultSheet;
       
  5022 //    defaultSheet = 0;
       
  5023 
       
  5024     // styleNotYetAvailable->deref();
       
  5025     //goes to overridden delete operator but calls destructor
       
  5026     delete styleNotYetAvailable;
       
  5027     //release cell allocated because overridder delete does not do that.
       
  5028     free(styleNotYetAvailable);
       
  5029     styleNotYetAvailable = 0;
       
  5030 
       
  5031     quirksSheet->deref();
       
  5032     // delete quirksSheet;
       
  5033     // quirksSheet = 0;
       
  5034 
       
  5035     viewSourceSheet->deref();
       
  5036     // delete viewSourceSheet;
       
  5037     // viewSourceSheet = 0;
       
  5038 
       
  5039 #if ENABLE(SVG)
       
  5040     svgSheet->deref();
       
  5041     // delete svgSheet;
       
  5042     // svgSheet = 0;
       
  5043 #endif
       
  5044 
       
  5045     //*currentEncodedURL->deref(); //static CSSStyleSelector::Encodedurl *currentEncodedURL = 0;
       
  5046     pseudoState = PseudoUnknown;
       
  5047 }
       
  5048 #endif
       
  5049 
  4993 } // namespace WebCore
  5050 } // namespace WebCore