[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/khtml
From:       Germain Garand <germain () ebooksfrance ! com>
Date:       2005-03-18 16:51:57
Message-ID: 20050318165157.DEAEB17EA8 () office ! kde ! org
[Download RAW message or body]

CVS commit by ggarand: 

make disabling of CSSheets via DOM actually do something


  M +9 -0      ChangeLog   1.403
  M +8 -0      css/css_stylesheetimpl.cpp   1.46
  M +1 -2      css/css_stylesheetimpl.h   1.30
  M +1 -1      css/cssstyleselector.cpp   1.345


--- kdelibs/khtml/ChangeLog  #1.402:1.403
@@ -1,2 +1,11 @@
+2005-03-18  Germain Garand  <germain@ebooksfrance.org>
+
+        make disabling of CSSheets via DOM actually do something.
+
+        * css/css_stylesheetimpl.{cpp,h} (setDisabled): update style selector.
+
+        * css/cssstyleselector.cpp (CSSStyleSelector): do not append rules
+        from disabled sheets.
+
 2005-03-17  Leo Savernik  <l.savernik@aon.at>
 

--- kdelibs/khtml/css/cssstyleselector.cpp  #1.344:1.345
@@ -153,5 +153,5 @@ CSSStyleSelector::CSSStyleSelector( Docu
     QPtrListIterator<StyleSheetImpl> it( styleSheets->styleSheets );
     for ( ; it.current(); ++it ) {
-        if ( it.current()->isCSSStyleSheet() ) {
+        if ( it.current()->isCSSStyleSheet() && !it.current()->disabled()) {
             authorStyle->append( static_cast<CSSStyleSheetImpl*>( it.current() ), m_medium );
         }

--- kdelibs/khtml/css/css_stylesheetimpl.cpp  #1.45:1.46
@@ -95,4 +95,12 @@ void StyleSheetImpl::setMedia( MediaList
 }
 
+void StyleSheetImpl::setDisabled( bool disabled )
+{
+    bool updateStyle = isCSSStyleSheet() && m_parentNode && disabled != m_disabled;
+    m_disabled = disabled;
+    if (updateStyle)
+        m_parentNode->getDocument()->updateStyleSelector();
+}
+
 // -----------------------------------------------------------------------
 

--- kdelibs/khtml/css/css_stylesheetimpl.h  #1.29:1.30
@@ -62,6 +62,5 @@ public:
 
     bool disabled() const { return m_disabled; }
-    void setDisabled( bool disabled ) { m_disabled = disabled; }
-
+    void setDisabled( bool disabled );
     DOM::NodeImpl *ownerNode() const { return m_parentNode; }
     StyleSheetImpl *parentStyleSheet() const;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic