Skip to content

Commit acebb77

Browse files
committed
Add classes for hr element and node.
1 parent 63221cd commit acebb77

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

src/WebWhirr.pro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ SOURCES += main.cpp \
2727
painter/paintnode.cpp \
2828
painter/paintarea.cpp \
2929
elements/HTMLImgElement.cpp \
30-
nodes/imagenode.cpp
30+
nodes/imagenode.cpp \
31+
elements/HTMLHrElement.cpp \
32+
nodes/horizontalrulenode.cpp
3133

3234
HEADERS += \
3335
parser/htmlreader.h \
@@ -46,4 +48,6 @@ HEADERS += \
4648
painter/paintnode.h \
4749
painter/paintarea.h \
4850
elements/HTMLImgElement.h \
49-
nodes/imagenode.h
51+
nodes/imagenode.h \
52+
elements/HTMLHrElement.h \
53+
nodes/horizontalrulenode.h

src/elements/HTMLHrElement.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "HTMLHrElement.h"
2+
3+
HTMLHrElement::HTMLHrElement()
4+
{
5+
}
6+
7+
HorizontalRuleNode* HTMLHrElement::returnNode()
8+
{
9+
hrNode = new HorizontalRuleNode;
10+
11+
return hrNode;
12+
}

src/elements/HTMLHrElement.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef HTMLHRELEMENT_H
2+
#define HTMLHRELEMENT_H
3+
4+
#include "HTMLElement.h"
5+
#include "nodes/horizontalrulenode.h"
6+
7+
class HTMLHrElement : public HTMLElement
8+
{
9+
public:
10+
HTMLHrElement();
11+
virtual HorizontalRuleNode* returnNode();
12+
13+
private:
14+
HorizontalRuleNode *hrNode;
15+
};
16+
17+
#endif // HTMLHRELEMENT_H

src/nodes/horizontalrulenode.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "horizontalrulenode.h"
2+
3+
HorizontalRuleNode::HorizontalRuleNode()
4+
{
5+
setNeedsPainting(true);
6+
setTypeOfRenderNode("hr");
7+
}

src/nodes/horizontalrulenode.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef HORIZONTALRULENODE_H
2+
#define HORIZONTALRULENODE_H
3+
4+
#include "rendernode.h"
5+
6+
class HorizontalRuleNode : public RenderNode
7+
{
8+
public:
9+
HorizontalRuleNode();
10+
};
11+
12+
#endif // HORIZONTALRULENODE_H

0 commit comments

Comments
 (0)