initial import
[vuplus_webkit] / Source / WebCore / css / StyleList.cpp
1 /*
2  * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
3  *               1999 Waldo Bastian (bastian@kde.org)
4  *               2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
5  *               2001-2003 Dirk Mueller (mueller@kde.org)
6  * Copyright (C) 2002, 2006, 2008 Apple Inc. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23
24 #include "config.h"
25 #include "StyleList.h"
26
27 #include <wtf/PassRefPtr.h>
28
29 namespace WebCore {
30
31 void StyleList::append(PassRefPtr<StyleBase> child)
32 {
33     StyleBase* c = child.get();
34     m_children.append(child);
35     c->insertedIntoParent();
36 }
37
38 void StyleList::insert(unsigned position, PassRefPtr<StyleBase> child)
39 {
40     StyleBase* c = child.get();
41     if (position >= length())
42         m_children.append(child);
43     else
44         m_children.insert(position, child);
45     c->insertedIntoParent();
46 }
47
48 void StyleList::remove(unsigned position)
49 {
50     if (position >= length())
51         return;
52     m_children.remove(position);
53 }
54
55 }