Dillo v3.1.1-111-gd4f56d0d
|
This class provides the glue between HTML parser and CSS subsystem. More...
#include <styleengine.hh>
Classes | |
struct | Node |
Public Member Functions | |
StyleEngine (dw::core::Layout *layout, const DilloUrl *pageUrl, const DilloUrl *baseUrl, float zoom) | |
~StyleEngine () | |
void | parse (DilloHtml *html, DilloUrl *url, const char *buf, int buflen, CssOrigin origin) |
void | startElement (int tag, BrowserWindow *bw) |
tell the styleEngine that a new html element has started. | |
void | startElement (const char *tagname, BrowserWindow *bw) |
void | setId (const char *id) |
const char * | getId () |
void | setClass (const char *klass) |
void | setStyle (const char *style) |
void | endElement (int tag) |
tell the styleEngine that a html element has ended. | |
void | setPseudoLink () |
set the CSS pseudo class :link. | |
void | setPseudoVisited () |
set the CSS pseudo class :visited. | |
void | setNonCssHint (CssPropertyName name, CssValueType type, int value) |
void | setNonCssHint (CssPropertyName name, CssValueType type, const char *value) |
void | setNonCssHint (CssPropertyName name, CssValueType type, CssLength value) |
void | inheritNonCssHints () |
Instruct StyleEngine to use the nonCssHints from parent element This is only used for tables where nonCssHints on the TABLE-element (e.g. | |
void | clearNonCssHints () |
void | restyle (BrowserWindow *bw) |
Recompute all style information from scratch This is used to take into account CSS styles for the HTML-element. | |
void | inheritBackgroundColor () |
Use of the background color of the parent style as default. | |
dw::core::style::Style * | backgroundStyle (BrowserWindow *bw) |
Similar to StyleEngine::style(), but with backgroundColor set. | |
dw::core::style::Color * | backgroundColor () |
dw::core::style::StyleImage * | backgroundImage (dw::core::style::BackgroundRepeat *bgRepeat, dw::core::style::BackgroundAttachment *bgAttachment, dw::core::style::Length *bgPositionX, dw::core::style::Length *bgPositionY) |
dw::core::style::Style * | style (BrowserWindow *bw) |
dw::core::style::Style * | wordStyle (BrowserWindow *bw) |
Static Public Member Functions | |
static void | init () |
Create the user agent style. | |
Private Member Functions | |
void | stackPush () |
void | stackPop () |
void | buildUserStyle () |
dw::core::style::Style * | style0 (int i, BrowserWindow *bw) |
Create a new style object based on the previously opened / closed HTML elements and the nonCssProperties that have been set. | |
dw::core::style::Style * | wordStyle0 (BrowserWindow *bw) |
void | setNonCssHint (CssPropertyName name, CssValueType type, CssPropertyValue value) |
void | preprocessAttrs (dw::core::style::StyleAttrs *attrs) |
void | postprocessAttrs (dw::core::style::StyleAttrs *attrs) |
void | apply (int i, dw::core::style::StyleAttrs *attrs, CssPropertyList *props, BrowserWindow *bw) |
Make changes to StyleAttrs attrs according to CssPropertyList props. | |
bool | computeValue (int *dest, CssLength value, dw::core::style::Font *font) |
Resolve relative lengths to absolute values. | |
bool | computeValue (int *dest, CssLength value, dw::core::style::Font *font, int percentageBase) |
bool | computeLength (dw::core::style::Length *dest, CssLength value, dw::core::style::Font *font) |
void | computeBorderWidth (int *dest, CssProperty *p, dw::core::style::Font *font) |
Private Attributes | |
dw::core::Layout * | layout |
lout::misc::SimpleVector< Node > * | stack |
CssContext * | cssContext |
Doctree * | doctree |
int | importDepth |
float | dpmm |
float | zoom |
DilloUrl * | pageUrl |
DilloUrl * | baseUrl |
This class provides the glue between HTML parser and CSS subsystem.
It maintains a document tree and creates and caches style objects for use by the HTML parser. The HTML parser in turn informs StyleEngine about opened or closed HTML elements and their attributes via the startElement() / endElement() methods.
Definition at line 32 of file styleengine.hh.
StyleEngine::StyleEngine | ( | dw::core::Layout * | layout, |
const DilloUrl * | pageUrl, | ||
const DilloUrl * | baseUrl, | ||
float | zoom | ||
) |
Definition at line 62 of file styleengine.cc.
References a_Url_dup(), dw::core::style::StyleAttrs::backgroundColor, baseUrl, DilloPrefs::bg_color, buildUserStyle(), dw::core::style::StyleAttrs::color, dw::core::style::Font::create(), dw::core::style::Color::create(), dw::core::style::Style::create(), cssContext, doctree, dw::core::Layout::dpiX(), dpmm, dw::core::style::StyleAttrs::font, DilloPrefs::font_factor, DilloPrefs::font_max_size, DilloPrefs::font_min_size, DilloPrefs::font_sans_serif, dw::core::style::FONT_STYLE_NORMAL, dw::core::style::FONT_VARIANT_NORMAL, dw::core::style::FontAttrs::fontVariant, importDepth, dw::core::style::StyleAttrs::initValues(), layout, dw::core::style::FontAttrs::letterSpacing, dw::core::style::FontAttrs::name, pageUrl, prefs, lout::misc::roundInt(), dw::core::style::FontAttrs::size, stack, stackPush(), dw::core::style::FontAttrs::style, StyleEngine::Node::style, dw::core::style::FontAttrs::weight, and zoom.
StyleEngine::~StyleEngine | ( | ) |
Definition at line 102 of file styleengine.cc.
References a_Url_free(), baseUrl, cssContext, doctree, DoctreeNode::element, endElement(), pageUrl, stack, stackPop(), and Doctree::top().
|
private |
Make changes to StyleAttrs attrs according to CssPropertyList props.
Definition at line 364 of file styleengine.cc.
References a_Bw_add_client(), a_Bw_add_url(), a_Capi_open_url(), a_Image_new(), a_Image_ref(), a_Url_free(), a_Url_new(), a_Web_new(), DilloPrefs::allow_white_bg, dw::core::style::StyleAttrs::backgroundAttachment, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleAttrs::backgroundPositionX, dw::core::style::StyleAttrs::backgroundPositionY, dw::core::style::StyleAttrs::backgroundRepeat, dw::core::style::StyleAttrs::borderCollapse, dw::core::style::StyleAttrs::borderColor, dw::core::style::StyleAttrs::borderStyle, dw::core::style::StyleAttrs::borderWidth, dw::core::style::Box::bottom, dw::core::style::StyleAttrs::bottom, dw::core::style::StyleAttrs::clear, dw::core::style::StyleAttrs::color, computeBorderWidth(), computeLength(), computeValue(), lout::signal::ObservedObject::connectDeletion(), dw::core::style::StyleImage::create(), dw::core::style::Tooltip::create(), dw::core::style::Font::create(), dw::core::style::Color::create(), dw::core::style::createAbsLength(), dw::core::style::createPerLength(), CSS_FONT_SIZE_LARGE, CSS_FONT_SIZE_LARGER, CSS_FONT_SIZE_MEDIUM, CSS_FONT_SIZE_SMALL, CSS_FONT_SIZE_SMALLER, CSS_FONT_SIZE_X_LARGE, CSS_FONT_SIZE_X_SMALL, CSS_FONT_SIZE_XX_LARGE, CSS_FONT_SIZE_XX_SMALL, CSS_FONT_WEIGHT_BOLD, CSS_FONT_WEIGHT_BOLDER, CSS_FONT_WEIGHT_LIGHT, CSS_FONT_WEIGHT_LIGHTER, CSS_FONT_WEIGHT_NORMAL, CSS_LENGTH_TYPE(), CSS_LENGTH_TYPE_AUTO, CSS_LENGTH_TYPE_NONE, CSS_LENGTH_VALUE(), CSS_LETTER_SPACING_NORMAL, CSS_PROPERTY_BACKGROUND_ATTACHMENT, CSS_PROPERTY_BACKGROUND_COLOR, CSS_PROPERTY_BACKGROUND_IMAGE, CSS_PROPERTY_BACKGROUND_POSITION, CSS_PROPERTY_BACKGROUND_REPEAT, CSS_PROPERTY_BORDER_BOTTOM_COLOR, CSS_PROPERTY_BORDER_BOTTOM_STYLE, CSS_PROPERTY_BORDER_BOTTOM_WIDTH, CSS_PROPERTY_BORDER_COLLAPSE, CSS_PROPERTY_BORDER_LEFT_COLOR, CSS_PROPERTY_BORDER_LEFT_STYLE, CSS_PROPERTY_BORDER_LEFT_WIDTH, CSS_PROPERTY_BORDER_RIGHT_COLOR, CSS_PROPERTY_BORDER_RIGHT_STYLE, CSS_PROPERTY_BORDER_RIGHT_WIDTH, CSS_PROPERTY_BORDER_SPACING, CSS_PROPERTY_BORDER_TOP_COLOR, CSS_PROPERTY_BORDER_TOP_STYLE, CSS_PROPERTY_BORDER_TOP_WIDTH, CSS_PROPERTY_BOTTOM, CSS_PROPERTY_CLEAR, CSS_PROPERTY_COLOR, CSS_PROPERTY_CURSOR, CSS_PROPERTY_DISPLAY, CSS_PROPERTY_FLOAT, CSS_PROPERTY_FONT_FAMILY, CSS_PROPERTY_FONT_SIZE, CSS_PROPERTY_FONT_STYLE, CSS_PROPERTY_FONT_VARIANT, CSS_PROPERTY_FONT_WEIGHT, CSS_PROPERTY_HEIGHT, CSS_PROPERTY_LEFT, CSS_PROPERTY_LETTER_SPACING, CSS_PROPERTY_LINE_HEIGHT, CSS_PROPERTY_LIST_STYLE_POSITION, CSS_PROPERTY_LIST_STYLE_TYPE, CSS_PROPERTY_MARGIN_BOTTOM, CSS_PROPERTY_MARGIN_LEFT, CSS_PROPERTY_MARGIN_RIGHT, CSS_PROPERTY_MARGIN_TOP, CSS_PROPERTY_MAX_HEIGHT, CSS_PROPERTY_MAX_WIDTH, CSS_PROPERTY_MIN_HEIGHT, CSS_PROPERTY_MIN_WIDTH, CSS_PROPERTY_OVERFLOW, CSS_PROPERTY_PADDING_BOTTOM, CSS_PROPERTY_PADDING_LEFT, CSS_PROPERTY_PADDING_RIGHT, CSS_PROPERTY_PADDING_TOP, CSS_PROPERTY_POSITION, CSS_PROPERTY_RIGHT, CSS_PROPERTY_TEXT_ALIGN, CSS_PROPERTY_TEXT_DECORATION, CSS_PROPERTY_TEXT_INDENT, CSS_PROPERTY_TEXT_TRANSFORM, CSS_PROPERTY_TOP, CSS_PROPERTY_VERTICAL_ALIGN, CSS_PROPERTY_WHITE_SPACE, CSS_PROPERTY_WIDTH, CSS_PROPERTY_WORD_SPACING, CSS_PROPERTY_Z_INDEX, CSS_TYPE_ENUM, CSS_TYPE_LENGTH_PERCENTAGE_NUMBER, CSS_WORD_SPACING_NORMAL, dw::core::style::StyleAttrs::cursor, D_ASCII_TOLOWER, dw::core::style::StyleAttrs::display, dw::core::style::DISPLAY_NONE, dStrAsciiCasecmp(), dStrstrip(), dw::core::style::Font::exists(), _DilloWeb::flags, dw::core::style::StyleAttrs::font, DilloPrefs::font_cursive, DilloPrefs::font_factor, DilloPrefs::font_fantasy, DilloPrefs::font_max_size, DilloPrefs::font_min_size, DilloPrefs::font_monospace, DilloPrefs::font_sans_serif, DilloPrefs::font_serif, dw::core::style::FontAttrs::fontVariant, dw::core::style::StyleImage::getMainImgRenderer(), lout::misc::SimpleVector< T >::getRef(), dw::core::style::StyleAttrs::hBorderSpacing, dw::core::style::StyleAttrs::height, _DilloWeb::Image, image, CssPropertyValue::intVal, layout, dw::core::style::Box::left, dw::core::style::StyleAttrs::left, dw::core::style::LENGTH_AUTO, CssPropertyValue::lenVal, dw::core::style::FontAttrs::letterSpacing, dw::core::style::StyleAttrs::lineHeight, dw::core::style::StyleAttrs::listStylePosition, dw::core::style::StyleAttrs::listStyleType, DilloPrefs::load_background_images, dw::core::style::StyleAttrs::margin, dw::core::style::StyleAttrs::maxHeight, dw::core::style::StyleAttrs::maxWidth, dw::core::style::StyleAttrs::minHeight, dw::core::style::StyleAttrs::minWidth, dw::core::style::FontAttrs::name, CssProperty::name, dw::core::style::StyleAttrs::overflow, dw::core::style::StyleAttrs::padding, pageUrl, dw::core::style::StyleAttrs::position, CssPropertyValue::posVal, CssBackgroundPosition::posX, CssBackgroundPosition::posY, prefs, PROPERTY_X_IMG, PROPERTY_X_LANG, PROPERTY_X_LINK, PROPERTY_X_TOOLTIP, dw::core::style::Box::right, dw::core::style::StyleAttrs::right, lout::misc::roundInt(), dw::core::style::FontAttrs::size, lout::misc::SimpleVector< T >::size(), stack, CssPropertyValue::strVal, dw::core::style::FontAttrs::style, dw::core::style::StyleAttrs::textAlign, dw::core::style::StyleAttrs::textDecoration, dw::core::style::StyleAttrs::textIndent, dw::core::style::StyleAttrs::textTransform, dw::core::style::Box::top, dw::core::style::StyleAttrs::top, CssProperty::type, URL_FLAGS, URL_SpamSafe, dw::core::style::StyleAttrs::valign, CssProperty::value, dw::core::style::StyleAttrs::vBorderSpacing, dw::core::style::StyleAttrs::vloat, WEB_Image, dw::core::style::FontAttrs::weight, DilloPrefs::white_bg_replacement, dw::core::style::StyleAttrs::whiteSpace, dw::core::style::StyleAttrs::width, dw::core::style::StyleAttrs::wordSpacing, dw::core::style::StyleAttrs::x_img, dw::core::style::StyleAttrs::x_lang, dw::core::style::StyleAttrs::x_link, dw::core::style::StyleAttrs::x_tooltip, dw::core::style::Z_INDEX_AUTO, dw::core::style::StyleAttrs::zIndex, and zoom.
Referenced by style0().
dw::core::style::Color * StyleEngine::backgroundColor | ( | ) |
Definition at line 249 of file styleengine.cc.
References dw::core::style::StyleAttrs::backgroundColor, stack, and StyleEngine::Node::style.
Referenced by Html_tag_open_body().
dw::core::style::StyleImage * StyleEngine::backgroundImage | ( | dw::core::style::BackgroundRepeat * | bgRepeat, |
dw::core::style::BackgroundAttachment * | bgAttachment, | ||
dw::core::style::Length * | bgPositionX, | ||
dw::core::style::Length * | bgPositionY | ||
) |
Definition at line 260 of file styleengine.cc.
References dw::core::style::StyleAttrs::backgroundAttachment, dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleAttrs::backgroundPositionX, dw::core::style::StyleAttrs::backgroundPositionY, dw::core::style::StyleAttrs::backgroundRepeat, stack, and StyleEngine::Node::style.
Referenced by Html_tag_open_body().
Style * StyleEngine::backgroundStyle | ( | BrowserWindow * | bw | ) |
Similar to StyleEngine::style(), but with backgroundColor set.
A normal style might have backgroundColor == NULL to indicate a transparent background. This method ensures that backgroundColor is set.
Definition at line 900 of file styleengine.cc.
References dw::core::style::StyleAttrs::backgroundColor, dw::core::style::Style::create(), stack, and style().
Referenced by DilloHtml::backgroundStyle().
|
private |
Definition at line 1081 of file styleengine.cc.
References a_Misc_file2dstr(), CSS_ORIGIN_USER, cssContext, dFree(), dGethomedir(), dStr_free(), dStrconcat(), CssParser::parse(), and style().
Referenced by StyleEngine().
void StyleEngine::clearNonCssHints | ( | ) |
Definition at line 232 of file styleengine.cc.
References StyleEngine::Node::nonCssProperties, and stack.
Referenced by Html_tag_open_table().
|
private |
Definition at line 874 of file styleengine.cc.
References computeValue(), CSS_BORDER_WIDTH_MEDIUM, CSS_BORDER_WIDTH_THICK, CSS_BORDER_WIDTH_THIN, CSS_TYPE_ENUM, CssPropertyValue::intVal, CssPropertyValue::lenVal, CssProperty::type, and CssProperty::value.
Referenced by apply().
|
private |
Definition at line 856 of file styleengine.cc.
References computeValue(), dw::core::style::createAbsLength(), dw::core::style::createPerLength(), CSS_LENGTH_TYPE(), CSS_LENGTH_TYPE_AUTO, CSS_LENGTH_TYPE_PERCENTAGE, CSS_LENGTH_VALUE(), and dw::core::style::LENGTH_AUTO.
Referenced by apply().
|
private |
Resolve relative lengths to absolute values.
Definition at line 791 of file styleengine.cc.
References CSS_LENGTH_TYPE(), CSS_LENGTH_TYPE_CH, CSS_LENGTH_TYPE_EM, CSS_LENGTH_TYPE_EX, CSS_LENGTH_TYPE_MM, CSS_LENGTH_TYPE_NONE, CSS_LENGTH_TYPE_PX, CSS_LENGTH_TYPE_REM, CSS_LENGTH_TYPE_VH, CSS_LENGTH_TYPE_VMAX, CSS_LENGTH_TYPE_VMIN, CSS_LENGTH_TYPE_VW, CSS_LENGTH_VALUE(), dpmm, dw::core::style::StyleAttrs::font, dw::core::Layout::getHeightViewport(), dw::core::Layout::getWidthViewport(), layout, MAX, MIN, lout::misc::roundInt(), dw::core::style::FontAttrs::size, stack, dw::core::style::Font::xHeight, dw::core::style::Font::zeroWidth, and zoom.
Referenced by apply(), computeBorderWidth(), computeLength(), and computeValue().
|
private |
Definition at line 847 of file styleengine.cc.
References computeValue(), CSS_LENGTH_TYPE(), CSS_LENGTH_TYPE_PERCENTAGE, CSS_LENGTH_VALUE(), and lout::misc::roundInt().
void StyleEngine::endElement | ( | int | tag | ) |
tell the styleEngine that a html element has ended.
Definition at line 299 of file styleengine.cc.
References doctree, DoctreeNode::element, Doctree::pop(), stackPop(), and Doctree::top().
Referenced by Html_real_pop_tag(), Html_tag_open_body(), and ~StyleEngine().
|
inline |
Definition at line 93 of file styleengine.hh.
References doctree, DoctreeNode::id, and Doctree::top().
Referenced by Html_process_tag(), and Html_tag_open_a().
void StyleEngine::inheritBackgroundColor | ( | ) |
Use of the background color of the parent style as default.
This is only used in table code to allow for colors specified for table rows as table rows are currently no widgets and therefore don't draw any background.
Definition at line 245 of file styleengine.cc.
References lout::misc::SimpleVector< T >::getRef(), and stack.
Referenced by Html_tag_open_a(), Html_tag_open_abbr(), Html_tag_open_default(), Html_tag_open_dir(), Html_tag_open_dl(), Html_tag_open_dt(), Html_tag_open_pre(), Html_tag_open_q(), Html_tag_open_span(), and Html_tag_open_tr().
void StyleEngine::inheritNonCssHints | ( | ) |
Instruct StyleEngine to use the nonCssHints from parent element This is only used for tables where nonCssHints on the TABLE-element (e.g.
border=1) also affect child elements like TD.
Definition at line 216 of file styleengine.cc.
References CssPropertyList::apply(), StyleEngine::Node::nonCssProperties, and stack.
Referenced by Html_tag_open_table_cell(), and Html_tag_open_tr().
|
static |
Create the user agent style.
The user agent style defines how dillo renders HTML in the absence of author or user styles.
Definition at line 1020 of file styleengine.cc.
References CSS_ORIGIN_USER_AGENT, and CssParser::parse().
Referenced by main().
void StyleEngine::parse | ( | DilloHtml * | html, |
DilloUrl * | url, | ||
const char * | buf, | ||
int | buflen, | ||
CssOrigin | origin | ||
) |
Definition at line 1002 of file styleengine.cc.
References cssContext, importDepth, MSG_WARN, and CssParser::parse().
Referenced by a_Html_load_stylesheet(), and Html_tag_close_style().
|
private |
Definition at line 335 of file styleengine.cc.
References dw::core::style::BORDER_HIDDEN, dw::core::style::BORDER_NONE, dw::core::style::StyleAttrs::borderColor, dw::core::style::StyleAttrs::borderStyle, dw::core::style::StyleAttrs::borderWidth, dw::core::style::Box::bottom, dw::core::style::StyleAttrs::bottom, dw::core::style::StyleAttrs::color, dw::core::style::Box::left, dw::core::style::StyleAttrs::left, dw::core::style::Box::right, dw::core::style::StyleAttrs::right, dw::core::style::Box::top, and dw::core::style::StyleAttrs::top.
Referenced by style0().
|
private |
Definition at line 306 of file styleengine.cc.
References dw::core::style::StyleAttrs::backgroundAttachment, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleAttrs::backgroundPositionX, dw::core::style::StyleAttrs::backgroundPositionY, dw::core::style::StyleAttrs::backgroundRepeat, dw::core::style::StyleAttrs::borderColor, dw::core::style::StyleAttrs::borderWidth, dw::core::style::Box::bottom, dw::core::style::StyleAttrs::bottom, dw::core::style::Box::left, dw::core::style::StyleAttrs::left, dw::core::style::Box::right, dw::core::style::StyleAttrs::right, stack, dw::core::style::Box::top, dw::core::style::StyleAttrs::top, and dw::core::style::StyleAttrs::valign.
Referenced by style0().
void StyleEngine::restyle | ( | BrowserWindow * | bw | ) |
Recompute all style information from scratch This is used to take into account CSS styles for the HTML-element.
The CSS data is only completely available after parsing the HEAD-section and thereby after the HTML-element has been opened. Note that restyle() does not change any styles in the widget tree.
Definition at line 982 of file styleengine.cc.
References StyleEngine::Node::backgroundStyle, stack, StyleEngine::Node::style, style0(), dw::core::style::Style::unref(), and StyleEngine::Node::wordStyle.
Referenced by DilloHtml::restyle().
void StyleEngine::setClass | ( | const char * | klass | ) |
Definition at line 191 of file styleengine.cc.
References doctree, DoctreeNode::klass, splitStr(), and Doctree::top().
Referenced by Html_parse_common_attrs().
void StyleEngine::setId | ( | const char * | id | ) |
Definition at line 160 of file styleengine.cc.
References doctree, dStrdup(), DoctreeNode::id, and Doctree::top().
Referenced by Html_parse_common_attrs().
|
inline |
Definition at line 105 of file styleengine.hh.
References dStrdup(), setNonCssHint(), and CssPropertyValue::strVal.
|
inline |
Definition at line 111 of file styleengine.hh.
References CssPropertyValue::lenVal, and setNonCssHint().
|
inlineprivate |
Definition at line 60 of file styleengine.hh.
References StyleEngine::Node::nonCssProperties, CssPropertyList::set(), and stack.
Referenced by a_Html_common_image_attrs(), a_Html_tag_set_align_attr(), a_Html_tag_set_valign_attr(), Html_parse_common_attrs(), Html_tag_open_a(), Html_tag_open_abbr(), Html_tag_open_audio(), Html_tag_open_body(), Html_tag_open_button(), Html_tag_open_embed(), Html_tag_open_font(), Html_tag_open_frame(), Html_tag_open_hr(), Html_tag_open_img(), Html_tag_open_input(), Html_tag_open_object(), Html_tag_open_ol(), Html_tag_open_sectioning(), Html_tag_open_select(), Html_tag_open_source(), Html_tag_open_span(), Html_tag_open_table(), Html_tag_open_table_cell(), Html_tag_open_tr(), Html_tag_open_ul(), Html_tag_open_video(), setNonCssHint(), setNonCssHint(), and setNonCssHint().
|
inline |
Definition at line 99 of file styleengine.hh.
References CssPropertyValue::intVal, and setNonCssHint().
void StyleEngine::setPseudoLink | ( | ) |
set the CSS pseudo class :link.
Definition at line 283 of file styleengine.cc.
References doctree, DoctreeNode::pseudo, and Doctree::top().
Referenced by Html_input_image(), Html_tag_open_a(), Html_tag_open_audio(), Html_tag_open_embed(), Html_tag_open_frame(), Html_tag_open_object(), Html_tag_open_source(), and Html_tag_open_video().
void StyleEngine::setPseudoVisited | ( | ) |
set the CSS pseudo class :visited.
Definition at line 291 of file styleengine.cc.
References doctree, DoctreeNode::pseudo, and Doctree::top().
Referenced by Html_tag_open_a(), Html_tag_open_audio(), Html_tag_open_body(), Html_tag_open_embed(), Html_tag_open_frame(), Html_tag_open_object(), Html_tag_open_source(), and Html_tag_open_video().
void StyleEngine::setStyle | ( | const char * | style | ) |
Definition at line 197 of file styleengine.cc.
References baseUrl, DilloPrefs::parse_embedded_css, CssParser::parseDeclarationBlock(), prefs, stack, StyleEngine::Node::styleAttrProperties, and StyleEngine::Node::styleAttrPropertiesImportant.
Referenced by Html_parse_common_attrs().
|
private |
Definition at line 125 of file styleengine.cc.
References StyleEngine::Node::backgroundStyle, StyleEngine::Node::nonCssProperties, stack, StyleEngine::Node::style, StyleEngine::Node::styleAttrProperties, StyleEngine::Node::styleAttrPropertiesImportant, dw::core::style::Style::unref(), and StyleEngine::Node::wordStyle.
Referenced by endElement(), and ~StyleEngine().
|
private |
Definition at line 117 of file styleengine.cc.
References stack.
Referenced by startElement(), and StyleEngine().
void StyleEngine::startElement | ( | const char * | tagname, |
BrowserWindow * | bw | ||
) |
Definition at line 156 of file styleengine.cc.
References a_Html_tag_index(), and startElement().
void StyleEngine::startElement | ( | int | tag, |
BrowserWindow * | bw | ||
) |
tell the styleEngine that a new html element has started.
Definition at line 143 of file styleengine.cc.
References StyleEngine::Node::displayNone, doctree, StyleEngine::Node::doctreeNode, DoctreeNode::element, Doctree::push(), stack, stackPush(), and style().
Referenced by a_Web_dispatch_by_type(), DilloHtml::startElement(), startElement(), and DilloHtml::startElement().
|
inline |
Definition at line 129 of file styleengine.hh.
References stack, and style0().
Referenced by a_Web_dispatch_by_type(), backgroundStyle(), buildUserStyle(), startElement(), DilloHtml::style(), and wordStyle0().
|
private |
Create a new style object based on the previously opened / closed HTML elements and the nonCssProperties that have been set.
This method is private. Call style() to get a current style object.
Definition at line 919 of file styleengine.cc.
References CssContext::apply(), apply(), dw::core::style::Style::create(), cssContext, doctree, lout::misc::SimpleVector< T >::getRef(), postprocessAttrs(), preprocessAttrs(), dw::core::style::StyleAttrs::resetValues(), and stack.
|
inline |
Definition at line 137 of file styleengine.hh.
References stack, and wordStyle0().
Referenced by DilloHtml::wordStyle().
|
private |
Definition at line 956 of file styleengine.cc.
References dw::core::style::StyleAttrs::backgroundAttachment, dw::core::style::StyleAttrs::backgroundColor, dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleAttrs::backgroundPositionX, dw::core::style::StyleAttrs::backgroundPositionY, dw::core::style::StyleAttrs::backgroundRepeat, dw::core::style::Style::create(), dw::core::style::StyleAttrs::resetValues(), stack, style(), and dw::core::style::StyleAttrs::valign.
Referenced by wordStyle().
|
private |
Definition at line 53 of file styleengine.hh.
Referenced by setStyle(), StyleEngine(), and ~StyleEngine().
|
private |
Definition at line 48 of file styleengine.hh.
Referenced by buildUserStyle(), parse(), style0(), StyleEngine(), and ~StyleEngine().
|
private |
Definition at line 49 of file styleengine.hh.
Referenced by endElement(), getId(), setClass(), setId(), setPseudoLink(), setPseudoVisited(), startElement(), style0(), StyleEngine(), and ~StyleEngine().
|
private |
Definition at line 51 of file styleengine.hh.
Referenced by computeValue(), and StyleEngine().
|
private |
Definition at line 50 of file styleengine.hh.
Referenced by parse(), and StyleEngine().
|
private |
Definition at line 46 of file styleengine.hh.
Referenced by apply(), computeValue(), and StyleEngine().
|
private |
Definition at line 53 of file styleengine.hh.
Referenced by apply(), StyleEngine(), and ~StyleEngine().
|
private |
Definition at line 47 of file styleengine.hh.
Referenced by apply(), backgroundColor(), backgroundImage(), backgroundStyle(), clearNonCssHints(), computeValue(), inheritBackgroundColor(), inheritNonCssHints(), preprocessAttrs(), restyle(), setNonCssHint(), setStyle(), stackPop(), stackPush(), startElement(), style(), style0(), StyleEngine(), wordStyle(), wordStyle0(), and ~StyleEngine().
|
private |
Definition at line 52 of file styleengine.hh.
Referenced by apply(), computeValue(), and StyleEngine().