Changeset 30130 in webkit
- Timestamp:
- Feb 10, 2008 2:33:00 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r30127 r30130 1 2008-02-10 David Hyatt <hyatt@apple.com> 2 3 Fix for bug 17082, cssRules should be live. 4 5 Reviewed by olliej 6 7 Added fast/css/live-cssrules.html 8 9 * css/CSSRuleList.cpp: 10 (WebCore::CSSRuleList::CSSRuleList): 11 (WebCore::CSSRuleList::length): 12 (WebCore::CSSRuleList::item): 13 (WebCore::CSSRuleList::deleteRule): 14 (WebCore::CSSRuleList::insertRule): 15 * css/CSSRuleList.h: 16 1 17 2008-02-10 David Hyatt <hyatt@apple.com> 2 18 -
trunk/WebCore/css/CSSRuleList.cpp
r30122 r30130 38 38 : RefCounted<CSSRuleList>(0) 39 39 { 40 if (list) { 40 m_list = list; 41 if (list && omitCharsetRules) { 42 m_list = 0; 41 43 unsigned len = list->length(); 42 44 for (unsigned i = 0; i < len; ++i) { 43 45 StyleBase* style = list->item(i); 44 if (style->isRule() && ! (omitCharsetRules && style->isCharsetRule()))46 if (style->isRule() && !style->isCharsetRule()) 45 47 append(static_cast<CSSRule*>(style)); 46 48 } … … 55 57 } 56 58 59 unsigned CSSRuleList::length() const 60 { 61 return m_list ? m_list->length() : m_lstCSSRules.count(); 62 } 63 64 CSSRule* CSSRuleList::item(unsigned index) 65 { 66 if (m_list) { 67 StyleBase* rule = m_list->item(index); 68 ASSERT(!rule || rule->isRule()); 69 return static_cast<CSSRule*>(rule); 70 } 71 return m_lstCSSRules.at(index); 72 } 73 57 74 void CSSRuleList::deleteRule(unsigned index) 58 75 { 76 ASSERT(!m_list); 59 77 CSSRule* rule = m_lstCSSRules.take(index); 60 78 if (rule) … … 70 88 unsigned CSSRuleList::insertRule(CSSRule* rule, unsigned index) 71 89 { 90 ASSERT(!m_list); 72 91 if (rule && m_lstCSSRules.insert(index, rule)) { 73 92 rule->ref(); -
trunk/WebCore/css/CSSRuleList.h
r27776 r30130 27 27 #include "DeprecatedPtrList.h" 28 28 #include <wtf/RefCounted.h> 29 #include <wtf/RefPtr.h> 29 30 30 31 namespace WebCore { … … 39 40 ~CSSRuleList(); 40 41 41 unsigned length() const { return m_lstCSSRules.count(); }42 CSSRule* item(unsigned index) { return m_lstCSSRules.at(index); }42 unsigned length() const; 43 CSSRule* item(unsigned index); 43 44 44 /* not part of the DOM */ 45 // FIXME: Not part of the DOM. Only used by media rules. We should be able to remove them if we changed media rules to work 46 // as StyleLists instead. 45 47 unsigned insertRule(CSSRule*, unsigned index); 46 48 void deleteRule(unsigned index); … … 48 50 49 51 protected: 50 DeprecatedPtrList<CSSRule> m_lstCSSRules; 52 RefPtr<StyleList> m_list; 53 DeprecatedPtrList<CSSRule> m_lstCSSRules; // FIXME: Want to eliminate, but used by IE rules() extension and still used by media rules. 51 54 }; 52 55
Note: See TracChangeset
for help on using the changeset viewer.