Changeset 74642 in webkit


Ignore:
Timestamp:
Dec 24, 2010 10:55:35 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-12-24 Jan Erik Hanssen <jhanssen@sencha.com>

Reviewed by Eric Seidel.

Clean up CSSRuleData in CSSStyleSelector.h
https://bugs.webkit.org/show_bug.cgi?id=27753

Move CSSRuleData and CSSRuleDataList from CSSStyleSelector.h to the .cpp file.

  • css/CSSStyleSelector.cpp: (WebCore::CSSRuleData::CSSRuleData): (WebCore::CSSRuleData::~CSSRuleData): (WebCore::CSSRuleData::position): (WebCore::CSSRuleData::rule): (WebCore::CSSRuleData::selector): (WebCore::CSSRuleData::next): (WebCore::CSSRuleDataList::CSSRuleDataList): (WebCore::CSSRuleDataList::~CSSRuleDataList): (WebCore::CSSRuleDataList::first): (WebCore::CSSRuleDataList::last): (WebCore::CSSRuleDataList::append):
  • css/CSSStyleSelector.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74638 r74642  
     12010-12-24  Jan Erik Hanssen  <jhanssen@sencha.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Clean up CSSRuleData in CSSStyleSelector.h
     6        https://bugs.webkit.org/show_bug.cgi?id=27753
     7
     8        Move CSSRuleData and CSSRuleDataList from CSSStyleSelector.h to the .cpp file.
     9
     10        * css/CSSStyleSelector.cpp:
     11        (WebCore::CSSRuleData::CSSRuleData):
     12        (WebCore::CSSRuleData::~CSSRuleData):
     13        (WebCore::CSSRuleData::position):
     14        (WebCore::CSSRuleData::rule):
     15        (WebCore::CSSRuleData::selector):
     16        (WebCore::CSSRuleData::next):
     17        (WebCore::CSSRuleDataList::CSSRuleDataList):
     18        (WebCore::CSSRuleDataList::~CSSRuleDataList):
     19        (WebCore::CSSRuleDataList::first):
     20        (WebCore::CSSRuleDataList::last):
     21        (WebCore::CSSRuleDataList::append):
     22        * css/CSSStyleSelector.h:
     23
    1242010-12-24  Yury Semikhatsky  <yurys@chromium.org>
    225
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r74538 r74642  
    349349}
    350350
     351class CSSRuleData : public Noncopyable {
     352public:
     353    CSSRuleData(unsigned pos, CSSStyleRule* r, CSSSelector* sel, CSSRuleData* prev = 0)
     354        : m_position(pos)
     355        , m_rule(r)
     356        , m_selector(sel)
     357        , m_next(0)
     358    {
     359        if (prev)
     360            prev->m_next = this;
     361    }
     362
     363    ~CSSRuleData()
     364    {
     365    }
     366
     367    unsigned position() { return m_position; }
     368    CSSStyleRule* rule() { return m_rule; }
     369    CSSSelector* selector() { return m_selector; }
     370    CSSRuleData* next() { return m_next; }
     371
     372private:
     373    unsigned m_position;
     374    CSSStyleRule* m_rule;
     375    CSSSelector* m_selector;
     376    CSSRuleData* m_next;
     377};
     378
     379class CSSRuleDataList : public Noncopyable {
     380public:
     381    CSSRuleDataList(unsigned pos, CSSStyleRule* rule, CSSSelector* sel)
     382        : m_first(new CSSRuleData(pos, rule, sel))
     383        , m_last(m_first)
     384    {
     385    }
     386
     387    ~CSSRuleDataList()
     388    {
     389        CSSRuleData* ptr;
     390        CSSRuleData* next;
     391        ptr = m_first;
     392        while (ptr) {
     393            next = ptr->next();
     394            delete ptr;
     395            ptr = next;
     396        }
     397    }
     398
     399    CSSRuleData* first() { return m_first; }
     400    CSSRuleData* last() { return m_last; }
     401
     402    void append(unsigned pos, CSSStyleRule* rule, CSSSelector* sel) { m_last = new CSSRuleData(pos, rule, sel, m_last); }
     403
     404private:
     405    CSSRuleData* m_first;
     406    CSSRuleData* m_last;
     407};
     408
    351409class CSSRuleSet : public Noncopyable {
    352410public:
  • trunk/WebCore/css/CSSStyleSelector.h

    r72116 r74642  
    316316    };
    317317
    318     class CSSRuleData : public Noncopyable {
    319     public:
    320         CSSRuleData(unsigned pos, CSSStyleRule* r, CSSSelector* sel, CSSRuleData* prev = 0)
    321             : m_position(pos)
    322             , m_rule(r)
    323             , m_selector(sel)
    324             , m_next(0)
    325         {
    326             if (prev)
    327                 prev->m_next = this;
    328         }
    329 
    330         ~CSSRuleData()
    331         {
    332         }
    333 
    334         unsigned position() { return m_position; }
    335         CSSStyleRule* rule() { return m_rule; }
    336         CSSSelector* selector() { return m_selector; }
    337         CSSRuleData* next() { return m_next; }
    338 
    339     private:
    340         unsigned m_position;
    341         CSSStyleRule* m_rule;
    342         CSSSelector* m_selector;
    343         CSSRuleData* m_next;
    344     };
    345 
    346     class CSSRuleDataList : public Noncopyable {
    347     public:
    348         CSSRuleDataList(unsigned pos, CSSStyleRule* rule, CSSSelector* sel)
    349             : m_first(new CSSRuleData(pos, rule, sel))
    350             , m_last(m_first)
    351         {
    352         }
    353 
    354         ~CSSRuleDataList()
    355         {
    356             CSSRuleData* ptr;
    357             CSSRuleData* next;
    358             ptr = m_first;
    359             while (ptr) {
    360                 next = ptr->next();
    361                 delete ptr;
    362                 ptr = next;
    363             }
    364         }
    365 
    366         CSSRuleData* first() { return m_first; }
    367         CSSRuleData* last() { return m_last; }
    368 
    369         void append(unsigned pos, CSSStyleRule* rule, CSSSelector* sel) { m_last = new CSSRuleData(pos, rule, sel, m_last); }
    370 
    371     private:
    372         CSSRuleData* m_first;
    373         CSSRuleData* m_last;
    374     };
    375 
    376318} // namespace WebCore
    377319
Note: See TracChangeset for help on using the changeset viewer.