📄 html_listimpl.cpp
字号:
/** * This file is part of the DOM implementation for KDE. * * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * $Id: html_listimpl.cpp,v 1.1.1.1 2002/01/16 10:39:55 ymwei Exp $ */#include "render_interface.h"#include "mghtml_part.h"#include "html_listimpl.h"using namespace DOM;#include "cssproperties.h"#include "render_list.h"#include "htmlhashes.h"using namespace khtml;const DOMString HTMLUListElementImpl::nodeName() const{ return "UL";}ushort HTMLUListElementImpl::id() const{ return ID_UL;}void HTMLUListElementImpl::parseAttribute(AttrImpl *attr){ switch(attr->attrId) { case ATTR_TYPE: addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, attr->value(), false); break; default: HTMLElementImpl::parseAttribute(attr); }}void HTMLUListElementImpl::attach(MGHTMLView *w){//fprintf(stderr,"HTMLUListElementImpl %p\n",this); HTMLElementImpl::attach(w); style()->setFlowAroundFloats(true);}// -------------------------------------------------------------------------const DOMString HTMLDirectoryElementImpl::nodeName() const{ return "DIR";}ushort HTMLDirectoryElementImpl::id() const{ return ID_DIR;}void HTMLDirectoryElementImpl::attach(MGHTMLView *w){ HTMLElementImpl::attach(w); style()->setFlowAroundFloats(true);}// -------------------------------------------------------------------------const DOMString HTMLMenuElementImpl::nodeName() const{ return "MENU";}ushort HTMLMenuElementImpl::id() const{ return ID_MENU;}void HTMLMenuElementImpl::attach(MGHTMLView *w){ HTMLElementImpl::attach(w); style()->setFlowAroundFloats(true);}// -------------------------------------------------------------------------const DOMString HTMLOListElementImpl::nodeName() const{ return "OL";}ushort HTMLOListElementImpl::id() const{ return ID_OL;}void HTMLOListElementImpl::parseAttribute(AttrImpl *attr){ switch(attr->attrId) { case ATTR_TYPE: if ( strcmp( attr->value(), "a" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "lower-alpha", false); else if ( strcmp( attr->value(), "A" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "upper-alpha", false); else if ( strcmp( attr->value(), "i" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "lower-roman", false); else if ( strcmp( attr->value(), "I" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "upper-roman", false); else if ( strcmp( attr->value(), "1" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "decimal", false); break; case ATTR_START: // ### default: HTMLUListElementImpl::parseAttribute(attr); }}void HTMLOListElementImpl::attach(MGHTMLView *w){ HTMLElementImpl::attach(w); style()->setFlowAroundFloats(true);}// -------------------------------------------------------------------------const DOMString HTMLLIElementImpl::nodeName() const{ return "LI";}ushort HTMLLIElementImpl::id() const{ return ID_LI;}void HTMLLIElementImpl::parseAttribute(AttrImpl *attr){ switch(attr->attrId) { case ATTR_VALUE: if(m_render && m_render->isListItem()) { RenderListItem *list = static_cast<RenderListItem *>(m_render); // ### work out what to do when attribute removed - use default of some sort? long v = attr->val() ? attr->val()->toInt() : 0; list->setValue(v); } break; case ATTR_TYPE: if ( strcmp( attr->value(), "a" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "lower-alpha", false); else if ( strcmp( attr->value(), "A" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "upper-alpha", false); else if ( strcmp( attr->value(), "i" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "lower-roman", false); else if ( strcmp( attr->value(), "I" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "upper-roman", false); else if ( strcmp( attr->value(), "1" ) == 0 ) addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, "decimal", false); else addCSSProperty(CSS_PROP_LIST_STYLE_TYPE, attr->value(), false); break; default: HTMLElementImpl::parseAttribute(attr); }}// -------------------------------------------------------------------------const DOMString HTMLDListElementImpl::nodeName() const{ return "DL";}ushort HTMLDListElementImpl::id() const{ return ID_DL;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -