diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2005-03-22 00:10:42 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2005-03-22 00:10:42 +0000 |
commit | b832e05f034ccca6d2bcaa058ca0d9d6214bd22b (patch) | |
tree | 472ef7907956bd00501387a6588a51548a0d4793 /css/css.c | |
parent | 28d9260ca463abe3992fd674cc127b6b2baa04aa (diff) | |
download | netsurf-b832e05f034ccca6d2bcaa058ca0d9d6214bd22b.tar.gz netsurf-b832e05f034ccca6d2bcaa058ca0d9d6214bd22b.tar.bz2 |
[project @ 2005-03-22 00:10:42 by rjw]
Experimental cellpadding support
svn path=/import/netsurf/; revision=1569
Diffstat (limited to 'css/css.c')
-rw-r--r-- | css/css.c | 34 |
1 files changed, 22 insertions, 12 deletions
@@ -109,6 +109,7 @@ static void css_dump_selector(const struct css_selector *r); /** Default style for a document. These are the 'Initial values' from the * spec. */ const struct css_style css_base_style = { + { {CSS_CELLPADDING_VALUE, 1} }, CSS_BACKGROUND_ATTACHMENT_SCROLL, 0xffffff, { CSS_BACKGROUND_IMAGE_NONE, 0 }, @@ -165,10 +166,10 @@ const struct css_style css_base_style = { { CSS_BORDER_WIDTH_LENGTH, { 2, CSS_UNIT_PX } }, CSS_BORDER_STYLE_NONE }, CSS_OVERFLOW_VISIBLE, - { { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } } }, + { { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, }, CSS_PAGE_BREAK_AFTER_AUTO, CSS_PAGE_BREAK_BEFORE_AUTO, CSS_PAGE_BREAK_INSIDE_AUTO, @@ -194,6 +195,7 @@ const struct css_style css_base_style = { /** Style with no values set. */ const struct css_style css_empty_style = { + { { CSS_CELLPADDING_NOT_SET, 0 } }, CSS_BACKGROUND_ATTACHMENT_NOT_SET, CSS_COLOR_NOT_SET, { CSS_BACKGROUND_IMAGE_NOT_SET, 0 }, @@ -250,10 +252,10 @@ const struct css_style css_empty_style = { { CSS_BORDER_WIDTH_NOT_SET, { 0, CSS_UNIT_PX } }, CSS_BORDER_STYLE_NOT_SET }, CSS_OVERFLOW_NOT_SET, - { { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } } } }, + { { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_NOT_SET, { { 0, CSS_UNIT_PX } }, false }, }, CSS_PAGE_BREAK_AFTER_NOT_SET, CSS_PAGE_BREAK_BEFORE_NOT_SET, CSS_PAGE_BREAK_INSIDE_NOT_SET, @@ -280,6 +282,7 @@ const struct css_style css_empty_style = { /** Default style for an element. These should be INHERIT if 'Inherited' is yes, * and the 'Initial value' otherwise. */ const struct css_style css_blank_style = { + { { CSS_CELLPADDING_INHERIT, 0 } }, CSS_BACKGROUND_ATTACHMENT_SCROLL, TRANSPARENT, { CSS_BACKGROUND_IMAGE_NONE, 0 }, @@ -336,10 +339,10 @@ const struct css_style css_blank_style = { { CSS_BORDER_WIDTH_LENGTH, { 2, CSS_UNIT_PX } }, CSS_BORDER_STYLE_NONE }, CSS_OVERFLOW_VISIBLE, - { { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } }, - { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } } } }, + { { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, + { CSS_PADDING_LENGTH, { { 0, CSS_UNIT_PX } }, false }, }, CSS_PAGE_BREAK_AFTER_AUTO, CSS_PAGE_BREAK_BEFORE_AUTO, CSS_PAGE_BREAK_INSIDE_INHERIT, @@ -2378,6 +2381,11 @@ void css_cascade(struct css_style * const style, unsigned int i; float f; + if (apply->html_style.cellpadding.type != + CSS_CELLPADDING_INHERIT && + apply->html_style.cellpadding.type != + CSS_CELLPADDING_NOT_SET) + style->html_style.cellpadding = apply->html_style.cellpadding; if (apply->background_attachment != CSS_BACKGROUND_ATTACHMENT_INHERIT && apply->background_attachment != @@ -2668,6 +2676,8 @@ void css_merge(struct css_style * const style, { unsigned int i; + if (apply->html_style.cellpadding.type != CSS_CELLPADDING_NOT_SET) + style->html_style.cellpadding = apply->html_style.cellpadding; if (apply->background_attachment != CSS_BACKGROUND_ATTACHMENT_NOT_SET) style->background_attachment = apply->background_attachment; if (apply->background_color != CSS_COLOR_NOT_SET) |